Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test/storagelib: step up our destroy-and-reboot efforts #20449

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading