0001-tests-for-ifconfig-on-linux-with-vlans-and-aliases.patch

a new test - Marc Fournier, 04/23/2009 10:29 pm

Download (4.7 kB)

b/spec/unit/data/linux_ifconfig_all_with_several_interfaces
1
eth0      Link encap:Ethernet  HWaddr 00:1a:6b:6c:f2:8a  
2
          inet addr:192.168.111.19  Bcast:192.168.111.255  Mask:255.255.255.0
3
          inet6 addr: fe80::21a:6bff:fe6c:f28a/64 Scope:Link
4
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
5
          RX packets:2727002 errors:0 dropped:0 overruns:0 frame:0
6
          TX packets:3186086 errors:0 dropped:0 overruns:0 carrier:0
7
          collisions:0 txqueuelen:100 
8
          RX bytes:1765175756 (1.6 GiB)  TX bytes:2604328207 (2.4 GiB)
9
          Memory:ee000000-ee020000 
10

  
11
eth0:0    Link encap:Ethernet  HWaddr 00:1a:6b:6c:f2:8a  
12
          inet addr:10.0.0.1  Bcast:0.0.0.0  Mask:255.255.255.255
13
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
14
          Memory:ee000000-ee020000 
15

  
16
eth0.4    Link encap:Ethernet  HWaddr 00:1a:6b:6c:f2:8a  
17
          inet addr:192.168.1.1  Bcast:0.0.0.0  Mask:255.255.255.255
18
          inet6 addr: fe80::21a:6bff:fe6c:f28a/64 Scope:Link
19
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
20
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
21
          TX packets:198 errors:0 dropped:0 overruns:0 carrier:0
22
          collisions:0 txqueuelen:0 
23
          RX bytes:0 (0.0 B)  TX bytes:23848 (23.2 KiB)
24

  
25
eth0.4:0  Link encap:Ethernet  HWaddr 00:1a:6b:6c:f2:8a  
26
          inet addr:192.168.1.2  Bcast:0.0.0.0  Mask:255.255.255.255
27
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
28

  
29
eth0.4:_foo_ Link encap:Ethernet  HWaddr 00:1a:6b:6c:f2:8a  
30
          inet addr:192.168.1.4  Bcast:0.0.0.0  Mask:255.255.255.255
31
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
32

  
33
eth0:test Link encap:Ethernet  HWaddr 00:1a:6b:6c:f2:8a  
34
          inet addr:10.0.0.2  Bcast:0.0.0.0  Mask:255.255.255.255
35
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
36
          Memory:ee000000-ee020000 
37

  
38
lo        Link encap:Local Loopback  
39
          inet addr:127.0.0.1  Mask:255.0.0.0
40
          inet6 addr: ::1/128 Scope:Host
41
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
42
          RX packets:26813 errors:0 dropped:0 overruns:0 frame:0
43
          TX packets:26813 errors:0 dropped:0 overruns:0 carrier:0
44
          collisions:0 txqueuelen:0 
45
          RX bytes:6069995 (5.7 MiB)  TX bytes:6069995 (5.7 MiB)
46

  
47
wlan0     Link encap:Ethernet  HWaddr 00:1b:77:6f:7f:e3  
48
          inet addr:192.168.111.29  Bcast:192.168.111.255  Mask:255.255.255.0
49
          inet6 addr: fe80::21b:77ff:fe6f:7fe3/64 Scope:Link
50
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
51
          RX packets:266 errors:0 dropped:0 overruns:0 frame:0
52
          TX packets:523 errors:0 dropped:0 overruns:0 carrier:0
53
          collisions:0 txqueuelen:1000 
54
          RX bytes:143761 (140.3 KiB)  TX bytes:114403 (111.7 KiB)
55

  
56
wmaster0  Link encap:UNSPEC  HWaddr 00-1B-77-6F-7F-E3-00-00-00-00-00-00-00-00-00-00  
57
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
58
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
59
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
60
          collisions:0 txqueuelen:1000 
61
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
62

  
b/spec/unit/util/ip.rb
28 28
    end
29 29

  
30 30

  
31
    it "should return a list with several interfaces on Linux with several interfaces" do
32
        sample_output_file = File.dirname(__FILE__) + '/../data/linux_ifconfig_all_with_several_interfaces'
33
        linux_ifconfig = File.new(sample_output_file).read()
34
        Facter::Util::IP.stubs(:get_all_interface_output).returns(linux_ifconfig)
35
        Facter::Util::IP.get_interfaces().should == ["eth0","eth0:0","eth0.4","eth0.4:0","eth0.4:_foo_","eth0:test","wlan0","wmaster0"]
36
    end
37

  
38

  
31 39
    it "should return a value for a specific interface" do
32 40
        Facter::Util::IP.should respond_to(:get_interface_value)
33 41
    end
34
-