Merge ~liaou3/checkbox-iiotg/+git/checkbox-provider-intliotg:automation_tsn-ieee802.1qbv into ~checkbox-dev/checkbox-iiotg/+git/checkbox-provider-intliotg:master

Proposed by Vincent Liao
Status: Merged
Approved by: Vincent Liao
Approved revision: b21d2d1ec6752e9fefb00a26b94d1460e9785c3a
Merged at revision: 6d8cb60b4386b14dc032b1c2e2d589c5d4446d6a
Proposed branch: ~liaou3/checkbox-iiotg/+git/checkbox-provider-intliotg:automation_tsn-ieee802.1qbv
Merge into: ~checkbox-dev/checkbox-iiotg/+git/checkbox-provider-intliotg:master
Diff against target: 106 lines (+32/-16)
3 files modified
bin/udp_traffic_test.sh (+29/-12)
units/tsn/jobs.pxu (+2/-3)
units/tsn/test-plan.pxu (+1/-1)
Reviewer Review Type Date Requested Status
StanleyHuang Approve
Rick Wu Approve
Patrick Liu Pending
Vic Liu Pending
PeiYao Chang Pending
Review via email: mp+455861@code.launchpad.net

Commit message

Modify: TSN automation for tsn-ieee802.1qbv

Description of the change

This MR makes the original tsn test case from manual to automated.

submission: https://certification.canonical.com/hardware/202306-31658/submission/343451/test/203645/result/37682372/

To post a comment you must log in.
Revision history for this message
StanleyHuang (stanley31) wrote :

I have a couple of issues for this MR

1. the gptp config is not part of arguments for the tsn_time_sync.sh, is that config integrated into tsn_time_sync.sh scripts?
2. a minor issue found in inline comment.

review: Needs Information
Revision history for this message
Vincent Liao (liaou3) wrote :

> I have a couple of issues for this MR
>
> 1. the gptp config is not part of arguments for the tsn_time_sync.sh, is that
> config integrated into tsn_time_sync.sh scripts?
> 2. a minor issue found in inline comment.

1. Yes, this was implemented between line 71 to 105 in this MR [1]
2. Thanks for your reminder. Fixed

[1] https://code.launchpad.net/~liaou3/checkbox-iiotg/+git/checkbox-provider-intliotg/+merge/455020

Revision history for this message
Rick Wu (rickwu4444) wrote :

LGTM

