Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
224 changes: 129 additions & 95 deletions .github/workflows/ci-enterprise.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,15 @@ jobs:
scanners: "vuln"

test-container:
strategy:
matrix:
deployment_type: ["docker", "podman"]
runs-on: ubuntu-latest
continue-on-error: true
needs:
- meta
- build_action
container:
image: python:3.9-buster

services:
splunk:
image: splunk/splunk:${{ fromJson(needs.meta.outputs.matrix_supportedSplunk)[0].version }}
Expand All @@ -202,41 +205,68 @@ jobs:
SPLUNK_PASSWORD: Changed@11
SPLUNK_START_ARGS: --accept-license
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
sc4s:
image: ${{ needs.meta.outputs.container_base }}
ports:
- 514:514
- 601:601
- 5614:5514
- 5601:5601
- 6000:6000
- 6002:6002
- 9000:9000
env:
SC4S_DEST_SPLUNK_HEC_DEFAULT_URL: https://splunk:8088
SC4S_DEST_SPLUNK_HEC_DEFAULT_TOKEN: 70b6ae71-76b3-4c38-9597-0c5b37ad9630
SC4S_DEST_SPLUNK_HEC_DEFAULT_TLS_VERIFY: "no"
SC4S_DEST_SPLUNK_HEC_DEFAULT_HTTP_COMPRESSION: "yes"
SC4S_LISTEN_PFSENSE_FIREWALL_TCP_PORT: 6000
SC4S_LISTEN_SIMPLE_TEST_ONE_TCP_PORT: 5514
SC4S_LISTEN_SIMPLE_TEST_ONE_UDP_PORT: 5514
SC4S_LISTEN_SIMPLE_TEST_TWO_TCP_PORT: 5601
SC4S_LISTEN_SPECTRACOM_NTP_TCP_PORT: 6002
SC4S_LISTEN_CISCO_ESA_TCP_PORT: 9000
SC4S_LISTEN_RARITAN_DSX_TCP_PORT: 9001
SC4S_LISTEN_CHECKPOINT_SPLUNK_NOISE_CONTROL: "yes"
SC4S_SOURCE_RICOH_SYSLOG_FIXHOST: "yes"
TEST_SC4S_ACTIVATE_EXAMPLES: "yes"
SC4S_DEBUG_CONTAINER: "yes"
SC4S_SOURCE_VMWARE_VSPHERE_GROUPMSG: "yes"
SC4S_NETAPP_ONTAP_NEW_FORMAT: "yes"
SC4S_USE_VPS_CACHE: "yes"

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: false
persist-credentials: false
- name: Install Ansible and other dependencies as python package
run: |
pip install ansible~=6.1.0 --no-cache-dir \
&& pip install pywinrm>=0.4.2 --no-cache-dir \
&& pip install ansible-lint>=6.0.0 --no-cache-dir \
&& pip install docker --no-cache-dir
- name: Configure Ansible Environment Variables
env:
ANSIBLE_CONFIG: ansible.cfg
ANSIBLE_HOST_KEY_CHECKING: False
run: |
echo "ANSIBLE_CONFIG is set to: $ANSIBLE_CONFIG"
echo "ANSIBLE_HOST_KEY_CHECKING is set to: $ANSIBLE_HOST_KEY_CHECKING"
sudo systemctl set-environment SC4S_IMAGE=${{ needs.meta.outputs.container_base }}
- name: Update inventory file
run: |
cat << EOF > ansible/inventory/inventory.yaml
---
all:
hosts:
children:
node:
hosts:
node_1:
ansible_host: 127.0.0.1
ansible_connection: local
ansible_user: root
- name: Update env_file
run: |
echo "Updating ansible/inventory/inventory.yaml"
cat << EOF > ansible/resources/env_file
SC4S_DEST_SPLUNK_HEC_DEFAULT_URL=https://127.0.0.1:8088
SC4S_DEST_SPLUNK_HEC_DEFAULT_TOKEN=70b6ae71-76b3-4c38-9597-0c5b37ad9630
SC4S_DEST_SPLUNK_HEC_DEFAULT_TLS_VERIFY=no
SC4S_DEST_SPLUNK_HEC_DEFAULT_HTTP_COMPRESSION=yes
SC4S_LISTEN_PFSENSE_FIREWALL_TCP_PORT=6000
SC4S_LISTEN_SIMPLE_TEST_ONE_TCP_PORT=5514
SC4S_LISTEN_SIMPLE_TEST_ONE_UDP_PORT=5514
SC4S_LISTEN_SIMPLE_TEST_TWO_TCP_PORT=5601
SC4S_LISTEN_SPECTRACOM_NTP_TCP_PORT=6002
SC4S_LISTEN_CISCO_ESA_TCP_PORT=9000
SC4S_LISTEN_RARITAN_DSX_TCP_PORT=9001
SC4S_LISTEN_CHECKPOINT_SPLUNK_NOISE_CONTROL=yes
SC4S_SOURCE_RICOH_SYSLOG_FIXHOST=yes
TEST_SC4S_ACTIVATE_EXAMPLES=yes
SC4S_DEBUG_CONTAINER=yes
SC4S_SOURCE_VMWARE_VSPHERE_GROUPMSG=yes
SC4S_NETAPP_ONTAP_NEW_FORMAT=yes
SC4S_USE_VPS_CACHE=yes
- name: Update current SC4S image in unit file
run: |
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
- name: Run Ansible Playbook
run: |
ansible-playbook --connection=local -i ansible/inventory/inventory.yaml ansible/playbooks/${{ matrix.deployment_type }}.yml
- name: Run tests
run: |
pip3 install poetry
Expand All @@ -245,93 +275,91 @@ jobs:
poetry run pytest -v --tb=long \
--splunk_type=external \
--splunk_hec_token=70b6ae71-76b3-4c38-9597-0c5b37ad9630 \
--splunk_host=splunk \
--sc4s_host=sc4s \
--splunk_host=127.0.0.1 \
--sc4s_host=127.0.0.1 \
--junitxml=test-results/test.xml \
-n 14 \
-k 'not lite and not name_cache'
test-ipv4-name-cache:
- name: artifact-test-results
uses: actions/upload-artifact@v4
with:
name: test-container-results_${{ matrix.deployment_type }}.xml
path: test-results/test.xml
if: ${{ !cancelled() }}

