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
40 changes: 40 additions & 0 deletions libvirt/tests/cfg/virtual_network/qemu/bridge_qinq.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
- virtual_network.qemu_test.bridge_qinq:
only Linux
only bridge
type = bridge_qinq
private_bridge = qinq_br
func_supported_since_qemu_kvm_ver = (8, 1, 0)
create_vm_libvirt = "yes"
image_snapshot = "no"
kill_vm_libvirt = "yes"
guest_qinq_dir = "/home/"
start_vm = "yes"
qin_script = 'linux_qinq/qinq.sh'
ping_count = 10
net_mask = "24"
set_ip_cmd = "ip addr add %s/${net_mask} dev %s"
ip_vm = "192.168.1.2"
vlan_id = 10
L1tag_iface = "v1v${vlan_id}"
L1tag_iface_ip = "192.168.10.10"
tcpdump_cmd = "setsid tcpdump -xxvvleni %s > %s 2> /dev/null"
tcpdump_log = "/tmp/tcpdump-%s.log"
get_tcpdump_log_cmd = "cat ${tcpdump_log}"
advlan_name = "${private_bridge}-vl${vlan_id}"
add_advlan_cmd = "ip link add link ${private_bridge} name ${advlan_name} type vlan proto 802.1ad id ${vlan_id}"
advlan_mac = "54:52:01:2a:0b:02"
advlan_ip = "192.168.10.1"
L2vid = 20
L2tag_iface = "v2v${vlan_id}_${L2vid}"
L2tag_iface_ip = "192.168.20.10"
qvlan_name = "${private_bridge}-vl${vlan_id}_${L2vid}"
qvlan_ip = "192.168.20.1"
add_qvlan_cmd = "ip link add link ${advlan_name} name ${qvlan_name} type vlan id ${L2vid}"
login_timeout = 720
stop_NM_cmd = "systemctl stop NetworkManager"
firewalld_service = disable
file_size = 4096
guest_path = "/var/tmp/transferred_file"
transfer_timeout = 1000
shell_port = 22
iface_dict = {'type_name': 'bridge', 'source': {'bridge': '${private_bridge}'}}
46 changes: 46 additions & 0 deletions libvirt/tests/deps/linux_qinq/qinq.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/sh
iface=$1
file1=/tmp/pass1
file2=/tmp/pass2
vns_pre=10
vns=1024
proto=802.1ad
if [ -z "${iface:-}" ]
then
echo "please provide an interface, e.g. $(basename "$0") eth0"
exit 1
else
echo "you are testing with $iface."
fi

rm -f "$file1" "$file2"

for i in `seq $vns_pre`
do
ip link add link $iface name v1v$i type vlan proto $proto id $i
if [ $? -eq 0 ]
then
echo $i>>$file1
else
echo "v1v$i is not created"
fi
sleep 2
for s in `seq $vns`
do
ip link add link v1v$i name v2v$i\_$s type vlan id $s
if [ $? -eq 0 ]
then
echo $i\_$s>>$file2
else
echo "v2v$i\_$s is not created"
fi
done
done
ret1=`cat $file1 |wc -l`
ret2=`cat $file2 |wc -l`
if [ $ret1 -ne $vns_pre ] || [ $ret2 -ne $((vns_pre*vns)) ]
then
echo "$ret2 dot1ad vlans created, case failed, please check"
exit 1
fi

This comment was marked as resolved.

echo "$ret2 dot1ad vlans created successfully"
Loading