Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/unit/test-deploy-refactor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ EOF
done
KIT_MDM_MANAGED=false
_build_tmp="$(mktemp -d)"
build_settings_file "$_build_tmp/settings.json" >/dev/null 2>&1
build_settings_file "$_build_tmp/settings.json" >/dev/null 2>&1 || exit 1
jq -e 'any(.hooks.SessionStart[]?.hooks[]?.command?;
contains("feature-recommendation/check-pending.sh"))' \
"$_build_tmp/settings.json" >/dev/null
Expand All @@ -221,7 +221,7 @@ EOF
done
KIT_MDM_MANAGED=true
_build_tmp="$(mktemp -d)"
build_settings_file "$_build_tmp/settings.json" >/dev/null 2>&1
build_settings_file "$_build_tmp/settings.json" >/dev/null 2>&1 || exit 1
! jq -e 'any(.hooks.SessionStart[]?.hooks[]?.command?;
contains("feature-recommendation/check-pending.sh"))' \
"$_build_tmp/settings.json" >/dev/null
Expand Down
10 changes: 5 additions & 5 deletions tests/unit/test-ghostty.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ _ghostty_test_make_app() {
mkdir -p "$_app/Contents/MacOS"
printf 'outside' > "$_tmpdir/ghostty"
chmod +x "$_tmpdir/ghostty"
ln -s "$_tmpdir/ghostty" "$_app/Contents/MacOS/ghostty"
ln -s "$_tmpdir/ghostty" "$_app/Contents/MacOS/ghostty" || exit 1
_codesign_called=0
_ghostty_codesign() { _codesign_called=1; return 0; }
! ghostty_mdm_is_trusted "$_app" \
Expand All @@ -97,7 +97,7 @@ _ghostty_test_make_app() {
if (
_tmpdir="$(mktemp -d)"
_app="$_tmpdir/Ghostty.app"
_ghostty_test_make_app "$_app"
_ghostty_test_make_app "$_app" || exit 1
_ghostty_codesign() { return 1; }
! ghostty_mdm_is_trusted "$_app"
); then
Expand Down Expand Up @@ -262,7 +262,7 @@ _ghostty_test_make_app() {
mkdir -p "$_config_dir"
printf 'old\n' > "$_config"
printf 'new\n' > "$_template"
deploy_ghostty_config "$_template" >/dev/null 2>&1
deploy_ghostty_config "$_template" >/dev/null 2>&1 || exit 1
_backups=("$_config".backup.*)
[[ "$(cat "$_config")" == new && ! -e "${_backups[0]}" ]]
); then
Expand All @@ -288,7 +288,7 @@ _ghostty_test_make_app() {
printf 'old\n' > "$_config"
printf 'new\n' > "$_template"
date() { printf '%s' 20000101000000; }
deploy_ghostty_config "$_template" >/dev/null 2>&1
deploy_ghostty_config "$_template" >/dev/null 2>&1 || exit 1
[[ "$(cat "$_config")" == new \
&& "$(cat "$_config.backup.20000101000000")" == old ]]
); then
Expand All @@ -313,7 +313,7 @@ _ghostty_test_make_app() {
printf 'old\n' > "$_config"
printf 'new\n' > "$_template"
date() { printf '%s' 20000101000000; }
deploy_ghostty_config "$_template" >/dev/null 2>&1
deploy_ghostty_config "$_template" >/dev/null 2>&1 || exit 1
[[ "$(cat "$_config")" == new \
&& "$(cat "$_config.backup.20000101000000")" == old ]]
); then
Expand Down
10 changes: 5 additions & 5 deletions tests/unit/test-mdm-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2096,7 +2096,7 @@ fi
/bin/sleep 0.01
_attempt=$((_attempt + 1))
done
[[ -e "$_ready" && "$_actual_pgid" == "$_leader" ]]
[[ -e "$_ready" && "$_actual_pgid" == "$_leader" ]] || exit 1
/bin/kill -STOP -- "-$_leader"
_attempt=0
while ! _mdm_launcher_group_quiesced "$_leader" \
Expand All @@ -2108,14 +2108,14 @@ fi
_member_count="$(printf '%s\n' "$_listing" \
| /usr/bin/awk -v pgid="$_leader" '$1 == pgid { count++ }
END { print count + 0 }')"
[[ "$_member_count" -ge 2 ]]
_mdm_launcher_group_quiesced "$_leader"
[[ "$_member_count" -ge 2 ]] || exit 1
_mdm_launcher_group_quiesced "$_leader" || exit 1
exec 2>/dev/null
/bin/kill -KILL -- "-$_leader" 2>/dev/null || true
_mdm_launcher_wait_child_bounded "$_leader" 100 || true
_state=0
_mdm_launcher_group_state "$_leader" || _state=$?
[[ "$_state" -eq 1 ]]
[[ "$_state" -eq 1 ]] || exit 1
_leader=""
trap - EXIT
) > "$_diagnostic" 2>&1 || _rc=$?
Expand Down Expand Up @@ -2145,7 +2145,7 @@ fi
LC_ALL=C /bin/ps -p "$_quick_pid" -o pgid= 2>/dev/null || true
)"
_actual_pgid="${_actual_pgid//[[:space:]]/}"
[[ -z "$_actual_pgid" || "$_actual_pgid" == "$_quick_pgid" ]]
[[ -z "$_actual_pgid" || "$_actual_pgid" == "$_quick_pgid" ]] || exit 1
wait "$_quick_pid"
_quick_pid="" _quick_pgid="" _quick_starting=0
_attempt=$((_attempt + 1))
Expand Down