Skip to content

Commit 712000a

Browse files
committed
Add a test to check --fix-type Anaconda
There should be 2 equal ways of generating Anaconda remediations: "oscap xccdf generate fix --fix-type anaconda" and "oscap xccdf generate fix --template urn:redhat:anaconda:pre" Both commands should give the same output. This tests a fix for https://bugzilla.redhat.com/show_bug.cgi?id=1736850 introduced by b1448ec
1 parent 9d02a13 commit 712000a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/API/XCCDF/unittests/test_report_anaconda_fixes.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@ grep -v "$line1" $result | grep -v "$line2" | grep -v "$line3"
2323
[ "`grep -v "$line1" $result | grep -v "$line2" | sed 's/\W//g'`"x == x ]
2424
:> $result
2525

26+
# use --fix-type instead of URN template to generate the same fix
27+
$OSCAP xccdf generate fix --fix-type anaconda \
28+
--output $result $srcdir/${name}.xccdf.xml 2>&1 > $stderr
29+
[ -f $stderr ]; [ ! -s $stderr ]; :> $stderr
30+
grep "$line1" $result
31+
grep "$line2" $result
32+
grep -v "$line1" $result | grep -v "$line2" | grep -v "$line3"
33+
[ "`grep -v "$line1" $result | grep -v "$line2" | sed 's/\W//g'`"x == x ]
34+
:> $result
35+
2636
$OSCAP xccdf generate fix --template urn:redhat:anaconda:pre \
2737
--profile xccdf_moc.elpmaxe.www_profile_1 \
2838
--output $result $srcdir/${name}.xccdf.xml 2>&1 > $stderr

0 commit comments

Comments
 (0)