Skip to content

Commit 95c4d02

Browse files
committed
fix to assert calls
1 parent bd53cfc commit 95c4d02

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/test_ldcache_hook.bats

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,17 @@ helper_run_hooked_podman() {
7171
size=$(sed -E 's/.*cache_size=([0-9]+).*/\1/' <<<"$summary")
7272
mtime=$(sed -E 's/.*cache_mtime=([0-9]+).*/\1/' <<<"$summary")
7373

74+
# sanity check in case of empty values
75+
assert [ -n "$size" ]
76+
assert [ -n "$mtime" ]
77+
7478
# Check time is a number > 0 and so is size
7579
assert_regex "$size" '^[0-9]+$'
7680
assert_regex "$mtime" '^[0-9]+$'
77-
assert_gt "$mtime" 0
81+
82+
# a great-than check needs to pass by bash and then asserted
83+
run bash -c "[[ $mtime -gt 0 ]]"
84+
assert_success
7885
}
7986

8087
#@test "/etc/ld.so.cache exists after hook" {

0 commit comments

Comments
 (0)