-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests/spread/integration: add tests for systemd and mount
- Loading branch information
1 parent
206e3ca
commit 8081645
Showing
5 changed files
with
58 additions
and
1 deletion.
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,9 @@ | ||
summary: Integration tests for mount | ||
|
||
execute: | | ||
# Chisel a minimum number of slices to give us a runnable system that we can | ||
# test in. | ||
rootfs="$(install-slices bash_bins coreutils_bins passwd_config base-files_base mount_bins)" | ||
cp test.sh "${rootfs}/" | ||
chroot "${rootfs}/" /test.sh |
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,14 @@ | ||
#!/bin/bash | ||
|
||
# Run a smoke test for mount and umount to verify that | ||
# they are doing what we expect by testing on /proc | ||
mkdir /test-bin | ||
mount --bind /bin /test-bin | ||
count=$(ls /test-bin | wc -l) | ||
umount /test-bin | ||
|
||
if [ $count -eq 0 ] | ||
then | ||
echo "no files in /test-bin, did mount not work?" | ||
exit 1 | ||
fi |
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,15 @@ | ||
summary: Integration tests for systemd | ||
|
||
execute: | | ||
# Chisel a minimum number of slices to give us a runnable system that we can | ||
# test in. | ||
rootfs="$(install-slices bash_bins coreutils_bins passwd_config base-files_base systemd_bins)" | ||
# systemd needs proc mounted | ||
mkdir "${rootfs}"/proc | ||
mount --bind /proc "${rootfs}"/proc | ||
cp test.sh "${rootfs}/" | ||
chroot "${rootfs}/" /test.sh | ||
umount "${rootfs}"/proc |
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,18 @@ | ||
#!/bin/bash | ||
|
||
# Run some smoke-tests by invoking a couple of commands | ||
# from systemd to verify it's doing exactly what we expect | ||
# it to | ||
systemctl disable [email protected] | ||
! test -f "/etc/systemd/system/getty.target.wants/[email protected]" | ||
|
||
systemctl enable [email protected] | ||
test -f "/etc/systemd/system/getty.target.wants/[email protected]" | ||
|
||
# run preset-all and test for one of the expected symlinks | ||
systemctl preset-all | ||
test -f "/etc/systemd/system/ctrl-alt-del.target" | ||
|
||
# Run some auxiliary commands to ensure they don't fail | ||
systemd --help | ||
journalctl --update-catalog |