tests: Produce sorted policy with unique rule only
authorJan Cybulski <j.cybulski@samsung.com>
Thu, 13 Feb 2014 09:41:26 +0000 (10:41 +0100)
committerJosé Bollo <jose.bollo@open.eurogiciel.org>
Fri, 14 Feb 2014 14:34:04 +0000 (15:34 +0100)
There is no need for tests of sorted policies with non unique rules.
If someone prepares sorted policy, redundancy of rules should also
be removed during sorting.

tests/make_policies.bash

index 9a23cd7..e16d07e 100755 (executable)
@@ -48,7 +48,11 @@ do
                        "$generator" l=$l u=$u L=$L m=$m $I < $in | shuf > $outfile
 
                        #for merged policy make additionally sorted policy
-                       test $m -eq 1 && cat $outfile | sort > "$outdir""$type""$l""sorted" || true
+                       if [ $m -eq 0 ]
+                       then
+                               echo generating "$outdir""$type""$l""sorted"
+                               cat $outfile | sort > "$outdir""$type""$l""sorted"
+                       fi
                        done;
                fi
        done