-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests/os: Add kernel - dtb overlap test
If a kernel or dtb overlap or overwrite is detected in u-boot, a file named overlap_detected is created in the boot partition. In this test we check for the presence of this file. Signed-off-by: Alexandru Costache <alexandru@balena.io>
- Loading branch information
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module.exports = { | ||
title: 'Kernel and device-tree overlap test', | ||
run: async function(test) { | ||
test.comment(`Checking if the kernel or the device-tree have been overwritten`); | ||
let result = ''; | ||
result = await this.context | ||
.get() | ||
.worker.executeCommandInHostOS( | ||
`if [ -e /mnt/boot/overlap_detected ]; then echo "Test failed"; else echo "OK"; fi;`, | ||
this.link, | ||
); | ||
|
||
if (result.includes('OK')) { | ||
test.comment(`not ok! - kernel - dtb overlap detected`); | ||
} else { | ||
test.comment(`ok - no overlap detected`); | ||
} | ||
|
||
test.is(result.includes('OK'), true, 'Kernel - dtb overlap check completed'); | ||
}, | ||
}; |