-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Workaround, see spdk/spdk#2731 - Readme CLI example test - Address issue: #135 - CLI process exit with error code in case of exception: #137 - Workflows for existing pytest tests using matrix model Signed-off-by: Alexander Indenbaum <aindenba@redhat.com>
- Loading branch information
Alexander Indenbaum
committed
May 30, 2023
1 parent
c599265
commit a679941
Showing
9 changed files
with
290 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Build container Test | ||
on: [push, pull_request, workflow_dispatch] | ||
env: | ||
# Control gRPC port | ||
PORT: 5500 | ||
|
||
jobs: | ||
build-container-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
# git submodule update --init --recursive | ||
submodules: recursive | ||
|
||
- name: Build container images | ||
run: make build | ||
|
||
- name: Setup huge pages | ||
run: make setup | ||
|
||
- name: Compose Up | ||
run: | | ||
make up || (make logs; exit 1) | ||
- name: Wait for controller to start | ||
run: | | ||
until nc -z localhost $PORT; do | ||
echo -n . | ||
sleep 1 | ||
done | ||
echo | ||
- name: List containers | ||
run: | | ||
docker-compose ps | ||
- name: Create RBD image | ||
run: | | ||
echo "💁 ceph list pools:" | ||
docker exec ceph-cluster ceph osd lspools | ||
echo "💁 rbd create:" | ||
docker exec ceph-cluster rbd create rbd/mytestdevimage --size 16 | ||
echo "💁 ls rbd:" | ||
docker exec ceph-cluster rbd ls rbd | ||
- name: Run CLI | ||
run: | | ||
docker-compose run ceph-nvmeof-cli | ||
docker-compose run ceph-nvmeof-cli create_bdev -i mytestdevimage -p rbd -b Ceph0 | ||
docker-compose run ceph-nvmeof-cli create_subsystem -n nqn.2016-06.io.spdk:cnode1 -s SPDK00000000000001 | ||
docker-compose run ceph-nvmeof-cli add_namespace -n nqn.2016-06.io.spdk:cnode1 -b Ceph0 | ||
docker-compose run ceph-nvmeof-cli add_host -n nqn.2016-06.io.spdk:cnode1 -t '*' | ||
docker-compose run ceph-nvmeof-cli create_listener -n nqn.2016-06.io.spdk:cnode1 -s 5001 | ||
# should fail https://github.com/ceph/ceph-nvmeof/issues/137 | ||
if docker-compose run ceph-nvmeof-cli create_bdev -i mytestdevimage -p rbd -b Ceph0; then exit 1; fi | ||
if docker-compose run ceph-nvmeof-cli create_bdev -i wrongimage -p rbd -b Ceph0; then exit 1; fi | ||
- name: Display Logs | ||
run: | | ||
docker-compose logs | ||
- name: Compose Down | ||
run: make down | ||
|
||
- name: Compose Stop | ||
run: make stop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Run pytest | ||
on: [push, pull_request, workflow_dispatch] | ||
|
||
jobs: | ||
pytest: | ||
strategy: | ||
matrix: | ||
test: ["cli", "state", "multi-gateway"] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
# git submodule update --init --recursive | ||
submodules: recursive | ||
|
||
- name: Build images | ||
run: | | ||
make build | ||
- name: Setup huge pages | ||
run: | | ||
make setup | ||
- name: Start ceph-cluster | ||
run: | | ||
docker-compose up --detach ceph-cluster | ||
- name: Wait for the ceph-cluster container to become healthy | ||
run: | | ||
while true; do | ||
container_status=$(docker inspect --format='{{.State.Health.Status}}' ceph-cluster) | ||
if [[ $container_status == "healthy" ]]; then | ||
break | ||
else | ||
# Wait for a specific time before checking again | ||
sleep 1 | ||
fi | ||
done | ||
- name: Create RBD image | ||
run: | | ||
echo "💁 ceph list pools:" | ||
docker exec ceph-cluster ceph osd lspools | ||
echo "💁 rbd create:" | ||
docker exec ceph-cluster rbd create rbd/mytestdevimage --size 16 | ||
echo "💁 ls rbd:" | ||
docker exec ceph-cluster rbd ls rbd | ||
- name: Run ${{ matrix.test }} test | ||
run: | | ||
docker-compose run ceph-nvmeof-pytest-${{ matrix.test }} || (docker-compose logs; exit 1) | ||
- name: Display Logs | ||
run: | | ||
docker-compose logs | ||
- name: Compose Down | ||
run: make down | ||
|
||
- name: Compose Stop | ||
run: make stop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.