@@ -12,13 +12,13 @@ p1="xccdf_com.example.www_profile_P1"
1212
1313# Test 1: --list-rules with --profile prints selected rule IDs
1414$OSCAP info --profile $p1 --list-rules $ds > $stdout 2> $stderr
15- [ -f $stderr ]; [ ! -s $stderr ]; :> $stderr
15+ [[ -f $stderr ]] ; [[ ! -s $stderr ] ]; :> $stderr
1616grep -q " xccdf_com.example.www_rule_R1" $stdout
1717grep -q " xccdf_com.example.www_rule_R2" $stdout
1818grep -q " xccdf_com.example.www_rule_R3" $stdout
1919grep -q " xccdf_com.example.www_rule_R4" $stdout
2020# Verify output contains only rule IDs, one per line (4 rules = 4 lines)
21- [ " $( wc -l < $stdout ) " -eq 4 ]
21+ [[ " $( wc -l < $stdout ) " -eq 4 ] ]
2222:> $stdout
2323
2424# Test 2: --list-rules without --profile produces an error
@@ -31,24 +31,24 @@ grep -q "\-\-list-rules option requires \-\-profile" $stderr
3131tailoring=" $srcdir /test_tailoring_file.xml"
3232tp=" xccdf_com.example.www_profile_P1_tailored"
3333$OSCAP info --profile $tp --list-rules $tailoring > $stdout 2> $stderr
34- [ -f $stderr ]; [ ! -s $stderr ]; :> $stderr
34+ [[ -f $stderr ]] ; [[ ! -s $stderr ] ]; :> $stderr
3535grep -q " xccdf_com.example.www_rule_R1" $stdout
3636grep -q " xccdf_com.example.www_rule_R2" $stdout
3737# R3 and R4 are deselected by tailoring
3838! grep -q " xccdf_com.example.www_rule_R3" $stdout
3939! grep -q " xccdf_com.example.www_rule_R4" $stdout
40- [ " $( wc -l < $stdout ) " -eq 2 ]
40+ [[ " $( wc -l < $stdout ) " -eq 2 ] ]
4141:> $stdout
4242
4343# Test 4: --list-rules with SDS containing tailoring
4444ds_tailoring=" $srcdir /test_reference_ds_with_tailoring.xml"
4545$OSCAP info --profile $tp --list-rules $ds_tailoring > $stdout 2> $stderr
46- [ -f $stderr ]; [ ! -s $stderr ]; :> $stderr
46+ [[ -f $stderr ]] ; [[ ! -s $stderr ] ]; :> $stderr
4747grep -q " xccdf_com.example.www_rule_R1" $stdout
4848grep -q " xccdf_com.example.www_rule_R2" $stdout
4949! grep -q " xccdf_com.example.www_rule_R3" $stdout
5050! grep -q " xccdf_com.example.www_rule_R4" $stdout
51- [ " $( wc -l < $stdout ) " -eq 2 ]
51+ [[ " $( wc -l < $stdout ) " -eq 2 ] ]
5252:> $stdout
5353
5454rm -f $stdout $stderr
0 commit comments