Merge pull request #13 from ayushishu/main #24
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
--- | |
name: CSIT-1-Node-Test | |
on: | |
push: | |
branches: | |
- '*' | |
jobs: | |
csit: | |
runs-on: ubuntu-latest | |
# Run the job on an Ubuntu latest runner | |
strategy: | |
matrix: | |
test_suite: ["daexim", "distribution", "aaa"] | |
# Define a matrix for different test suites | |
services: | |
opendaylight: | |
image: ${{ vars.DOCKER_REPOSITORY }}/${{ vars.ODL_IMAGE_NAME_CENTOS }} | |
env: | |
FEATURES: odl-restconf,odl-daexim-all,odl-netconf-topology,odl-jolokia | |
ports: | |
- 8181:8181 | |
options: --name odl-container | |
# Set up a service container for OpenDaylight | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
# Checkout the code repository | |
- name: Setup Jolokia for AAA | |
if: matrix.test_suite == 'aaa' | |
run: | | |
# Configure Jolokia for the 'aaa' test suite | |
docker exec -i odl-container bash -c \ | |
'echo "org.jolokia.authMode=basic" >> /home/user/karaf-0.18.1/etc/org.jolokia.osgi.cfg && \ | |
echo "org.jolokia.user=admin" >> /home/user/karaf-0.18.1/etc/org.jolokia.osgi.cfg && \ | |
echo "org.jolokia.password=admin" >> /home/user/karaf-0.18.1/etc/org.jolokia.osgi.cfg' | |
- name: Robot Setup | |
uses: ./.github/action/ssh-setup-action | |
with: | |
docker_repository: ${{ vars.DOCKER_REPOSITORY }} | |
robot_image: ${{ vars.ROBOT_BASE_IMAGE_NAME }} | |
- name: Delay for 10 seconds | |
run: sleep 10 | |
- name: Run Test | |
run: | | |
# Define test_suite variable based on the matrix | |
test_suite=${{ matrix.test_suite }} | |
if [ "${{ matrix.test_suite }}" == "daexim" ]; then | |
robot_test_file="./010-special-export.robot 020-import-basic.robot 030-export-basic.robot 040-export-inclusions.robot" | |
elif [ "${{ matrix.test_suite }}" == "distribution" ]; then | |
robot_test_file="karaf_sequence_install.robot karaf_stop.robot size.robot" | |
elif [ "${{ matrix.test_suite }}" == "aaa" ]; then | |
robot_test_file="authn" | |
fi | |
# Run robot tests in the appropriate directory | |
docker exec robot bash -c "git clone https://github.com/opendaylight/integration-test.git && | |
cd integration-test/csit/suites/${test_suite} && | |
robot -L debug --variable USER_HOME:/root \ | |
--variable WORKSPACE:/home/user \ | |
-v BUNDLEFOLDER:karaf-0.18.1 \ | |
-v ODL_STREAM:argon \ | |
--variable DEFAULT_LINUX_PROMPT:\\\$ \ | |
--variable ODL_SYSTEM_USER:user \ | |
--variable ODL_SYSTEM_IP:opendaylight \ | |
--variable ODL_SYSTEM_1_IP:opendaylight \ | |
-v IS_KARAF_APPL:True \ | |
$robot_test_file" | |
# Run the Robot Framework tests |