-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests/kola: catch SELinux unlabeled and mislabeled files
This adds a unlabeled and mislabeled files test and also adds code to the extended upgrade test to verify there aren't any suprises there either.
- Loading branch information
Showing
2 changed files
with
65 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
## kola: | ||
## exclusive: false | ||
## tags: "platform-independent" | ||
## description: Verify there are no unlabeled or mislabeled files on the system. | ||
|
||
# See https://github.com/coreos/fedora-coreos-tracker/issues/1772 | ||
|
||
set -xeuo pipefail | ||
|
||
# shellcheck disable=SC1091 | ||
. "$KOLA_EXT_DATA/commonlib.sh" | ||
|
||
unlabeled="$(find /sysroot -context *unlabeled_t* | xargs -I{} ls -ldZ '{}')" | ||
if [ -n "${unlabeled}" ]; then | ||
fatal "Some unlabeled files were found" | ||
fi | ||
|
||
mislabeled="$(restorecon -vnr /var/ /etc/ /usr/ /boot/)" | ||
if [ -n "${mislabeled}" ]; then | ||
fatal "Some mislabeled files were found" | ||
fi | ||
|
||
ok "No unlabeled or mislabeled files found!" |
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