Fix the bug in SMACK rule test 97/211097/1
authorjin-gyu.kim <jin-gyu.kim@samsung.com>
Tue, 30 Jul 2019 04:48:54 +0000 (13:48 +0900)
committerjin-gyu.kim <jin-gyu.kim@samsung.com>
Tue, 30 Jul 2019 04:48:57 +0000 (13:48 +0900)
- Restore previous SMACK rules when test is failed.

Change-Id: I879dc8c6b5d4460548d398846264656f68d2cf34

test/smack_rule_test/checksmackrule.sh

index 49b5c380b6f168af9f3adca06a29254da84c4c41..56f899a0d577103f86f22fe85ca0ebf8eaedb3df 100755 (executable)
@@ -48,6 +48,9 @@ then
        echo "$compare"
        echo "$compare" > $log_file
        /bin/echo "NO" >> $result_file
+       # restore the previous rules
+       smackctl clear
+       cat $tmp_current_rule | smackload
 else
        echo "TEST PASS"
        /bin/echo "YES" >> $result_file