Skip to content

Commit 8bbbfd4

Browse files
committed
fix(test): use portable file mode checks in snap installer tests
The snap installer tests added in #3656 checked the gateway config mode with GNU stat -c, which BSD stat on macOS rejects, so mise run ci failed locally on macOS. Check the mode with find -perm instead, which matches the exact mode on both GNU and BSD systems. Signed-off-by: Kris Hicks <khicks@nvidia.com>
1 parent 6c864ec commit 8bbbfd4

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎tasks/scripts/test-install-sh.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ if ! grep -Fq 'allow_unauthenticated_users = true' "$snap_config"; then
371371
echo "FAIL: Snap gateway config must permit the plaintext local CLI" >&2
372372
exit 1
373373
fi
374-
if [[ $(stat -c '%a' "$snap_config") != 600 ]]; then
374+
if [[ -z $(find "$snap_config" -perm 600) ]]; then
375375
echo "FAIL: Snap gateway config must be mode 0600" >&2
376376
exit 1
377377
fi

‎tasks/scripts/test-snap-install-hook.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ EOF
2424
common="${work}/fresh"
2525
SNAP_COMMON="$common" "$hook"
2626
cmp -s "$expected" "$common/gateway.toml"
27-
if [[ $(stat -c '%a' "$common/gateway.toml") != 600 ]]; then
27+
if [[ -z $(find "$common/gateway.toml" -perm 600) ]]; then
2828
echo "FAIL: install hook config must be mode 0600" >&2
2929
exit 1
3030
fi

0 commit comments

Comments
 (0)