Skip to content

Commit

Permalink
test-network: add tests for VLANProtocol= and MACAddress= in [SRIOV] …
Browse files Browse the repository at this point in the history
…section
  • Loading branch information
yuwata committed Jun 22, 2020
1 parent a63f5cd commit 0280de7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions test/test-network/conf/25-sriov.network
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,24 @@ Address=192.168.100.100/24
[SRIOV]
VirtualFunction=0
VLANId=5
VLANProtocol=802.1ad
QualityOfService=1
MACSpoofCheck=yes
QueryReceiveSideScaling=yes
Trust=yes
LinkState=yes
MACAddress=00:11:22:33:44:55

[SRIOV]
VirtualFunction=1
VLANId=6
VLANProtocol=802.1Q
QualityOfService=2
MACSpoofCheck=no
QueryReceiveSideScaling=no
Trust=no
LinkState=no
MACAddress=00:11:22:33:44:56

[SRIOV]
VirtualFunction=2
Expand All @@ -30,3 +34,4 @@ MACSpoofCheck=no
QueryReceiveSideScaling=no
Trust=no
LinkState=auto
MACAddress=00:11:22:33:44:57
6 changes: 3 additions & 3 deletions test/test-network/systemd-networkd-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2515,9 +2515,9 @@ def test_sriov(self):
output = check_output('ip link show dev eni99np1')
print(output)
self.assertRegex(output,
'vf 0 .*vlan 5, qos 1, spoof checking on, link-state enable, trust on, query_rss on\n *'
'vf 1 .*vlan 6, qos 2, spoof checking off, link-state disable, trust off, query_rss off\n *'
'vf 2 .*vlan 7, qos 3, spoof checking off, link-state auto, trust off, query_rss off'
'vf 0 .*00:11:22:33:44:55.*vlan 5, qos 1, vlan protocol 802.1ad, spoof checking on, link-state enable, trust on, query_rss on\n *'
'vf 1 .*00:11:22:33:44:56.*vlan 6, qos 2, spoof checking off, link-state disable, trust off, query_rss off\n *'
'vf 2 .*00:11:22:33:44:57.*vlan 7, qos 3, spoof checking off, link-state auto, trust off, query_rss off'
)

class NetworkdStateFileTests(unittest.TestCase, Utilities):
Expand Down

0 comments on commit 0280de7

Please sign in to comment.