Skip to content

Commit c4e9970

Browse files
pdudhaiya-crestKarol Wrona
authored andcommitted
revert
Update test_checkpoint.py Update ci-main.yaml update Update ci-lite.yaml Update docker_sc4s.service Update test_name_cache.py Update splunkutils.py Update conftest.py
1 parent 8cfef83 commit c4e9970

5 files changed

Lines changed: 60 additions & 153 deletions

File tree

.github/workflows/ci-enterprise.yaml

Lines changed: 19 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -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:

.github/workflows/ci-lite.yaml

Lines changed: 19 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -283,19 +283,19 @@ jobs:
283283
test-name-cache:
284284
strategy:
285285
matrix:
286-
deployment_type: ["docker", "podman"]
287286
SC4S_IPV6_ENABLE: ["yes","no"]
288287
runs-on: ubuntu-latest
289-
continue-on-error: true
290288
needs:
291289
- meta
292290
- build_action
293-
291+
# runs all of the steps inside the specified container rather than on the VM host.
292+
# Because of this the network configuration changes from host based network to a container network.
293+
container:
294+
image: python:3.9-buster
294295
services:
295296
splunk:
296297
image: splunk/splunk:${{ fromJson(needs.meta.outputs.matrix_supportedSplunk)[0].version }}
297298
ports:
298-
- 8000:8000
299299
- 8088:8088
300300
- 8089:8089
301301
env:
@@ -304,55 +304,24 @@ jobs:
304304
SPLUNK_START_ARGS: --accept-license
305305
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
306306

307+
sc4s:
308+
image: ${{ needs.meta.outputs.container_base }}
309+
ports:
310+
- 514:514
311+
env:
312+
SC4S_DEST_SPLUNK_HEC_DEFAULT_URL: https://splunk:8088
313+
SC4S_DEST_SPLUNK_HEC_DEFAULT_TOKEN: 70b6ae71-76b3-4c38-9597-0c5b37ad9630
314+
SC4S_DEST_SPLUNK_HEC_DEFAULT_TLS_VERIFY: "no"
315+
SC4S_USE_NAME_CACHE: "yes"
316+
SC4S_CLEAR_NAME_CACHE: "yes"
317+
SC4S_IPV6_ENABLE: "${{ matrix.SC4S_IPV6_ENABLE }}"
318+
307319
steps:
308320
- name: Checkout
309321
uses: actions/checkout@v4
310322
with:
311323
submodules: false
312324
persist-credentials: false
313-
- name: Install Ansible and other dependencies as python package
314-
run: |
315-
pip install ansible~=6.1.0 --no-cache-dir \
316-
&& pip install pywinrm>=0.4.2 --no-cache-dir \
317-
&& pip install ansible-lint>=6.0.0 --no-cache-dir \
318-
&& pip install docker
319-
- name: Configure Ansible Environment Variables
320-
env:
321-
ANSIBLE_CONFIG: ansible.cfg
322-
ANSIBLE_HOST_KEY_CHECKING: False
323-
run: |
324-
echo "ANSIBLE_CONFIG is set to: $ANSIBLE_CONFIG"
325-
echo "ANSIBLE_HOST_KEY_CHECKING is set to: $ANSIBLE_HOST_KEY_CHECKING"
326-
sudo systemctl set-environment SC4S_IMAGE=${{ needs.meta.outputs.container_base }}
327-
- name: Update inventory file
328-
run: |
329-
cat << EOF > ansible/inventory/inventory.yaml
330-
---
331-
all:
332-
hosts:
333-
children:
334-
node:
335-
hosts:
336-
node_1:
337-
ansible_host: 127.0.0.1
338-
ansible_connection: local
339-
ansible_user: root
340-
- name: Update env_file
341-
run: |
342-
echo "Updating ansible/inventory/inventory.yaml"
343-
cat << EOF > ansible/resources/env_file
344-
SC4S_DEST_SPLUNK_HEC_DEFAULT_URL=https://127.0.0.1:8088
345-
SC4S_DEST_SPLUNK_HEC_DEFAULT_TOKEN=70b6ae71-76b3-4c38-9597-0c5b37ad9630
346-
SC4S_DEST_SPLUNK_HEC_DEFAULT_TLS_VERIFY=no
347-
SC4S_USE_NAME_CACHE=yes
348-
SC4S_CLEAR_NAME_CACHE=yes
349-
SC4S_IPV6_ENABLE=${{ matrix.SC4S_IPV6_ENABLE }}
350-
- name: Update current SC4S image in unit file
351-
run: |
352-
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
353-
- name: Run Ansible Playbook
354-
run: |
355-
ansible-playbook --connection=local -i ansible/inventory/inventory.yaml ansible/playbooks/${{ matrix.deployment_type }}.yml
356325
- name: Run tests
357326
run: |
358327
pip3 install poetry
@@ -361,15 +330,15 @@ jobs:
361330
poetry run pytest -v --tb=long \
362331
--splunk_type=external \
363332
--splunk_hec_token=70b6ae71-76b3-4c38-9597-0c5b37ad9630 \
364-
--splunk_host=127.0.0.1 \
365-
--sc4s_host=127.0.0.1 \
333+
--splunk_host=splunk \
334+
--sc4s_host=sc4s \
366335
--junitxml=test-results/test.xml \
367336
-n 1 \
368337
-m 'name_cache'
369338
- name: artifact-test-results
370339
uses: actions/upload-artifact@v4
371340
with:
372-
name: test-name-cache-results_${{ matrix.deployment_type }}_IPv6_${{ matrix.SC4S_IPV6_ENABLE }}.xml
341+
name: test-name-cache-results_IPv6_${{ matrix.SC4S_IPV6_ENABLE }}.xml
373342
path: test-results/test.xml
374343
if: ${{ !cancelled() }}
375344

