Skip to content

Commit

Permalink
Merge pull request #394 from KKoukiou/luks-btrfs
Browse files Browse the repository at this point in the history
test: add check for using mount point assignment with btrfs on LUKS
  • Loading branch information
KKoukiou authored Aug 13, 2024
2 parents f1ac86c + aa74061 commit 98d3231
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions test/check-storage-mountpoints
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,50 @@ class TestStorageMountPoints(VirtInstallMachineCase, StorageCase):

self._testEncryptedUnlock(b, m)

def testEncryptedUnlockBTRFSonLUKS(self):
b = self.browser
m = self.machine
i = Installer(b, m)
s = Storage(b, m)
r = Review(b, m)

disk = "/dev/vda"
dev = "vda"
tmp_mount = "/tmp/btrfs-mount-test"
s.partition_disk(disk, [("1MiB", "biosboot"), ("1GB", "ext4"), ("", "btrfs")])
m.execute(f"""
# encrypt the btrfs partition
echo einszweidrei | cryptsetup luksFormat {disk}3
echo einszweidrei | cryptsetup luksOpen {disk}3 encrypted-vol
mkfs.btrfs -f /dev/mapper/encrypted-vol
mkdir -p {tmp_mount}
mount /dev/mapper/encrypted-vol {tmp_mount}
btrfs subvolume create {tmp_mount}/root
btrfs subvolume create {tmp_mount}/home
btrfs subvolume create {tmp_mount}/unused
umount {tmp_mount}
rmdir {tmp_mount}
""")
s.udevadm_settle()

i.open()
i.reach(i.steps.INSTALLATION_METHOD)
s.rescan_disks()
s.select_mountpoint([(dev, True)], encrypted=True)

# Unlock the LUKS device
s.unlock_all_encrypted()
s.unlock_device("einszweidrei", ["vda3"], ["vda3"])

# Select the mountpoints
s.select_mountpoint_row_device(1, "root")
s.select_mountpoint_row_device(2, f"{dev}2")

# Verify the review page
i.reach(i.steps.REVIEW)
r.check_disk_row(dev, "/boot", "vda2", "1.07 GB", False)
r.check_disk_row(dev, "/", "vda3", "15.0 GB", True, "btrfs", True)

def testEncryptedUnlockRAIDonLUKS(self):
# RAID on LUKS: partition -> LUKS -> RAID -> filesystem
b = self.browser
Expand Down

0 comments on commit 98d3231

Please sign in to comment.