Skip to content

Commit

Permalink
Merge pull request #202 from kinvolk/kai/verity-test-arm64
Browse files Browse the repository at this point in the history
kola/tests/misc/verity: add recursive list to provoke panic
  • Loading branch information
pothos committed Aug 11, 2021
2 parents edd19b0 + e8bb85f commit 1bf4808
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions kola/tests/misc/verity.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,9 @@ func VerityCorruption(c cluster.TestCluster) {
c.MustSSH(m, fmt.Sprintf(`sudo dd if=/dev/zero of=%s bs=1M count=10 status=none`, usrdev))

// make sure we flush everything so the filesystem has to go through to the device backing verity before fetching a file from /usr
// (done in one execution because after flushing command itself runs the corruption could already be detected).
_, err := c.SSH(m, "sudo /bin/sh -c 'sync; echo -n 3 >/proc/sys/vm/drop_caches; cat /usr/lib/os-release'")
// (done in one execution because after flushing command itself runs the corruption could already be detected,
// we just need to give arm64 QEMU tests a few more chances to detect the corruption while one 'cat' execution is enough on amd64).
_, err := c.SSH(m, "sudo /bin/sh -c 'sync; echo -n 3 >/proc/sys/vm/drop_caches; cat /usr/lib/os-release; ls -R /usr'")
if err == nil {
c.Fatalf("verity did not prevent reading from a corrupted disk (expected kernel panic)!")
}
Expand Down

0 comments on commit 1bf4808

Please sign in to comment.