From aa4b9eb35f45eacc55f79a969ff91eb9cfd989ed Mon Sep 17 00:00:00 2001 From: Vaerh Date: Thu, 12 Dec 2024 23:28:17 +0300 Subject: [PATCH] ci: Change the startup of the container --- .github/workflows/module_testing.yml | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/module_testing.yml b/.github/workflows/module_testing.yml index 8e74c468..a42964df 100644 --- a/.github/workflows/module_testing.yml +++ b/.github/workflows/module_testing.yml @@ -25,6 +25,21 @@ jobs: - "7.16" steps: + - name: Container check + run: | + echo "Wait for the container to finish launching..." + while true; do + docker logs ${{ job.services.routeros.id }} 2>&1 | grep MikroTik && break + # docker logs ${{ job.services.routeros.id }} 2>&1 + echo "waiting..." + sleep 10 + done + IP=$(docker inspect ${{ job.services.routeros.id }} --format '{{.NetworkSettings.IPAddress}}') + echo "IP address: ${IP}" + echo "ROS_IP_ADDRESS=${IP}" >> "$GITHUB_ENV" + docker inspect ${{ job.services.routeros.id }} + exit 5 + - name: Check out code into the Go module directory uses: actions/checkout@v4 @@ -47,12 +62,11 @@ jobs: env: ROS_USERNAME: admin ROS_PASSWORD: '' - ROS_IP_ADDRESS: 127.0.0.1 - name: Run client tests run: go test -timeout 30m -v ./routeros env: - ROS_HOSTURL: https://127.0.0.1 + ROS_HOSTURL: https://${ROS_IP_ADDRESS} ROS_USERNAME: admin ROS_PASSWORD: '' ROS_INSECURE: true @@ -66,8 +80,8 @@ jobs: - 443:443 - 8728:8728 - 8729:8729 - volumes: - - /dev/net/tun:/dev/net/tun options: >- --cap-add=NET_ADMIN --entrypoint /routeros/entrypoint_with_four_interfaces.sh + --device /dev/net/tun + --device /dev/kvm