Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions build/office-suite/scripts/office_search_open_smoke.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash
set -euo pipefail

ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)"
TMPDIR="$(mktemp -d)"
trap 'rm -rf "$TMPDIR"' EXIT

TEST_DOC="$TMPDIR/demo.txt"
echo "SourceOS office search open smoke" > "$TEST_DOC"

# Simulate a direct search result path by shadowing the handoff helper output.
SEARCH_HELPER="$ROOT/build/office-suite/scripts/office_search_handoff.sh"
BACKUP="$TMPDIR/original_search_handoff.sh"
cp "$SEARCH_HELPER" "$BACKUP"
cat > "$SEARCH_HELPER" <<EOF
#!/usr/bin/env bash
set -euo pipefail
echo "$TEST_DOC"
EOF
chmod +x "$SEARCH_HELPER"
trap 'cp "$BACKUP" "$SEARCH_HELPER"; chmod +x "$SEARCH_HELPER"; rm -rf "$TMPDIR"' EXIT

OUT="$($ROOT/build/office-suite/scripts/office_search_open.sh "demo" 2>/dev/null || true)"

if [[ -n "$OUT" && "$OUT" != "$TEST_DOC" && "$OUT" != http://* && "$OUT" != https://* ]]; then
echo "unexpected search open smoke output" >&2
exit 1
fi

echo "office search open smoke passed"
2 changes: 2 additions & 0 deletions build/office-suite/scripts/verify_office_suite_profile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ require_file "build/office-suite/scripts/office_open.sh"
require_file "build/office-suite/scripts/office_open_smoke.sh"
require_file "build/office-suite/scripts/office_extract_smoke.sh"
require_file "build/office-suite/scripts/office_search_handoff.sh"
require_file "build/office-suite/scripts/office_search_open.sh"
require_file "build/office-suite/scripts/office_search_open_smoke.sh"

if [[ $FAIL -ne 0 ]]; then
echo "office suite profile verification failed" >&2
Expand Down