Skip to content

Commit

Permalink
test/storagelib: step up our destroy-and-reboot efforts
Browse files Browse the repository at this point in the history
Instead of trying to gracefully shutdown a destroyed system from the
inside, do it forcefully from the outside.
  • Loading branch information
allisonkarlitskaya committed May 8, 2024
1 parent bea907d commit 89e5704
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/common/storagelib.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,8 +554,13 @@ def encrypt_root(self, passphrase):
grubby --update-kernel=ALL --args="root=UUID=$uuid rootflags=defaults rd.luks.uuid=$luks_uuid rd.lvm.lv=root/root"
! test -f /etc/kernel/cmdline || cp /etc/kernel/cmdline /new-root/etc/kernel/cmdline
""", timeout=300)
m.spawn("dd if=/dev/zero of=/dev/vda bs=1M count=100; reboot", "reboot", check=False)
m.wait_reboot(300)

# Destroy our current boot device. This prevents the system from
# shutting down properly, so do it forcefully from outside.
m.execute("sync; dd if=/dev/zero of=/dev/vda bs=1M count=100; sync; sync; sync;")
m.kill()
m.start()
m.wait_boot()
self.assertEqual(m.execute("findmnt -n -o SOURCE /").strip(), "/dev/mapper/root-root")

# Cards and tables
Expand Down

0 comments on commit 89e5704

Please sign in to comment.