Skip to content

Commit

Permalink
tests: add sbin to PATH so mkfs.ext4 works under Whonix
Browse files Browse the repository at this point in the history
  • Loading branch information
marmarek committed Feb 3, 2025
1 parent c1cdf38 commit ece1603
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions qubes/tests/integ/backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,8 @@ def test_110_send_to_vm_no_space(self):
self.loop.run_until_complete(self.backupvm.start())
self.loop.run_until_complete(
self.backupvm.run_for_stdio(
# add sbin in Debian/Whonix for mkfs.ext4
"PATH=$PATH:/usr/sbin;"
# Debian 7 has too old losetup to handle loop-control device
"mknod /dev/loop0 b 7 0;"
"truncate -s 50M /home/user/backup.img && "
Expand Down
18 changes: 18 additions & 0 deletions qubes/tests/integ/devices_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ def test_000_list_loop(self):
if self.template is None:
self.skipTest("loop devices excluded in dom0")
self.run_script(
# add sbin in Debian/Whonix for mkfs.ext4
"PATH=$PATH:/usr/sbin;"
"set -e;"
"truncate -s 128M {path}; "
"losetup -f {path}; "
Expand All @@ -106,6 +108,8 @@ def test_001_list_loop_mounted(self):
if self.template is None:
self.skipTest("loop devices excluded in dom0")
self.run_script(
# add sbin in Debian/Whonix for mkfs.ext4
"PATH=$PATH:/usr/sbin;"
"set -e;"
"truncate -s 128M {path}; "
"mkfs.ext4 -q -F {path}; "
Expand All @@ -128,6 +132,8 @@ def test_001_list_loop_mounted(self):

def test_010_list_dm(self):
self.run_script(
# add sbin in Debian/Whonix for mkfs.ext4
"PATH=$PATH:/usr/sbin;"
"set -e;"
"truncate -s 128M {path}; "
"loopdev=`losetup -f`; "
Expand Down Expand Up @@ -158,6 +164,8 @@ def test_010_list_dm(self):

def test_011_list_dm_mounted(self):
self.run_script(
# add sbin in Debian/Whonix for mkfs.ext4
"PATH=$PATH:/usr/sbin;"
"set -e;"
"truncate -s 128M {path}; "
"loopdev=`losetup -f`; "
Expand Down Expand Up @@ -192,6 +200,8 @@ def test_011_list_dm_mounted(self):

def test_012_list_dm_delayed(self):
self.run_script(
# add sbin in Debian/Whonix for mkfs.ext4
"PATH=$PATH:/usr/sbin;"
"set -e;"
"truncate -s 128M {path}; "
"loopdev=`losetup -f`; "
Expand Down Expand Up @@ -227,6 +237,8 @@ def test_013_list_dm_removed(self):
"test not supported in dom0 - loop devices excluded " "in dom0"
)
self.run_script(
# add sbin in Debian/Whonix for mkfs.ext4
"PATH=$PATH:/usr/sbin;"
"set -e;"
"truncate -s 128M {path}; "
"loopdev=`losetup -f`; "
Expand Down Expand Up @@ -257,6 +269,8 @@ def test_020_list_loop_partition(self):
if self.template is None:
self.skipTest("loop devices excluded in dom0")
self.run_script(
# add sbin in Debian/Whonix for mkfs.ext4
"PATH=$PATH:/usr/sbin;"
"set -e;"
"truncate -s 128M {path}; "
"echo ,,L | sfdisk {path};"
Expand Down Expand Up @@ -286,6 +300,8 @@ def test_021_list_loop_partition_mounted(self):
if self.template is None:
self.skipTest("loop devices excluded in dom0")
self.run_script(
# add sbin in Debian/Whonix for mkfs.ext4
"PATH=$PATH:/usr/sbin;"
"set -e;"
"truncate -s 128M {path}; "
"echo ,,L | sfdisk {path};"
Expand Down Expand Up @@ -345,6 +361,8 @@ def setUp(self):
self.fail("Failed to start some VM: {!r}".format(exc))
self.loop.run_until_complete(
self.backend.run_for_stdio(
# add sbin in Debian/Whonix for mkfs.ext4
"PATH=$PATH:/usr/sbin;"
"set -e;"
"truncate -s 128M {path}; "
"losetup -f {path}; "
Expand Down

0 comments on commit ece1603

Please sign in to comment.