.github/workflows/ci-main.yaml

Lines changed: 20 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ jobs:
273273
--sc4s_host=127.0.0.1 \
274274
--junitxml=test-results/test.xml \
275275
-n 14 \
276-
-k 'not lite and not name_cache'
276+
-k 'checkpoint or not lite and not name_cache'
277277
- name: artifact-test-results
278278
uses: actions/upload-artifact@v4
279279
with:
@@ -284,19 +284,19 @@ jobs:
284284
test-name-cache:
285285
strategy:
286286
matrix:
287-
deployment_type: ["docker", "podman"]
288287
SC4S_IPV6_ENABLE: ["yes","no"]
289288
runs-on: ubuntu-latest
290-
continue-on-error: true
291289
needs:
292290
- meta
293291
- build_action
294-
292+
# runs all of the steps inside the specified container rather than on the VM host.
293+
# Because of this the network configuration changes from host based network to a container network.
294+
container:
295+
image: python:3.9-buster
295296
services:
296297
splunk:
297298
image: splunk/splunk:${{ fromJson(needs.meta.outputs.matrix_supportedSplunk)[0].version }}
298299
ports:
299-
- 8000:8000
300300
- 8088:8088
301301
- 8089:8089
302302
env:
@@ -305,55 +305,24 @@ jobs:
305305
SPLUNK_START_ARGS: --accept-license
306306
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
307307

308+
sc4s:
309+
image: ${{ needs.meta.outputs.container_base }}
310+
ports:
311+
- 514:514
312+
env:
313+
SC4S_DEST_SPLUNK_HEC_DEFAULT_URL: https://splunk:8088
314+
SC4S_DEST_SPLUNK_HEC_DEFAULT_TOKEN: 70b6ae71-76b3-4c38-9597-0c5b37ad9630
315+
SC4S_DEST_SPLUNK_HEC_DEFAULT_TLS_VERIFY: "no"
316+
SC4S_USE_NAME_CACHE: "yes"
317+
SC4S_CLEAR_NAME_CACHE: "yes"
318+
SC4S_IPV6_ENABLE: "${{ matrix.SC4S_IPV6_ENABLE }}"
319+
308320
steps:
309321
- name: Checkout
310322
uses: actions/checkout@v4
311323
with:
312324
submodules: false
313325
persist-credentials: false
314-
- name: Install Ansible and other dependencies as python package
315-
run: |
316-
pip install ansible~=6.1.0 --no-cache-dir \
317-
&& pip install pywinrm>=0.4.2 --no-cache-dir \
318-
&& pip install ansible-lint>=6.0.0 --no-cache-dir \
319-
&& pip install docker
320-
- name: Configure Ansible Environment Variables
321-
env:
322-
ANSIBLE_CONFIG: ansible.cfg
323-
ANSIBLE_HOST_KEY_CHECKING: False
324-
run: |
325-
echo "ANSIBLE_CONFIG is set to: $ANSIBLE_CONFIG"
326-
echo "ANSIBLE_HOST_KEY_CHECKING is set to: $ANSIBLE_HOST_KEY_CHECKING"
327-
sudo systemctl set-environment SC4S_IMAGE=${{ needs.meta.outputs.container_base }}
328-
- name: Update inventory file
329-
run: |
330-
cat << EOF > ansible/inventory/inventory.yaml
331-
---
332-
all:
333-
hosts:
334-
children:
335-
node:
336-
hosts:
337-
node_1:
338-
ansible_host: 127.0.0.1
339-
ansible_connection: local
340-
ansible_user: root
341-
- name: Update env_file
342-
run: |
343-
echo "Updating ansible/inventory/inventory.yaml"
344-
cat << EOF > ansible/resources/env_file
345-
SC4S_DEST_SPLUNK_HEC_DEFAULT_URL=https://127.0.0.1:8088
346-
SC4S_DEST_SPLUNK_HEC_DEFAULT_TOKEN=70b6ae71-76b3-4c38-9597-0c5b37ad9630
347-
SC4S_DEST_SPLUNK_HEC_DEFAULT_TLS_VERIFY=no
348-
SC4S_USE_NAME_CACHE=yes
349-
SC4S_CLEAR_NAME_CACHE=yes
350-
SC4S_IPV6_ENABLE=${{ matrix.SC4S_IPV6_ENABLE }}
351-
- name: Update current SC4S image in unit file
352-
run: |
353-
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
354-
- name: Run Ansible Playbook
355-
run: |
356-
ansible-playbook --connection=local -i ansible/inventory/inventory.yaml ansible/playbooks/${{ matrix.deployment_type }}.yml
357326
- name: Run tests
358327
run: |
359328
pip3 install poetry
@@ -362,15 +331,15 @@ jobs:
362331
poetry run pytest -v --tb=long \
363332
--splunk_type=external \
364333
--splunk_hec_token=70b6ae71-76b3-4c38-9597-0c5b37ad9630 \
365-
--splunk_host=127.0.0.1 \
366-
--sc4s_host=127.0.0.1 \
334+
--splunk_host=splunk \
335+
--sc4s_host=sc4s \
367336
--junitxml=test-results/test.xml \
368337
-n 1 \
369338
-m 'name_cache'
370339
- name: artifact-test-results
371340
uses: actions/upload-artifact@v4
372341
with:
373-
name: test-name-cache-results_${{ matrix.deployment_type }}_IPv6_${{ matrix.SC4S_IPV6_ENABLE }}.xml
342+
name: test-name-cache-results_IPv6_${{ matrix.SC4S_IPV6_ENABLE }}.xml
374343
path: test-results/test.xml
375344
if: ${{ !cancelled() }}
376345

ansible/resources/docker_sc4s.service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ ExecStart=/usr/bin/docker run \
4343
--name SC4S \
4444
--rm $SC4S_IMAGE
4545

46-
Restart=on-failure
46+
Restart=on-failure

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def get_host_key():
2222

2323
@pytest.fixture(scope="function")
2424
def get_pid():
25-
return random.randint(1000, 32000) # NOSONAR
25+
return random.randint(1000, 32000) # NOSONAR
2626

2727

2828
def pytest_addoption(parser):

0 commit comments

Comments
 (0)