From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v3 2/6] shell: Add tst_security.sh helper
Date: Wed, 23 Jan 2019 17:20:07 +0100 [thread overview]
Message-ID: <20190123162007.GA29183@dell5510> (raw)
In-Reply-To: <20181218010220.2446-3-pvorel@suse.cz>
Hi,
I decided to print warning on all TBROK/TCONF/TFAIL/TWARN (originally it was only on TFAIL).
This is needed for dnsmasq tests, which TBROK due AppArmor profile.
And split long messages into 2 (besides obvious fixes reported by Alexey).
Kind regards,
Petr
Diff of this commit with posted version:
diff --git testcases/lib/tst_security.sh testcases/lib/tst_security.sh
index 2c8c30f42..25e085d3c 100644
--- testcases/lib/tst_security.sh
+++ testcases/lib/tst_security.sh
@@ -16,7 +16,8 @@ _tst_check_security_modules()
local profiles
if tst_apparmor_enabled; then
- tst_res TINFO "AppArmor enabled, this may affect test results. Disable it with TST_DISABLE_APPARMOR=1 (requires super/root)"
+ tst_res TINFO "AppArmor enabled, this may affect test results"
+ tst_res TINFO "You can try to disable it with TST_DISABLE_APPARMOR=1 (requires super/root)"
profiles=
for cmd in $TST_NEEDS_CMDS; do
tst_apparmor_used_profile $cmd && profiles="$cmd $profiles"
@@ -26,7 +27,8 @@ _tst_check_security_modules()
fi
if tst_selinux_enabled; then
- tst_res TINFO "SELinux enabled in enforcing mode, this may affect test results. Disable it with TST_DISABLE_SELINUX=1 (requires super/root)"
+ tst_res TINFO "SELinux enabled in enforcing mode, this may affect test results"
+ tst_res TINFO "You can try to disable it with TST_DISABLE_SELINUX=1 (requires super/root)"
profiles=
for cmd in $TST_NEEDS_CMDS; do
tst_selinux_used_profile $cmd && profiles="$cmd $profiles"
diff --git testcases/lib/tst_test.sh testcases/lib/tst_test.sh
index 333061028..e69301e54 100644
--- testcases/lib/tst_test.sh
+++ testcases/lib/tst_test.sh
@@ -68,7 +68,6 @@ _tst_do_exit()
if [ $TST_FAIL -gt 0 ]; then
ret=$((ret|1))
- _tst_check_security_modules
fi
if [ $TST_BROK -gt 0 ]; then
@@ -83,6 +82,10 @@ _tst_do_exit()
ret=$((ret|32))
fi
+ if [ $TST_BROK -gt 0 -o $TST_CONF -gt 0 -o $TST_FAIL -gt 0 -o $TST_WARN -gt 0 ]; then
+ _tst_check_security_modules
+ fi
+
echo
echo "Summary:"
echo "passed $TST_PASS"
next prev parent reply other threads:[~2019-01-23 16:20 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-18 1:02 [LTP] [PATCH v3 0/6] DHCP tests and AppArmor/SELinux improvements Petr Vorel
2018-12-18 1:02 ` [LTP] [PATCH v3 1/6] net/dhcp: Rename setup & cleanup functions Petr Vorel
2018-12-18 1:02 ` [LTP] [PATCH v3 2/6] shell: Add tst_security.sh helper Petr Vorel
2018-12-19 12:38 ` Alexey Kodanev
2018-12-19 13:33 ` Petr Vorel
2019-01-16 13:12 ` Cyril Hrubis
2019-01-16 15:20 ` Petr Vorel
2019-01-23 14:08 ` Cyril Hrubis
2019-01-23 16:20 ` Petr Vorel [this message]
2019-01-23 16:20 ` Cyril Hrubis
2019-01-29 18:24 ` Petr Vorel
2018-12-18 1:02 ` [LTP] [PATCH v3 3/6] net/dhcp: Use for allowed by AppArmor and SELinux Petr Vorel
2018-12-18 1:02 ` [LTP] [PATCH v3 4/6] net/dhcp: Check also default dhclient lease file path Petr Vorel
2018-12-18 1:02 ` [LTP] [PATCH v3 5/6] net/dhcp: Move print_dhcp_log() into dhcp library Petr Vorel
2018-12-18 1:02 ` [LTP] [PATCH v3 6/6] ver_linux: Print AppArmor and SELinux status Petr Vorel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190123162007.GA29183@dell5510 \
--to=pvorel@suse.cz \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox