Exemple #1
0
func (s *AllSuite) TestInterfaces(c *C) {
	all := builtin.Interfaces()
	c.Check(all, Contains, &builtin.BluezInterface{})
	c.Check(all, Contains, &builtin.BoolFileInterface{})
	c.Check(all, Contains, &builtin.BrowserSupportInterface{})
	c.Check(all, Contains, &builtin.DbusInterface{})
	c.Check(all, Contains, &builtin.DockerInterface{})
	c.Check(all, Contains, &builtin.DockerSupportInterface{})
	c.Check(all, Contains, &builtin.FwupdInterface{})
	c.Check(all, Contains, &builtin.FwupdInterface{})
	c.Check(all, Contains, &builtin.GpioInterface{})
	c.Check(all, Contains, &builtin.HidrawInterface{})
	c.Check(all, Contains, &builtin.I2cInterface{})
	c.Check(all, Contains, &builtin.IioInterface{})
	c.Check(all, Contains, &builtin.LocationControlInterface{})
	c.Check(all, Contains, &builtin.LocationObserveInterface{})
	c.Check(all, Contains, &builtin.LxdSupportInterface{})
	c.Check(all, Contains, &builtin.MirInterface{})
	c.Check(all, Contains, &builtin.MprisInterface{})
	c.Check(all, Contains, &builtin.PulseAudioInterface{})
	c.Check(all, Contains, &builtin.SerialPortInterface{})
	c.Check(all, Contains, &builtin.UDisks2Interface{})
	c.Check(all, DeepContains, builtin.NewAlsaInterface())
	c.Check(all, DeepContains, builtin.NewAvahiObserveInterface())
	c.Check(all, DeepContains, builtin.NewBluetoothControlInterface())
	c.Check(all, DeepContains, builtin.NewCameraInterface())
	c.Check(all, DeepContains, builtin.NewCupsControlInterface())
	c.Check(all, DeepContains, builtin.NewFirewallControlInterface())
	c.Check(all, DeepContains, builtin.NewFuseSupportInterface())
	c.Check(all, DeepContains, builtin.NewGsettingsInterface())
	c.Check(all, DeepContains, builtin.NewHomeInterface())
	c.Check(all, DeepContains, builtin.NewKernelModuleControlInterface())
	c.Check(all, DeepContains, builtin.NewLocaleControlInterface())
	c.Check(all, DeepContains, builtin.NewLogObserveInterface())
	c.Check(all, DeepContains, builtin.NewMountObserveInterface())
	c.Check(all, DeepContains, builtin.NewNetworkBindInterface())
	c.Check(all, DeepContains, builtin.NewNetworkControlInterface())
	c.Check(all, DeepContains, builtin.NewNetworkInterface())
	c.Check(all, DeepContains, builtin.NewNetworkObserveInterface())
	c.Check(all, DeepContains, builtin.NewOpenglInterface())
	c.Check(all, DeepContains, builtin.NewOpenvSwitchInterface())
	c.Check(all, DeepContains, builtin.NewOpenvSwitchSupportInterface())
	c.Check(all, DeepContains, builtin.NewOpticalDriveInterface())
	c.Check(all, DeepContains, builtin.NewProcessControlInterface())
	c.Check(all, DeepContains, builtin.NewRawUsbInterface())
	c.Check(all, DeepContains, builtin.NewRemovableMediaInterface())
	c.Check(all, DeepContains, builtin.NewScreenInhibitControlInterface())
	c.Check(all, DeepContains, builtin.NewSnapdControlInterface())
	c.Check(all, DeepContains, builtin.NewSystemObserveInterface())
	c.Check(all, DeepContains, builtin.NewSystemTraceInterface())
	c.Check(all, DeepContains, builtin.NewTimeControlInterface())
	c.Check(all, DeepContains, builtin.NewTimeserverControlInterface())
	c.Check(all, DeepContains, builtin.NewTimezoneControlInterface())
	c.Check(all, DeepContains, builtin.NewTpmInterface())
	c.Check(all, DeepContains, builtin.NewUPowerObserveInterface())
	c.Check(all, DeepContains, builtin.NewUnity7Interface())
	c.Check(all, DeepContains, builtin.NewX11Interface())
}
Exemple #2
0
import (
	. "gopkg.in/check.v1"

	"github.com/snapcore/snapd/interfaces"
	"github.com/snapcore/snapd/interfaces/builtin"
	"github.com/snapcore/snapd/snap"
)

type NetworkInterfaceSuite struct {
	iface interfaces.Interface
	slot  *interfaces.Slot
	plug  *interfaces.Plug
}

var _ = Suite(&NetworkInterfaceSuite{
	iface: builtin.NewNetworkInterface(),
	slot: &interfaces.Slot{
		SlotInfo: &snap.SlotInfo{
			Snap:      &snap.Info{SuggestedName: "ubuntu-core", Type: snap.TypeOS},
			Name:      "network",
			Interface: "network",
		},
	},
	plug: &interfaces.Plug{
		PlugInfo: &snap.PlugInfo{
			Snap:      &snap.Info{SuggestedName: "other"},
			Name:      "network",
			Interface: "network",
		},
	},
})