Skip to content

Commit

Permalink
Merge pull request wolfi-dev#17604 from smoser/test/add-test-guacamol…
Browse files Browse the repository at this point in the history
…e-server

Add test to guacamole-server.
  • Loading branch information
dlorenc committed Apr 25, 2024
2 parents 83f150d + 16960b1 commit e535134
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions guacamole-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,68 @@ subpackages:
pipeline:
- uses: split/dev

test:
environment:
contents:
packages:
- busybox
pipeline:
- name: "check -v output"
runs: |
guacd -v >out 2>&1 || {
rc=$?
echo "failed [$rc]: guacd -v"
cat out
exit $rc
}
expected="version ${{package.version}}"
grep "$expected" out || {
echo "command 'guacd -v' did not contain expected output"
echo "expected: $expected"
echo "actual:"
cat out
exit 1
}
- name: "start daemon on localhost"
runs: |
set -- guacd -b 127.0.0.1 -L info -p my.pid -f
"$@" >out 2>&1 &
kpid=$!
n=0
while [ $n -lt 60 ] && sleep 1; do
n=$((n+1))
[ -e my.pid ] && break
done
[ -e my.pid ] || { echo "my.pid did not exist after $n seconds"; exit 1; }
read pid < my.pid
[ "$kpid" = "$pid" ] || {
echo "pid from shell ($kpid) != pid from pidfile ($pid)";
exit 1;
}
n=0
expected="istening on host"
while [ $n -lt 10 ] && sleep 1; do
n=$((n+1))
grep -q "$expected" out && break
done
grep -q "$expected" out || {
echo "output did not contain expected output after $n seconds: $expected "
cat "$out"
exit 1
}
expected="Guacamole proxy daemon.*version ${{package.version}}"
grep "$expected" out || {
echo "command '$*' did not contain expected output"
echo "expected: $expected"
echo "actual:"
cat out
exit 1
}
kill $pid
update:
enabled: true
release-monitor:
Expand Down

0 comments on commit e535134

Please sign in to comment.