Skip to content

Commit f8babf4

Browse files
committed
build(source-os): exercise installed sourceos-office open path in shell smoke
1 parent cdc9d36 commit f8babf4

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

build/office-suite/scripts/install_sourceos_office_shell_smoke.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@ mkdir -p "$HOME"
1414

1515
DESKTOP_FILE="$XDG_DATA_HOME/applications/sourceos-office.desktop"
1616
OPEN_BIN="$HOME/.local/bin/sourceos-office-open"
17+
SOURCEOS_OFFICE_BIN="$HOME/.local/bin/sourceos-office"
1718
CLOUD_BIN="$HOME/.local/bin/office_cloud_handoff.sh"
1819
MIME_FILE="$XDG_CONFIG_HOME/mimeapps.list"
20+
TEST_DOC="$TMPDIR/demo.txt"
21+
echo "SourceOS office shell smoke" > "$TEST_DOC"
1922

2023
[[ -f "$DESKTOP_FILE" ]] || {
2124
echo "office shell installer smoke failed: missing desktop entry" >&2
@@ -27,6 +30,11 @@ MIME_FILE="$XDG_CONFIG_HOME/mimeapps.list"
2730
exit 1
2831
}
2932

33+
[[ -x "$SOURCEOS_OFFICE_BIN" ]] || {
34+
echo "office shell installer smoke failed: missing sourceos-office command" >&2
35+
exit 1
36+
}
37+
3038
[[ -x "$CLOUD_BIN" ]] || {
3139
echo "office shell installer smoke failed: missing cloud handoff helper" >&2
3240
exit 1
@@ -37,4 +45,13 @@ MIME_FILE="$XDG_CONFIG_HOME/mimeapps.list"
3745
exit 1
3846
}
3947

48+
OUT="$(SOURCEOS_OFFICE_MODE=cloud "$SOURCEOS_OFFICE_BIN" open "$TEST_DOC")"
49+
case "$OUT" in
50+
http://*|https://*) ;;
51+
*)
52+
echo "office shell installer smoke failed: installed sourceos-office open path did not return URL" >&2
53+
exit 1
54+
;;
55+
esac
56+
4057
echo "office shell installer smoke passed"

0 commit comments

Comments
 (0)