Keep update regressions isolated from host authentication
This commit is contained in:
1 parent
35b318ed09
commit
c52381f092
2 files changed
+14
-10
No files matched your search
@@ -48,7 +48,7 @@ if [[ ${1:-} == "-h" ]]; then
|
|||||||
fi
|
fi
|
||||||
if [[ ${1:-} == "-k" || ${1:-} == "-K" ]]; then
|
if [[ ${1:-} == "-k" || ${1:-} == "-K" ]]; then
|
||||||
[[ ${SUDO_TEST_REVOKE_FAIL:-0} != "1" ]] || exit 1
|
[[ ${SUDO_TEST_REVOKE_FAIL:-0} != "1" ]] || exit 1
|
||||||
rm -f "$SUDO_TEST_CACHE"
|
/usr/bin/rm -f "$SUDO_TEST_CACHE"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
if [[ ${1:-} == "-N" ]]; then
|
if [[ ${1:-} == "-N" ]]; then
|
||||||
@@ -115,7 +115,7 @@ ln -s ../bin/test-step "$SUDO_TEST_ROOT/mock/pacman"
|
|||||||
|
|
||||||
reset_boundary() {
|
reset_boundary() {
|
||||||
: >"$SUDO_TEST_LOG"
|
: >"$SUDO_TEST_LOG"
|
||||||
rm -f "$SUDO_TEST_CACHE"
|
/usr/bin/rm -f "$SUDO_TEST_CACHE"
|
||||||
unset SUDO_TEST_FAIL_STEP SUDO_TEST_SIGNAL_STEP SUDO_TEST_SUDO_FAIL SUDO_TEST_REVOKE_FAIL SUDO_TEST_UNSUPPORTED
|
unset SUDO_TEST_FAIL_STEP SUDO_TEST_SIGNAL_STEP SUDO_TEST_SUDO_FAIL SUDO_TEST_REVOKE_FAIL SUDO_TEST_UNSUPPORTED
|
||||||
}
|
}
|
||||||
assert_boundary_cold() {
|
assert_boundary_cold() {
|
||||||
|
|||||||
@@ -9,18 +9,21 @@ unset OMARCHY_UPDATE_FORCE
|
|||||||
unset TEST_AVAILABLE_BYTES
|
unset TEST_AVAILABLE_BYTES
|
||||||
unset TEST_DF_INVALID
|
unset TEST_DF_INVALID
|
||||||
|
|
||||||
test_tmp=$(mktemp -d)
|
source "$SHELL_TEST_DIR/fixtures/sudo-boundary-test.sh"
|
||||||
trap 'rm -rf "$test_tmp"' EXIT
|
test_tmp="$boundary_tmp"
|
||||||
|
stub_bin="$SUDO_TEST_ROOT/bin"
|
||||||
stub_bin="$test_tmp/bin"
|
test_home="$SUDO_TEST_HOME"
|
||||||
test_home="$test_tmp/home"
|
|
||||||
runtime_dir="$test_tmp/runtime"
|
runtime_dir="$test_tmp/runtime"
|
||||||
snapshot_marker="$test_tmp/snapshot"
|
snapshot_marker="$test_tmp/snapshot"
|
||||||
gum_marker="$test_tmp/gum"
|
gum_marker="$test_tmp/gum"
|
||||||
mkdir -p "$stub_bin" "$test_home" "$runtime_dir"
|
mkdir -p "$runtime_dir"
|
||||||
|
for command in omarchy-update omarchy-update-requires-free-space omarchy-update-confirm; do
|
||||||
|
rm -f "$stub_bin/$command"
|
||||||
|
copy_boundary_file "bin/$command"
|
||||||
|
done
|
||||||
|
|
||||||
run_update() {
|
run_update() {
|
||||||
HOME="$test_home" \
|
SUDO_TEST_HOME="$test_home" \
|
||||||
XDG_RUNTIME_DIR="$runtime_dir" \
|
XDG_RUNTIME_DIR="$runtime_dir" \
|
||||||
PATH="$stub_bin:$ROOT/bin:$PATH" \
|
PATH="$stub_bin:$ROOT/bin:$PATH" \
|
||||||
LC_ALL=C \
|
LC_ALL=C \
|
||||||
@@ -30,13 +33,14 @@ run_update() {
|
|||||||
SNAPSHOT_MARKER="$snapshot_marker" \
|
SNAPSHOT_MARKER="$snapshot_marker" \
|
||||||
GUM_MARKER="$gum_marker" \
|
GUM_MARKER="$gum_marker" \
|
||||||
GUM_STATUS=${GUM_STATUS:-1} \
|
GUM_STATUS=${GUM_STATUS:-1} \
|
||||||
"$ROOT/bin/omarchy-update" "$@"
|
"$SUDO_TEST_ROOT/bin/omarchy-update" "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
write_stub() {
|
write_stub() {
|
||||||
local name="$1"
|
local name="$1"
|
||||||
local body="$2"
|
local body="$2"
|
||||||
|
|
||||||
|
rm -f "$stub_bin/$name"
|
||||||
cat >"$stub_bin/$name" <<SH
|
cat >"$stub_bin/$name" <<SH
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
$body
|
$body
|
||||||
|
|||||||
Reference in new issue
Block a user