test-name-cache:
strategy:
matrix:
deployment_type: ["docker", "podman"]
SC4S_IPV6_ENABLE: ["yes","no"]
runs-on: ubuntu-latest
continue-on-error: true
needs:
- meta
- build_action
container:
image: python:3.9-buster

services:
splunk:
image: splunk/splunk:${{ fromJson(needs.meta.outputs.matrix_supportedSplunk)[0].version }}
ports:
- 8000:8000
- 8088:8088
- 8089:8089
env:
SPLUNK_HEC_TOKEN: 70b6ae71-76b3-4c38-9597-0c5b37ad9630
SPLUNK_PASSWORD: Changed@11
SPLUNK_START_ARGS: --accept-license
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
sc4s:
image: ${{ needs.meta.outputs.container_base }}
ports:
- 514:514
env:
SC4S_DEST_SPLUNK_HEC_DEFAULT_URL: https://splunk:8088
SC4S_DEST_SPLUNK_HEC_DEFAULT_TOKEN: 70b6ae71-76b3-4c38-9597-0c5b37ad9630
SC4S_DEST_SPLUNK_HEC_DEFAULT_TLS_VERIFY: "no"
SC4S_USE_NAME_CACHE: "yes"
SC4S_CLEAR_NAME_CACHE: "yes"

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: false
persist-credentials: false
- name: Run tests
- name: Install Ansible and other dependencies as python package
run: |
pip3 install poetry
poetry install
mkdir -p test-results || true
poetry run pytest -v --tb=long \
--splunk_type=external \
--splunk_hec_token=70b6ae71-76b3-4c38-9597-0c5b37ad9630 \
--splunk_host=splunk \
--sc4s_host=sc4s \
--junitxml=test-results/test.xml \
-n 1 \
-m 'name_cache'
test-ipv6-name-cache:
runs-on: ubuntu-latest
needs:
- meta
- build_action
container:
image: python:3.9-buster
services:
splunk:
image: splunk/splunk:${{ fromJson(needs.meta.outputs.matrix_supportedSplunk)[0].version }}
ports:
- 8088:8088
- 8089:8089
pip install ansible~=6.1.0 --no-cache-dir \
&& pip install pywinrm>=0.4.2 --no-cache-dir \
&& pip install ansible-lint>=6.0.0 --no-cache-dir \
&& pip install docker
- name: Configure Ansible Environment Variables
env:
SPLUNK_HEC_TOKEN: 70b6ae71-76b3-4c38-9597-0c5b37ad9630
SPLUNK_PASSWORD: Changed@11
SPLUNK_START_ARGS: --accept-license
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
sc4s:
image: ${{ needs.meta.outputs.container_base }}
ports:
- 514:514
env:
SC4S_DEST_SPLUNK_HEC_DEFAULT_URL: https://splunk:8088
SC4S_DEST_SPLUNK_HEC_DEFAULT_TOKEN: 70b6ae71-76b3-4c38-9597-0c5b37ad9630
SC4S_DEST_SPLUNK_HEC_DEFAULT_TLS_VERIFY: "no"
SC4S_USE_NAME_CACHE: "yes"
SC4S_CLEAR_NAME_CACHE: "yes"
SC4S_IPV6_ENABLE: "yes"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: false
persist-credentials: false
ANSIBLE_CONFIG: ansible.cfg
ANSIBLE_HOST_KEY_CHECKING: False
run: |
echo "ANSIBLE_CONFIG is set to: $ANSIBLE_CONFIG"
echo "ANSIBLE_HOST_KEY_CHECKING is set to: $ANSIBLE_HOST_KEY_CHECKING"
sudo systemctl set-environment SC4S_IMAGE=${{ needs.meta.outputs.container_base }}
- name: Update inventory file
run: |
cat << EOF > ansible/inventory/inventory.yaml
---
all:
hosts:
children:
node:
hosts:
node_1:
ansible_host: 127.0.0.1
ansible_connection: local
ansible_user: root
- name: Update env_file
run: |
echo "Updating ansible/inventory/inventory.yaml"
cat << EOF > ansible/resources/env_file
SC4S_DEST_SPLUNK_HEC_DEFAULT_URL=https://127.0.0.1:8088
SC4S_DEST_SPLUNK_HEC_DEFAULT_TOKEN=70b6ae71-76b3-4c38-9597-0c5b37ad9630
SC4S_DEST_SPLUNK_HEC_DEFAULT_TLS_VERIFY=no
SC4S_USE_NAME_CACHE=yes
SC4S_CLEAR_NAME_CACHE=yes
SC4S_IPV6_ENABLE=${{ matrix.SC4S_IPV6_ENABLE }}
- name: Update current SC4S image in unit file
run: |
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
- name: Run Ansible Playbook
run: |
ansible-playbook --connection=local -i ansible/inventory/inventory.yaml ansible/playbooks/${{ matrix.deployment_type }}.yml
- name: Run tests
run: |
pip3 install poetry
Expand All @@ -340,19 +368,25 @@ jobs:
poetry run pytest -v --tb=long \
--splunk_type=external \
--splunk_hec_token=70b6ae71-76b3-4c38-9597-0c5b37ad9630 \
--splunk_host=splunk \
--sc4s_host=sc4s \
--splunk_host=127.0.0.1 \
--sc4s_host=127.0.0.1 \
--junitxml=test-results/test.xml \
-n 1 \
-m 'name_cache'
- name: artifact-test-results
uses: actions/upload-artifact@v4
with:
name: test-name-cache-results_${{ matrix.deployment_type }}_IPv6_${{ matrix.SC4S_IPV6_ENABLE }}.xml
path: test-results/test.xml
if: ${{ !cancelled() }}
release:
name: Release
runs-on: ubuntu-latest
needs:
- meta
- build_action
- test-container
- test-ipv4-name-cache
- test-name-cache
steps:
- uses: actions/checkout@v4
with:
Expand Down
Loading
Loading