1515
1616from SoftLayer .CLI import exceptions
1717from SoftLayer .fixtures import SoftLayer_Product_Order
18+ from SoftLayer .fixtures import SoftLayer_Search
1819from SoftLayer import SoftLayerError
1920from SoftLayer import testing
2021from SoftLayer import utils
@@ -1030,3 +1031,15 @@ def test_hardware_cancel_no_force(self, confirm_mock):
10301031
10311032 self .assertEqual (2 , result .exit_code )
10321033 self .assertEqual ('Aborted' , result .exception .message )
1034+
1035+ def test_hardware_vlan_add (self ):
1036+ mock = self .set_mock ('SoftLayer_Search' , 'advancedSearch' )
1037+ mock .return_value = SoftLayer_Search .advancedSearchVlan
1038+ result = self .run_command (['hardware' , 'vlan-add' , '12345' , '5555' ])
1039+ self .assert_no_fail (result )
1040+ search_args = '_objectType:SoftLayer_Network_Vlan "5555"'
1041+ self .assert_called_with ('SoftLayer_Search' , 'advancedSearch' , args = (search_args ,))
1042+ self .assert_called_with ('SoftLayer_Hardware_Server' , 'getFrontendNetworkComponents' , identifier = 12345 )
1043+ self .assert_called_with ('SoftLayer_Hardware_Server' , 'getBackendNetworkComponents' , identifier = 12345 )
1044+ self .assert_called_with ('SoftLayer_Network_Component' , 'addNetworkVlanTrunks' , identifier = 998877 )
1045+ self .assert_called_with ('SoftLayer_Network_Component' , 'addNetworkVlanTrunks' , identifier = 123456 )
0 commit comments