]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
qa/workunits/rbd: no need to chmod in luks-encryption.sh
authorIlya Dryomov <idryomov@gmail.com>
Sat, 3 Aug 2024 17:31:03 +0000 (19:31 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Sun, 11 Aug 2024 17:21:28 +0000 (19:21 +0200)
Most workunits expect the user to be a member of "disk" group, so we
can pretty much rely on that being the case at this point.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 830cbee7a5f875af04f335266b02ad96e4cd71c4)

qa/workunits/rbd/luks-encryption.sh

index a8d4c53997218d0af5902e9b79e7dbff408b4613..ef205c7c06384cbf991017957d1853214ac3dfb4 100755 (executable)
@@ -40,11 +40,9 @@ function test_encryption_format() {
 
   # open encryption with cryptsetup
   sudo cryptsetup open $RAW_DEV --type luks cryptsetupdev -d /tmp/passphrase
-  sudo chmod 666 /dev/mapper/cryptsetupdev
 
   # open encryption with librbd
   LIBRBD_DEV=$(_sudo rbd -p rbd map testimg -t nbd -o encryption-passphrase-file=/tmp/passphrase)
-  sudo chmod 666 $LIBRBD_DEV
 
   # write via librbd && compare
   dd if=/tmp/testdata1 of=$LIBRBD_DEV conv=fsync bs=1M
@@ -84,7 +82,6 @@ function test_clone_encryption() {
 
   # open encryption with librbd, write one more MB, close
   LIBRBD_DEV=$(_sudo rbd -p rbd map testimg1 -t nbd -o encryption-format=luks1,encryption-passphrase-file=/tmp/passphrase)
-  sudo chmod 666 $LIBRBD_DEV
   dd if=$LIBRBD_DEV of=/tmp/cmpdata bs=1M count=1
   cmp -n 1MB /tmp/cmpdata /tmp/testdata1
   dd if=/tmp/testdata1 of=$LIBRBD_DEV seek=1 skip=1 conv=fsync bs=1M count=1
@@ -98,7 +95,6 @@ function test_clone_encryption() {
 
   # open encryption with librbd, write one more MB, close
   LIBRBD_DEV=$(_sudo rbd -p rbd map testimg2 -t nbd -o encryption-format=luks2,encryption-passphrase-file=/tmp/passphrase2,encryption-format=luks1,encryption-passphrase-file=/tmp/passphrase)
-  sudo chmod 666 $LIBRBD_DEV
   dd if=$LIBRBD_DEV of=/tmp/cmpdata bs=1M count=2
   cmp -n 2MB /tmp/cmpdata /tmp/testdata1
   dd if=/tmp/testdata1 of=$LIBRBD_DEV seek=2 skip=2 conv=fsync bs=1M count=1
@@ -111,7 +107,6 @@ function test_clone_encryption() {
   # verify with cryptsetup
   RAW_FLAT_DEV=$(_sudo rbd -p rbd map testimg2 -t nbd)
   sudo cryptsetup open $RAW_FLAT_DEV --type luks cryptsetupdev -d /tmp/passphrase2
-  sudo chmod 666 /dev/mapper/cryptsetupdev
   dd if=/dev/mapper/cryptsetupdev of=/tmp/cmpdata bs=1M count=3
   cmp -n 3MB /tmp/cmpdata /tmp/testdata1
   _sudo rbd device unmap -t nbd $RAW_FLAT_DEV
@@ -205,7 +200,6 @@ rbd create testimg --size=32M
 
 # map raw data to nbd device
 RAW_DEV=$(_sudo rbd -p rbd map testimg -t nbd)
-sudo chmod 666 $RAW_DEV
 
 test_plaintext_detection