gardesk/garwarp / 6befc1b

Browse files

add dbus dispatch smoke script

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
6befc1ba6618606969e24567ad36efc9df8346b7
Parents
5c14533
Tree
a401066

2 changed files

StatusFile+-
M README.md 8 5
A scripts/test-dbus-method-dispatch.sh 36 0
README.mdmodified
@@ -16,6 +16,7 @@ Planning documents live in `docs/` and are currently local-only.
1616
 4. Request-handle parsing and deterministic request-id derivation are implemented (`/org/freedesktop/portal/desktop/request/<sender>/<token>` model).
1717
 5. DBus method handling derives caller identity from message headers and rejects mismatched request-handle ownership.
1818
 6. Typed option parsing foundations are in place for screenshot/filechooser/appchooser known keys.
19
+7. DBus method dispatch now registers request lifecycle state through an internal portal dispatcher (current placeholder path ends in `failed`).
1920
 
2021
 ## Local Commands
2122
 1. Start daemon: `cargo run -p garwarp -- daemon`
@@ -23,11 +24,13 @@ Planning documents live in `docs/` and are currently local-only.
2324
 3. Stop daemon: `cargo run -p garwarpctl -- stop`
2425
 4. Verify D-Bus activation: `./scripts/test-dbus-activation.sh`
2526
 5. Verify DBus interfaces are exported: `./scripts/test-dbus-interfaces.sh`
26
-6. Verify request-store fallback: `./scripts/test-request-store-fallback.sh`
27
-7. Create mock request: `cargo run -p garwarpctl -- begin req-1 :1.2 - x11:0x2a`
28
-8. Transition mock request: `cargo run -p garwarpctl -- transition req-1 :1.2 awaiting_user`
29
-9. List known requests: `cargo run -p garwarpctl -- list`
30
-10. Inspect request snapshot: `cargo run -p garwarpctl -- inspect req-1`
27
+6. Verify DBus method dispatch: `./scripts/test-dbus-method-dispatch.sh`
28
+7. Verify request-store fallback: `./scripts/test-request-store-fallback.sh`
29
+8. Run direct portal smoke calls: `cargo run -p garwarpctl -- portal-smoke`
30
+9. Create mock request: `cargo run -p garwarpctl -- begin req-1 :1.2 - x11:0x2a`
31
+10. Transition mock request: `cargo run -p garwarpctl -- transition req-1 :1.2 awaiting_user`
32
+11. List known requests: `cargo run -p garwarpctl -- list`
33
+12. Inspect request snapshot: `cargo run -p garwarpctl -- inspect req-1`
3134
 
3235
 ## Runtime Tuning
3336
 1. `GARWARP_REQUEST_TIMEOUT_MS`: timeout before in-flight requests are marked `expired`.
scripts/test-dbus-method-dispatch.shadded
@@ -0,0 +1,36 @@
1
+#!/usr/bin/env bash
2
+set -euo pipefail
3
+
4
+repo_root="$(cd "$(dirname "$0")/.." && pwd)"
5
+runtime_dir="$(mktemp -d)"
6
+log_file="$(mktemp)"
7
+
8
+cleanup() {
9
+  rm -f "$log_file"
10
+  rm -rf "$runtime_dir"
11
+}
12
+trap cleanup EXIT
13
+
14
+DBUS_FATAL_WARNINGS=0 dbus-run-session -- bash -lc '
15
+set -euo pipefail
16
+export XDG_RUNTIME_DIR="'"$runtime_dir"'"
17
+cd "'"$repo_root"'"
18
+
19
+cargo run -q -p garwarp -- daemon >"'"$log_file"'" 2>&1 &
20
+pid=$!
21
+
22
+for _ in $(seq 1 200); do
23
+  if dbus-send --session --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus \
24
+      org.freedesktop.DBus.NameHasOwner string:org.freedesktop.impl.portal.desktop.garwarp \
25
+      | rg -q "boolean true"; then
26
+    break
27
+  fi
28
+  sleep 0.05
29
+done
30
+
31
+cargo run -q -p garwarpctl -- portal-smoke >/dev/null
32
+cargo run -q -p garwarpctl -- stop >/dev/null
33
+wait "$pid"
34
+'
35
+
36
+printf "dbus method dispatch smoke test passed\n"