github.com/mhilton/juju-juju@v0.0.0-20150901100907-a94dd2c73455/worker/networker/export_test.go (about) 1 // Copyright 2014 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package networker 5 6 import ( 7 "github.com/juju/names" 8 9 "github.com/juju/juju/network" 10 ) 11 12 // NewConfigFile is a helper use to create a *configFile for testing. 13 func NewConfigFile(interfaceName, fileName string, info network.InterfaceInfo, data []byte) ConfigFile { 14 return &configFile{ 15 interfaceName: interfaceName, 16 fileName: fileName, 17 interfaceInfo: info, 18 data: data, 19 } 20 } 21 22 // IsRunningInLXC is a helper for testing isRunningInLXC. 23 func IsRunningInLXC(machineId string) bool { 24 nw := &Networker{tag: names.NewMachineTag(machineId)} 25 return nw.isRunningInLXC() 26 } 27 28 // IsVLANModuleLoaded returns whether 8021q kernel module has been 29 // loaded. 30 func (nw *Networker) IsVLANModuleLoaded() bool { 31 return nw.isVLANSupportInstalled 32 }