Skip to content

Commit e5a0cb2

Browse files
committed
fix tests based on real runs
used WIP patch of Openscap, so far tests can't be still ran
1 parent fbeff85 commit e5a0cb2

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

tests/probes/symlink/test_offline_mode_symlink.sh

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ function test_offline_mode_symlink {
3434
ln -s /etc/shadow $tmpdir/etc/passwd
3535
touch $tmpdir/file_in_root
3636
ln -s ../../../../../file_in_root $tmpdir/path_traversal_symlink
37-
ln -s ./some_file $tmpdir/symlink_with_period_in_path
37+
ln -s ./some_file $tmpdir/symlink_with_dot_in_path
3838
touch /tmp/symlinktarget
3939
ln -s /tmp/symlinktarget /tmp/symlinktest
4040

4141

4242

4343
bash ${srcdir}/test_offline_mode_symlink.xml.sh "" > "$DF"
4444
export OSCAP_PROBE_ROOT="$tmpdir"
45-
$OSCAP oval eval --verbose INFO --results $RF $DF
45+
$OSCAP oval eval --results $RF $DF
4646

4747
result=$RF
4848

@@ -54,21 +54,18 @@ function test_offline_mode_symlink {
5454
p='oval_results/results/system/oval_system_characteristics/'
5555
assert_exists 12 $p'collected_objects/object'
5656
assert_exists 6 $p'collected_objects/object[@flag="complete"]'
57-
assert_exists 9 $p'system_data/unix-sys:symlink_item'
57+
assert_exists 6 $p'system_data/unix-sys:symlink_item'
5858
assert_exists 6 $p'system_data/unix-sys:symlink_item[@status="exists"]'
5959
assert_exists 1 $p'system_data/unix-sys:symlink_item/unix-sys:filepath[text()="'/normal_symlink'"]'
6060
assert_exists 1 $p'system_data/unix-sys:symlink_item/unix-sys:filepath[text()="'/normal_symlink_relative'"]'
61-
assert_exists 2 $p'system_data/unix-sys:symlink_item/unix-sys:canonical_path[text()="/some_file"]'
61+
assert_exists 3 $p'system_data/unix-sys:symlink_item/unix-sys:canonical_path[text()="/some_file"]'
6262
assert_exists 1 $p'system_data/unix-sys:symlink_item/unix-sys:filepath[text()="'/chained_symlink'"]'
6363
assert_exists 1 $p'system_data/unix-sys:symlink_item/unix-sys:canonical_path[text()="/other_file"]'
6464
assert_exists 1 $p'system_data/unix-sys:symlink_item/unix-sys:filepath[text()="'/etc/passwd'"]'
6565
assert_exists 1 $p'system_data/unix-sys:symlink_item/unix-sys:canonical_path[text()="/etc/shadow"]'
66-
assert_exists 1 $p'system_data/unix-sys:symlink_item/unix-sys:filepath[text()="'/chained_symlink_relative'"]'
67-
assert_exists 1 $p'system_data/unix-sys:symlink_item/unix-sys:canonical_path[text()="/other_file"]'
6866
assert_exists 1 $p'system_data/unix-sys:symlink_item/unix-sys:filepath[text()="'/path_traversal_symlink'"]'
6967
assert_exists 1 $p'system_data/unix-sys:symlink_item/unix-sys:canonical_path[text()="/file_in_root"]'
7068
assert_exists 1 $p'system_data/unix-sys:symlink_item/unix-sys:filepath[text()="'/symlink_with_dot_in_path'"]'
71-
assert_exists 1 $p'system_data/unix-sys:symlink_item/unix-sys:canonical_path[text()="/some_file"]'
7269
assert_exists 3 $p'collected_objects/object[@flag="error"]'
7370
assert_exists 3 $p'collected_objects/object[@flag="does not exist"]'
7471
assert_exists 6 $p'collected_objects/object/message'

0 commit comments

Comments
 (0)