Skip to content

Commit

Permalink
scripts for integration-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jstavel committed Dec 13, 2024
1 parent e321399 commit 0e9778b
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 2 deletions.
18 changes: 18 additions & 0 deletions integration-tests/scripts/post-activation-keys.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

USERNAME=duey
PASSWORD=password
ORG=donaldduck

curl -k --request POST --user ${USERNAME}:${PASSWORD} \
--data '{"name":"act-key-01"}' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
https://localhost:8443/candlepin/owners/${ORG}/activation_keys


curl -k --request POST --user ${USERNAME}:${PASSWORD} \
--data '{"name":"act-key-02"}' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
https://localhost:8443/candlepin/owners/${ORG}/activation_keys
18 changes: 18 additions & 0 deletions integration-tests/scripts/post-environments.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

USERNAME=admin
PASSWORD=admin
ORG=donaldduck

curl -k --request POST --user ${USERNAME}:${PASSWORD} \
--data '{"id": "env-id-01", "name": "env-name-01", "description": "Testing environment num. 1"}' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
https://localhost:8443/candlepin/owners/${ORG}/environments

curl -k --request POST --user ${USERNAME}:${PASSWORD} \
--data '{"id": "env-id-02", "name": "env-name-02", "description": "Testing environment num. 2"}' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
https://localhost:8443/candlepin/owners/${ORG}/environments

2 changes: 2 additions & 0 deletions integration-tests/scripts/run-local-candlepin.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
podman run -d --name candlepin -p 8080:8080 -p 8443:8443 --hostname candlepin.local ghcr.io/ptoscano/candlepin-unofficial:latest
5 changes: 3 additions & 2 deletions systemtest/tests/integration/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ EOF


# run local candlepin for testing purpose
podman run -d --name candlepin -p 8080:8080 -p 8443:8443 --hostname candlepin.local ghcr.io/ptoscano/candlepin-unofficial:latest
./integration-tests/scripts/run-local-candlepin.sh

# create testing data in local candlepin
./extend-test-data.sh
./integration-tests/scripts/post-activation-keys.sh
./integration-tests/scripts/post-environments.sh

# Run all integration tests. They will use 'testing' environment in configuration
ENV_FOR_DYNACONF=testing pytest --junit-xml=./junit.xml -v integration-tests
Expand Down

0 comments on commit 0e9778b

Please sign in to comment.