// Check addNet appends to the network config list new configurations.
// Check that the elements in the list has the correct values
Check addNet appends to the network config list new configurations.
Check that the elements in the list has the correct values
// Check addNet appends to the network config list new configurations . // Check that the elements in the list has the correct values
func TestCloudHypervisorAddNetCheckNetConfigListValues(t *testing.T) {
	macTest := "00:00:00:00:00"
	tapPath := "/path/to/tap"
	assert := assert.New(t)
	clh := cloudHypervisor{}
	e := &VethEndpoint{}
	e.NetPair.TAPIface.HardAddr = macTest
	e.NetPair.TapInterface.TAPIface.Name = tapPath
	err := clh.addNet(e)
	assert.Nil(err)
	assert.Equal(len(clh.vmconfig.Net), 1)
	if err == nil {
		assert.Equal(clh.vmconfig.Net[0].Mac, macTest)
		assert.Equal(clh.vmconfig.Net[0].Tap, tapPath)
	}
	err = clh.addNet(e)
	assert.Nil(err)
	assert.Equal(len(clh.vmconfig.Net), 2)
	if err == nil {
		assert.Equal(clh.vmconfig.Net[1].Mac, macTest)
		assert.Equal(clh.vmconfig.Net[1].Tap, tapPath)
	}
}
func TestCloudHypervisorAddNetCheckNetConfigListValues ( t * testing . T ) { macTest := " " tapPath := " " assert := assert . New ( t ) clh := cloudHypervisor { } e := & VethEndpoint { } e . NetPair . TAPIface . HardAddr = macTest e . NetPair . TapInterface . TAPIface . Name = tapPath err := clh . addNet ( e ) assert . Nil ( err ) assert . Equal ( len ( clh . vmconfig . Net ) , 1 ) if err == nil { assert . Equal ( clh . vmconfig . Net [ 0 ] . Mac , macTest ) assert . Equal ( clh . vmconfig . Net [ 0 ] . Tap , tapPath ) } err = clh . addNet ( e ) assert . Nil ( err ) assert . Equal ( len ( clh . vmconfig . Net ) , 2 ) if err == nil { assert . Equal ( clh . vmconfig . Net [ 1 ] . Mac , macTest ) assert . Equal ( clh . vmconfig . Net [ 1 ] . Tap , tapPath ) } }
Check addNet appends to the network config list new configurations.
Check addNet appends to the network config list new configurations .