File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -196,12 +196,14 @@ set_chroot_offline_test_mode() {
196
196
echo " Skipping test '${FUNCNAME[1]} ' as '$OSCAP_CHROOTABLE_EXEC ' doesn't have the chroot capability." >&2
197
197
return 255
198
198
fi
199
+ _OSCAP_BEFORE=" $OSCAP "
200
+ OSCAP=" $OSCAP_CHROOTABLE "
201
+ elif test $( id -u) -eq 0; then
202
+ : # Running offline tests as root is acceptable too
199
203
else
200
204
echo " Skipping test '${FUNCNAME[1]} ' as '$OSCAP_CHROOTABLE_EXEC ' oscap which is supposed to have chroot capability doesn't exist." >&2
201
205
return 255
202
206
fi
203
- _OSCAP_BEFORE=" $OSCAP "
204
- OSCAP=" $OSCAP_CHROOTABLE "
205
207
set_offline_chroot_dir " $1 "
206
208
return 0
207
209
}
@@ -216,13 +218,11 @@ set_offline_chroot_dir() {
216
218
}
217
219
218
220
unset_chroot_offline_test_mode () {
219
- if ! test -n " $_OSCAP_BEFORE " ; then
220
- echo " Not in the offline test mode! " >&2
221
- return
221
+ if test -n " $_OSCAP_BEFORE " ; then
222
+ OSCAP= " $_OSCAP_BEFORE "
223
+ _OSCAP_BEFORE=
222
224
fi
223
- OSCAP=" $_OSCAP_BEFORE "
224
225
set_offline_chroot_dir " "
225
- _OSCAP_BEFORE=
226
226
}
227
227
228
228
export -f assert_exists
You can’t perform that action at this time.
0 commit comments