Example #1
0
 def test__identifies_physical_ethernet_interface(self):
     self.createEthernetInterface('eth0', is_physical=True)
     self.assertThat(
         get_interface_type('eth0',
                            sys_class_net=self.tmp_sys_net,
                            proc_net=self.tmp_proc_net),
         Equals('ethernet.physical'))
Example #2
0
 def test__identifies_bond_interface(self):
     self.createEthernetInterface('bond0', is_bond=True)
     self.assertThat(
         get_interface_type('bond0',
                            sys_class_net=self.tmp_sys_net,
                            proc_net=self.tmp_proc_net),
         Equals('ethernet.bond'))
Example #3
0
 def test__identifies_vlan_interface(self):
     self.createEthernetInterface('vlan42', is_vlan=True)
     self.assertThat(
         get_interface_type('vlan42',
                            sys_class_net=self.tmp_sys_net,
                            proc_net=self.tmp_proc_net),
         Equals('ethernet.vlan'))
Example #4
0
 def test__unknown_interfaces_type_includes_id(self):
     self.createInterfaceType('avian0', 1149)
     self.assertThat(
         get_interface_type('avian0',
                            sys_class_net=self.tmp_sys_net,
                            proc_net=self.tmp_proc_net),
         Equals('unknown-1149'))
Example #5
0
 def test__identifies_loopback_interface(self):
     self.createLoopbackInterface('lo')
     self.assertThat(get_interface_type(
         'lo', sys_class_net=self.tmp_sys_net,
         proc_net=self.tmp_proc_net),
         Equals('loopback')
     )
Example #6
0
 def test__identifies_ipip_interface(self):
     self.createIpIpInterface('tun0')
     self.assertThat(get_interface_type(
         'tun0', sys_class_net=self.tmp_sys_net,
         proc_net=self.tmp_proc_net),
         Equals('ipip')
     )
Example #7
0
 def test__identifies_other_ethernet_interface(self):
     self.createEthernetInterface('eth1')
     self.assertThat(get_interface_type(
         'eth1', sys_class_net=self.tmp_sys_net,
         proc_net=self.tmp_proc_net),
         Equals('ethernet')
     )
Example #8
0
 def test__identifies_wireless_ethernet_interface(self):
     self.createEthernetInterface('wlan0', is_wireless=True)
     self.assertThat(
         get_interface_type('wlan0',
                            sys_class_net=self.tmp_sys_net,
                            proc_net=self.tmp_proc_net),
         Equals('ethernet.wireless'))
Example #9
0
 def test__identifies_tunnel_interface(self):
     self.createEthernetInterface('vnet0', is_tunnel=True)
     self.assertThat(
         get_interface_type('vnet0',
                            sys_class_net=self.tmp_sys_net,
                            proc_net=self.tmp_proc_net),
         Equals('ethernet.tunnel'))
Example #10
0
 def test_identifies_other_ethernet_interface(self):
     self.createEthernetInterface("eth1")
     self.assertThat(
         get_interface_type(
             "eth1",
             sys_class_net=self.tmp_sys_net,
             proc_net=self.tmp_proc_net,
         ),
         Equals("ethernet"),
     )
Example #11
0
 def test_unknown_interfaces_type_includes_id(self):
     self.createInterfaceType("avian0", 1149)
     self.assertThat(
         get_interface_type(
             "avian0",
             sys_class_net=self.tmp_sys_net,
             proc_net=self.tmp_proc_net,
         ),
         Equals("unknown-1149"),
     )
Example #12
0
 def test_identifies_loopback_interface(self):
     self.createLoopbackInterface("lo")
     self.assertThat(
         get_interface_type(
             "lo",
             sys_class_net=self.tmp_sys_net,
             proc_net=self.tmp_proc_net,
         ),
         Equals("loopback"),
     )
Example #13
0
 def test__identifies_ipip_interface(self):
     self.createIpIpInterface("tun0")
     self.assertThat(
         get_interface_type(
             "tun0",
             sys_class_net=self.tmp_sys_net,
             proc_net=self.tmp_proc_net,
         ),
         Equals("ipip"),
     )
Example #14
0
 def test_identifies_vlan_interface(self):
     self.createEthernetInterface("vlan42", is_vlan=True)
     self.assertThat(
         get_interface_type(
             "vlan42",
             sys_class_net=self.tmp_sys_net,
             proc_net=self.tmp_proc_net,
         ),
         Equals("ethernet.vlan"),
     )
Example #15
0
 def test__identifies_bridge_interface(self):
     self.createEthernetInterface("br0", is_bridge=True)
     self.assertThat(
         get_interface_type(
             "br0",
             sys_class_net=self.tmp_sys_net,
             proc_net=self.tmp_proc_net,
         ),
         Equals("ethernet.bridge"),
     )
Example #16
0
 def test__identifies_missing_interface(self):
     self.assertThat(
         get_interface_type("eth0", sys_class_net=self.tmp_sys_net),
         Equals("missing"),
     )
Example #17
0
 def test__identifies_missing_interface(self):
     self.assertThat(
         get_interface_type('eth0', sys_class_net=self.tmp_sys_net),
         Equals('missing'))