Skip to content

Commit 6cb6087

Browse files
committed
add case for basic QinQ check test
xxxx-95976: [virtual network][virual-nic-device] Basic QinQ test - 10x4094 check -- only for linux Signed-off-by: nanli <[email protected]>
1 parent 1d089a1 commit 6cb6087

File tree

3 files changed

+425
-0
lines changed

3 files changed

+425
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
- virtual_network.qemu_test.bridge_qinq:
2+
only Linux
3+
only bridge
4+
type = bridge_qinq
5+
private_bridge = qinq_br
6+
func_supported_since_qemu_kvm_ver = (8, 1, 0)
7+
create_vm_libvirt = "yes"
8+
image_snapshot = "no"
9+
kill_vm_libvirt = "yes"
10+
guest_qinq_dir = "/home/"
11+
start_vm = "yes"
12+
qin_script = 'linux_qinq/qinq.sh'
13+
ping_count = 10
14+
net_mask = "24"
15+
set_ip_cmd = "ip addr add %s/${net_mask} dev %s"
16+
ip_vm = "192.168.1.2"
17+
vlan_id = 10
18+
L1tag_iface = "v1v${vlan_id}"
19+
L1tag_iface_ip = "192.168.10.10"
20+
tcpdump_cmd = "setsid tcpdump -xxvvleni %s > %s 2> /dev/null"
21+
tcpdump_log = "/tmp/tcpdump-%s.log"
22+
get_tcpdump_log_cmd = "cat ${tcpdump_log}"
23+
advlan_name = "${private_bridge}-vl${vlan_id}"
24+
add_advlan_cmd = "ip link add link ${private_bridge} name ${advlan_name} type vlan proto 802.1ad id ${vlan_id}"
25+
advlan_mac = "54:52:01:2a:0b:02"
26+
advlan_ip = "192.168.10.1"
27+
L2vid = 20
28+
L2tag_iface = "v2v${vlan_id}_${L2vid}"
29+
L2tag_iface_ip = "192.168.20.10"
30+
qvlan_name = "${private_bridge}-vl${vlan_id}_${L2vid}"
31+
qvlan_ip = "192.168.20.1"
32+
add_qvlan_cmd = "ip link add link ${advlan_name} name ${qvlan_name} type vlan id ${L2vid}"
33+
login_timeout = 720
34+
stop_NM_cmd = "systemctl stop NetworkManager"
35+
firewalld_service = disable
36+
file_size = 4096
37+
guest_path = "/var/tmp/transferred_file"
38+
transfer_timeout = 1000
39+
shell_port = 22
40+
iface_dict = {'type_name': 'bridge', 'source': {'bridge': '${private_bridge}'}}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/sh
2+
iface=$1
3+
file1=/tmp/pass1
4+
file2=/tmp/pass2
5+
vns_pre=10
6+
vns=1024
7+
proto=802.1ad
8+
if [ -z "${iface:-}" ]
9+
then
10+
echo "please provide an interface, e.g. $(basename "$0") eth0"
11+
exit 1
12+
else
13+
echo "you are testing with $iface."
14+
fi
15+
16+
rm -f "$file1" "$file2"
17+
18+
for i in `seq $vns_pre`
19+
do
20+
ip link add link $iface name v1v$i type vlan proto $proto id $i
21+
if [ $? -eq 0 ]
22+
then
23+
echo $i>>$file1
24+
else
25+
echo "v1v$i is not created"
26+
fi
27+
sleep 2
28+
for s in `seq $vns`
29+
do
30+
ip link add link v1v$i name v2v$i\_$s type vlan id $s
31+
if [ $? -eq 0 ]
32+
then
33+
echo $i\_$s>>$file2
34+
else
35+
echo "v2v$i\_$s is not created"
36+
fi
37+
done
38+
done
39+
ret1=`cat $file1 |wc -l`
40+
ret2=`cat $file2 |wc -l`
41+
if [ $ret1 -ne $vns_pre ] || [ $ret2 -ne $((vns_pre*vns)) ]
42+
then
43+
echo "$ret2 dot1ad vlans created, case failed, please check"
44+
exit 1
45+
fi
46+
echo "$ret2 dot1ad vlans created successfully"

0 commit comments

Comments
 (0)