@@ -290,19 +290,19 @@ jobs:
290290 test-name-cache :
291291 strategy :
292292 matrix :
293- deployment_type : ["docker", "podman"]
294293 SC4S_IPV6_ENABLE : ["yes","no"]
295294 runs-on : ubuntu-latest
296- continue-on-error : true
297295 needs :
298296 - meta
299297 - build_action
300-
298+ # runs all of the steps inside the specified container rather than on the VM host.
299+ # Because of this the network configuration changes from host based network to a container network.
300+ container :
301+ image : python:3.9-buster
301302 services :
302303 splunk :
303304 image : splunk/splunk:${{ fromJson(needs.meta.outputs.matrix_supportedSplunk)[0].version }}
304305 ports :
305- - 8000:8000
306306 - 8088:8088
307307 - 8089:8089
308308 env :
@@ -311,55 +311,24 @@ jobs:
311311 SPLUNK_START_ARGS : --accept-license
312312 SPLUNK_APPS_URL : https://github.com/splunk/splunk-configurations-base-indexes/releases/download/v1.0.0/splunk_configurations_base_indexes-1.0.0.tar.gz
313313
314+ sc4s :
315+ image : ${{ needs.meta.outputs.container_base }}
316+ ports :
317+ - 514:514
318+ env :
319+ SC4S_DEST_SPLUNK_HEC_DEFAULT_URL : https://splunk:8088
320+ SC4S_DEST_SPLUNK_HEC_DEFAULT_TOKEN : 70b6ae71-76b3-4c38-9597-0c5b37ad9630
321+ SC4S_DEST_SPLUNK_HEC_DEFAULT_TLS_VERIFY : " no"
322+ SC4S_USE_NAME_CACHE : " yes"
323+ SC4S_CLEAR_NAME_CACHE : " yes"
324+ SC4S_IPV6_ENABLE : " ${{ matrix.SC4S_IPV6_ENABLE }}"
325+
314326 steps :
315327 - name : Checkout
316328 uses : actions/checkout@v4
317329 with :
318330 submodules : false
319331 persist-credentials : false
320- - name : Install Ansible and other dependencies as python package
321- run : |
322- pip install ansible~=6.1.0 --no-cache-dir \
323- && pip install pywinrm>=0.4.2 --no-cache-dir \
324- && pip install ansible-lint>=6.0.0 --no-cache-dir \
325- && pip install docker
326- - name : Configure Ansible Environment Variables
327- env :
328- ANSIBLE_CONFIG : ansible.cfg
329- ANSIBLE_HOST_KEY_CHECKING : False
330- run : |
331- echo "ANSIBLE_CONFIG is set to: $ANSIBLE_CONFIG"
332- echo "ANSIBLE_HOST_KEY_CHECKING is set to: $ANSIBLE_HOST_KEY_CHECKING"
333- sudo systemctl set-environment SC4S_IMAGE=${{ needs.meta.outputs.container_base }}
334- - name : Update inventory file
335- run : |
336- cat << EOF > ansible/inventory/inventory.yaml
337- ---
338- all:
339- hosts:
340- children:
341- node:
342- hosts:
343- node_1:
344- ansible_host: 127.0.0.1
345- ansible_connection: local
346- ansible_user: root
347- - name : Update env_file
348- run : |
349- echo "Updating ansible/inventory/inventory.yaml"
350- cat << EOF > ansible/resources/env_file
351- SC4S_DEST_SPLUNK_HEC_DEFAULT_URL=https://127.0.0.1:8088
352- SC4S_DEST_SPLUNK_HEC_DEFAULT_TOKEN=70b6ae71-76b3-4c38-9597-0c5b37ad9630
353- SC4S_DEST_SPLUNK_HEC_DEFAULT_TLS_VERIFY=no
354- SC4S_USE_NAME_CACHE=yes
355- SC4S_CLEAR_NAME_CACHE=yes
356- SC4S_IPV6_ENABLE=${{ matrix.SC4S_IPV6_ENABLE }}
357- - name : Update current SC4S image in unit file
358- run : |
359- sed -i 's|Environment="SC4S_IMAGE=ghcr.io/splunk/splunk-connect-for-syslog/container3:latest"|Environment="SC4S_IMAGE=${{ needs.meta.outputs.container_base }}"|' ansible/resources/${{ matrix.deployment_type }}_sc4s.service
360- - name : Run Ansible Playbook
361- run : |
362- ansible-playbook --connection=local -i ansible/inventory/inventory.yaml ansible/playbooks/${{ matrix.deployment_type }}.yml
363332 - name : Run tests
364333 run : |
365334 pip3 install poetry
@@ -368,15 +337,15 @@ jobs:
368337 poetry run pytest -v --tb=long \
369338 --splunk_type=external \
370339 --splunk_hec_token=70b6ae71-76b3-4c38-9597-0c5b37ad9630 \
371- --splunk_host=127.0.0.1 \
372- --sc4s_host=127.0.0.1 \
340+ --splunk_host=splunk \
341+ --sc4s_host=sc4s \
373342 --junitxml=test-results/test.xml \
374343 -n 1 \
375344 -m 'name_cache'
376345 - name : artifact-test-results
377346 uses : actions/upload-artifact@v4
378347 with :
379- name : test-name-cache-results_${{ matrix.deployment_type }}_IPv6_ ${{ matrix.SC4S_IPV6_ENABLE }}.xml
348+ name : test-name-cache-results_IPv6_ ${{ matrix.SC4S_IPV6_ENABLE }}.xml
380349 path : test-results/test.xml
381350 if : ${{ !cancelled() }}
382351 release :
0 commit comments