Bring up the Arcade check's own loopback, and give the node download test a make target
The release check's container has no ip tool, so the isolated download check could not reach its local game server.
This commit is contained in:
1 parent
8a6d3e0040
commit
ae13dd4a2e
3 files changed
+18
-2
No files matched your search
@@ -228,6 +228,14 @@ chess-ui-test: $(TARGET)
|
||||
@test -n "$(CHESS_BUNDLE)" || { echo "Set CHESS_BUNDLE to the Chess package built by Arcade"; exit 2; }
|
||||
@sh tests/chess_ui_test.sh $(abspath $(TARGET)) $(abspath $(CHESS_BUNDLE))
|
||||
|
||||
# One game a collection downloads separately: refused when corrupt, then
|
||||
# reopened from the offline cache. Needs Shovey's checkout beside this one.
|
||||
.PHONY: node-child-download-ui-test
|
||||
NODE_CHILD_CATALOG ?=
|
||||
node-child-download-ui-test: $(TARGET)
|
||||
@test -n "$(NODE_CHILD_CATALOG)" || { echo "Set NODE_CHILD_CATALOG to an arcade.zx with its arcade.games beside it"; exit 2; }
|
||||
@python3 tests/node_child_download_ui_test.py $(abspath $(TARGET)) $(abspath $(NODE_CHILD_CATALOG))
|
||||
|
||||
# Arcade carries Chess: its collection in More apps, and Chess's replacement.
|
||||
.PHONY: arcade-ui-test
|
||||
ARCADE_BUNDLE ?=
|
||||
|
||||
@@ -36,6 +36,14 @@ parser.add_argument("--offline", action="store_true", help="the node cannot be r
|
||||
parser.add_argument("--downloads-only", action="store_true",
|
||||
help="Check the rounded library, add-on downloads and offline games")
|
||||
args = parser.parse_args()
|
||||
if args.offline:
|
||||
# A new network namespace starts with loopback down; the download check
|
||||
# serves its games on it.
|
||||
import fcntl, socket, struct
|
||||
try:
|
||||
fcntl.ioctl(socket.socket(), 0x8914, struct.pack("16sH14s", b"lo", 0x49, b""))
|
||||
except OSError:
|
||||
pass
|
||||
BINARY = args.binary.resolve(strict=True)
|
||||
PACKAGE = args.package.resolve(strict=True)
|
||||
assert PACKAGE.name == "arcade.zx", "INBE_NODE_APP_FILE names the app by its file: arcade.zx"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# Arcade on a private Xvfb display with disposable profiles: no inherited
|
||||
# desktop, session bus or desktop recovery reaches the app. Where user
|
||||
# namespaces allow it, the test also runs without a network, so the node is
|
||||
# never contacted; its own loopback still serves local game downloads.
|
||||
# never contacted; the test brings up its loopback for local game downloads.
|
||||
# Further options pass to arcade_ui_test.py.
|
||||
set -eu
|
||||
root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
|
||||
@@ -12,7 +12,7 @@ shift 2
|
||||
isolate=
|
||||
offline=
|
||||
if unshare -rn true 2>/dev/null; then
|
||||
isolate="unshare -rn sh -c 'ip link set lo up 2>/dev/null; exec \"\$@\"' sh"
|
||||
isolate="unshare -rn"
|
||||
offline=--offline
|
||||
fi
|
||||
eval "env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS -u GDK_DISPLAY \
|
||||
|
||||
Reference in new issue
Block a user