Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI SV Publisher #383

Closed
wants to merge 3 commits into from
Closed
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ playbooks/*
!playbooks/tasks/
!playbooks/deploy_*.yaml
!playbooks/update*.yaml
!playbooks/files/
inventories/*
!inventories/README.adoc

Expand Down
27 changes: 27 additions & 0 deletions playbooks/ci_run_test_with_sv_publisher.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright (C) 2024 Savoir-faire Linux, Inc
# SPDX-License-Identifier: Apache-2.0

# Run script to send SV from pcap file

- hosts: publisher_machines
name: Run Test
gather_facts: false
become: true
vars:
- home: /root
- script_name: "ci_publish_sv.sh"
tasks:
- name: "Prepare Publisher"
file:
path: "{{ item }}"
state: directory
loop:
- "{{ home }}/tests"
- "{{ home }}/tests/results"
- "{{ home }}/tests/pcaps"
- name: "Copy pcap file on publisher"
copy:
src: "{{ pcap_file }}"
dest: "{{ home }}/tests/pcaps"
- name: "test script ansible"
script: "{{ script_name }} {{ pcap_file }} {{ home }}/tests"
25 changes: 25 additions & 0 deletions playbooks/files/ci_publish_sv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright (C) 2024 Savoir-faire Linux, Inc
# SPDX-License-Identifier: Apache-2.0

#!/bin/bash
set -x

# First parameter : pcap file
# Second parameter : root directory

CMD_RUNNER="bittwist -i eno1 $2/pcaps/$1"

CMD_DUMP="tcpdump -w $2/results/result-$(date +%s).pcap"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add -ttt if you want to measure the passing.


$CMD_DUMP &
PID_DUMP=$!

$CMD_RUNNER &
PID_RUNNER=$!

wait $PID_RUNNER
kill -2 $PID_DUMP

wait $PID_DUMP

exit 0