@@ -67,20 +67,29 @@ def test_get_vf_state_not_present(self):
6767 self .assertEqual (pci_lib .LinkState .disable .name , result )
6868
6969 def test_set_vf_state (self ):
70+ # state=True, auto=False --> link_state=enable
7071 self .pci_wrapper .set_vf_state (self .VF_INDEX , True )
7172 vf = {'vf' : self .VF_INDEX , 'link_state' : 1 }
7273 self .mock_ip_device .link .set_vf_feature .assert_called_once_with (vf )
7374
75+ # state=False, auto=False --> link_state=disable
7476 self .mock_ip_device .link .set_vf_feature .reset_mock ()
7577 self .pci_wrapper .set_vf_state (self .VF_INDEX , False )
7678 vf = {'vf' : self .VF_INDEX , 'link_state' : 2 }
7779 self .mock_ip_device .link .set_vf_feature .assert_called_once_with (vf )
7880
81+ # state=True, auto=True --> link_state=auto
7982 self .mock_ip_device .link .set_vf_feature .reset_mock ()
80- self .pci_wrapper .set_vf_state (self .VF_INDEX , False , auto = True )
83+ self .pci_wrapper .set_vf_state (self .VF_INDEX , True , auto = True )
8184 vf = {'vf' : self .VF_INDEX , 'link_state' : 0 }
8285 self .mock_ip_device .link .set_vf_feature .assert_called_once_with (vf )
8386
87+ # state=False, auto=True --> link_state=disable
88+ self .mock_ip_device .link .set_vf_feature .reset_mock ()
89+ self .pci_wrapper .set_vf_state (self .VF_INDEX , False , auto = True )
90+ vf = {'vf' : self .VF_INDEX , 'link_state' : 2 }
91+ self .mock_ip_device .link .set_vf_feature .assert_called_once_with (vf )
92+
8493 def test_set_vf_spoofcheck (self ):
8594 self .pci_wrapper .set_vf_spoofcheck (self .VF_INDEX , True )
8695 vf = {'vf' : self .VF_INDEX , 'spoofchk' : 1 }
0 commit comments