review: Approve
Revision history for this message
StanleyHuang (stanley31) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/bin/udp_traffic_test.sh b/bin/udp_traffic_test.sh
2index c0ac460..4aea97f 100755
3--- a/bin/udp_traffic_test.sh
4+++ b/bin/udp_traffic_test.sh
5@@ -2,14 +2,13 @@
6
7 eth_interface=$1
8 testing_time=$2
9-gptp_config_path=$3
10-server_user=$4
11-server_ip=$5
12-server_pwd=$6
13-server_eth_interface=$7
14+server_user=$3
15+server_ip=$4
16+server_pwd=$5
17+server_eth_interface=$6
18
19 echo "## Starting time synchronization..."
20-tsn_time_sync.sh "$testing_time" master "${gptp_config_path}" "${eth_interface}" "${server_user}" "${server_ip}" "${server_pwd}" "${server_eth_interface}" > /dev/null &
21+tsn_time_sync.sh "$testing_time" master "${eth_interface}" "${server_user}" "${server_ip}" "${server_pwd}" "${server_eth_interface}" > /dev/null &
22 sleep 10
23
24 echo "## Setting TAPRIO qdisc..."
25@@ -46,13 +45,31 @@ iperf3 -u -l 1000 -b0 -p 5102 -c ${TARGET_IP} -t $((testing_time-10)) >> /dev/nu
26 echo $! > /sys/fs/cgroup/net_prio/grp3/cgroup.procs
27
28 echo "## Checking results..."
29-tc -s qdisc show dev "${eth_interface}"
30-sleep 10
31+out=$(tc -s qdisc show dev "${eth_interface}")
32+echo "$out"
33+sent4=$(echo "$out" | grep Sent | sed -n "2p" | awk '{print $2}')
34+sent3=$(echo "$out" | grep Sent | sed -n "3p" | awk '{print $2}')
35+sent2=$(echo "$out" | grep Sent | sed -n "4p" | awk '{print $2}')
36+sent1=$(echo "$out" | grep Sent | sed -n "5p" | awk '{print $2}')
37 echo ""
38-echo "# 10 seconds after..."
39-tc -s qdisc show dev "${eth_interface}"
40+
41 sleep 10
42-echo ""
43 echo "# 10 seconds after..."
44-tc -s qdisc show dev "${eth_interface}"
45+out=$(tc -s qdisc show dev "${eth_interface}")
46+echo "$out"
47+sent4_new=$(echo "$out" | grep Sent | sed -n "2p" | awk '{print $2}')
48+sent3_new=$(echo "$out" | grep Sent | sed -n "3p" | awk '{print $2}')
49+sent2_new=$(echo "$out" | grep Sent | sed -n "4p" | awk '{print $2}')
50+sent1_new=$(echo "$out" | grep Sent | sed -n "5p" | awk '{print $2}')
51+
52+echo ""
53+if [ "$sent4_new" -le "$sent4" ] || [ "$sent3_new" -le "$sent3" ] || [ "$sent2_new" -le "$sent2" ] || [ "$sent1_new" -le "$sent1" ]; then
54+ echo "ERROR: Packet Sent is not increasing!"
55+ exit_code=1
56+else
57+ echo "PASS: Packet Sent is increasing!"
58+ exit_code=0
59+fi
60 sshpass -p "${server_user}" ssh -o StrictHostKeyChecking=no "${server_user}@${server_ip}" "echo ${server_pwd} | sudo -S killall iperf3"
61+
62+exit "$exit_code"
63diff --git a/units/tsn/jobs.pxu b/units/tsn/jobs.pxu
64index c7b5416..92f6082 100644
65--- a/units/tsn/jobs.pxu
66+++ b/units/tsn/jobs.pxu
67@@ -317,7 +317,7 @@ _summary: Check if the streams packet are handled properly
68 depends:
69 tsn/tsn-detected
70 tsn/testing-snap-install-check
71-plugin: user-interact-verify
72+plugin: shell
73 user: root
74 _purpose:
75 To check if the system can transmit 4 streams of iperf udp traffic
76@@ -327,9 +327,8 @@ environ:
77 TSN_SERVER_USER
78 TSN_SERVER_PWD
79 TSN_SERVER_INTERFACE
80- GPTP_CONFIG_PATH
81 command:
82- udp_traffic_test.sh {interface} 30 "${{GPTP_CONFIG_PATH:-/usr/share/gPTP.cfg}}" "$TSN_SERVER_USER" "$TSN_SERVER_IP" "$TSN_SERVER_PWD" "$TSN_SERVER_INTERFACE"
83+ udp_traffic_test.sh {interface} 30 "$TSN_SERVER_USER" "$TSN_SERVER_IP" "$TSN_SERVER_PWD" "$TSN_SERVER_INTERFACE"
84 _verification:
85 Is the send bytes and pkt are increasing for 100:1 - 100:4?
86
87diff --git a/units/tsn/test-plan.pxu b/units/tsn/test-plan.pxu
88index 3978ad2..c5cc31d 100644
89--- a/units/tsn/test-plan.pxu
90+++ b/units/tsn/test-plan.pxu
91@@ -18,7 +18,6 @@ include:
92 tsn/test-env-setup-for-.*
93 tsn/testing-snap-install-check
94 nested_part:
95- tsn-ieee802.1qbv
96
97 id: tsn-automated
98 _name: Time Sensitive Networking (TSN) test (automated)
99@@ -34,6 +33,7 @@ nested_part:
100 tsn-ieee802.1qav
101 tsn-ieee802.1qbu
102 tsn-time-based-shaping
103+ tsn-ieee802.1qbv
104
105 id: tsn-ieee802.1as-2011
106 _name: Time Sensitive Networking Test Plan for IEEE 802.1AS-2011

Subscribers

People subscribed via source and target branches