Commit cc5aa8f
committed
ima_violations.sh: Another fix of condition evaluation
c0c3550 was not enough to fix evaluation against empty
$expected_violations:
ima_violations 1 TINFO: verify open writers violation
/opt/ltp/testcases/bin/ima_violations.sh: line 96: [: 0: unary operator expected
Therefore split checks into two if.
Also improvements (readability)
* shorten line length with saving subtraction into variable
* evaluate empty variable with ${:-}
Fixes: 726ed71 ("ima_violations.sh: Update validate() to support multiple violations")
Link: https://lore.kernel.org/ltp/20251211111046.87297-1-pvorel@suse.cz/
Reported-by: Martin Doucha <mdoucha@suse.cz>
Signed-off-by: Petr Vorel <pvorel@suse.cz>1 parent 6c67d40 commit cc5aa8f
File tree
1 file changed
+13
-7
lines changed- testcases/kernel/security/integrity/ima/tests
1 file changed
+13
-7
lines changedLines changed: 13 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
| 90 | + | |
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
96 | | - | |
97 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
98 | 104 | | |
99 | | - | |
| 105 | + | |
100 | 106 | | |
101 | 107 | | |
102 | 108 | | |
103 | 109 | | |
104 | 110 | | |
105 | | - | |
106 | | - | |
| 111 | + | |
| 112 | + | |
107 | 113 | | |
108 | 114 | | |
109 | 115 | | |
| |||
0 commit comments