Skip to content

Commit

Permalink
Add API testing
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Sabaini <peter.sabaini@canonical.com>
  • Loading branch information
sabaini committed Nov 22, 2024
1 parent 9643029 commit 15e243d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,11 @@ jobs:
cat /var/snap/microceph/current/conf/ceph.conf
fgrep -q "[${MON_IP}]" /var/snap/microceph/current/conf/ceph.conf
- name: API Testing
run: |
~/actionutils.sh install_hurl
~/actionutils.sh hurl test/hurl/services-mon.hurl
multi-node-tests:
name: Multi node testing
runs-on: ubuntu-22.04
Expand Down
4 changes: 4 additions & 0 deletions tests/hurl/services-mon.hurl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
GET http://localhost/1.0/services/mon
HTTP 200
[Asserts]
jsonpath "$.metadata.addresses" count == 1
11 changes: 11 additions & 0 deletions tests/scripts/actionutils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,17 @@ function install_store() {
done
}

function install_hurl() {
VERSION=5.0.1
downloadurl="https://github.com/Orange-OpenSource/hurl/releases/download/$VERSION/hurl_${VERSION}_amd64.deb"
curl --location --remote-name $downloadurl
sudo apt update && sudo apt install ./hurl_${VERSION}_amd64.deb
}

function hurl() {
hurl --unix-socket --test /var/snap/microceph/common/state/control.socket "$@"
}

function upgrade_multinode() {
# Refresh to local version, checking health
for container in node-wrk0 node-wrk1 node-wrk2 node-wrk3 ; do
Expand Down

0 comments on commit 15e243d

Please sign in to comment.