-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* e2e test usb mounting * no poweroff * no start * drive usb via sync server since its up sudo santactl status sudo? * revert nostart/nopoweroff * bump VMCLI minimum os version
- Loading branch information
Showing
10 changed files
with
134 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
-- Dismiss the "disk remounted" popup from Santa. | ||
-- This is run inside test VMs. | ||
|
||
on run argv | ||
tell application "System Events" | ||
tell process "Santa" | ||
click button 1 of group 1 of window 1 | ||
end tell | ||
end tell | ||
end run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/bin/bash | ||
set -xe | ||
|
||
bazel run //Testing/integration:install_profile -- Testing/integration/configs/default.mobileconfig | ||
sudo diskutil unmount force USB || true | ||
|
||
killall moroz | ||
/tmp/moroz -configs="$GITHUB_WORKSPACE/Testing/integration/configs/moroz_default/global.toml" -use-tls=false & | ||
sudo santactl sync --debug | ||
if [[ "$(sudo santactl status --json | jq .daemon.block_usb)" != "false" ]]; then | ||
echo "USB blocking enabled with minimal config" >&2 | ||
exit 1 | ||
fi | ||
|
||
sudo diskutil mount USB | ||
echo test > /Volumes/USB/test | ||
sync | ||
sudo diskutil unmount force USB | ||
|
||
killall moroz | ||
/tmp/moroz -configs="$GITHUB_WORKSPACE/Testing/integration/configs/moroz_changed/global.toml" -use-tls=false & | ||
sudo santactl sync --debug | ||
if [[ "$(sudo santactl status --json | jq .daemon.block_usb)" != "true" ]]; then | ||
echo "USB blocking config change didnt take effect" >&2 | ||
exit 1 | ||
fi | ||
|
||
set +e | ||
sudo diskutil mount USB | ||
blocked=$? | ||
set -e | ||
|
||
if [[ $blocked == 0 ]]; then | ||
echo "R/W mount succeeded with USB blocking enabled" >&2 | ||
exit 1 | ||
fi | ||
|
||
sleep 5 | ||
|
||
# Santa should have remounted the disk RO for us. Check that it did. | ||
bazel run //Testing/integration:dismiss_usb_popup | ||
cat /Volumes/USB/test | ||
|
||
sudo diskutil unmount force USB | ||
|
||
# Ensure things can still be normally mounted if mount flags match remount opts. | ||
set +e | ||
sudo diskutil mount -mountOptions ro,noexec USB | ||
blocked=$? | ||
set -e | ||
|
||
if [[ $blocked != 0 ]]; then | ||
echo "RO+noexec mount failed with USB blocking enabled" >&2 | ||
exit 1 | ||
fi |