コード例 #1
0
def test_eth3_dhcp():
    eq_(screenly_net_mgr.if_config(
        interface='eth3'
    ), """
auto eth3
  iface eth3 inet dhcp
""")
コード例 #2
0
def test_wlan0_dhcp_no_passphrase():
    eq_(
        screenly_net_mgr.if_config(interface='wlan0', ssid='foobar'), """
auto wlan0
  iface wlan0 inet dhcp
  wireless-power off
  wpa-ssid foobar
""")
コード例 #3
0
def ifcconfig_with_two_dns_servers():
    eq_(
        screenly_net_mgr.if_config(interface='eth0', dns='1.1.1.1, 2.2.2.2'),
        """
auto eth0
  iface eth0 inet dhcp
  dns-nameservers 1.2.3.4, 2.2.2.2
""")
コード例 #4
0
def test_wlan1_dhcp_with_passphrase():
    eq_(
        screenly_net_mgr.if_config(interface='wlan1',
                                   ssid='foobar',
                                   passphrase='password'), """
auto wlan1
  iface wlan1 inet dhcp
  wireless-power off
  wpa-ssid foobar
  wpa-psk password
""")
コード例 #5
0
def test_eth0_static():
    eq_(
        screenly_net_mgr.if_config(interface='eth0',
                                   ip='192.168.10.1',
                                   netmask='255.255.255.0',
                                   gateway='192.168.10.1'), """
auto eth0
  iface eth0 inet static
  address 192.168.10.1
  netmask 255.255.255.0
  gateway 192.168.10.1
""")
コード例 #6
0
def test_wlan0_dhcp_with_hidden_ssid():
    eq_(
        screenly_net_mgr.if_config(
            interface='wlan0',
            ssid='foobar',
            passphrase='password',
            hidden_ssid='true',
        ), """
auto wlan0
  iface wlan0 inet dhcp
  wireless-power off
  wpa-ssid foobar
  wpa-psk password
  wpa-ap-scan 1
  wpa-scan-ssid 1
""")
コード例 #7
0
def test_wlan0_static_with_passphrase():
    eq_(
        screenly_net_mgr.if_config(interface='wlan0',
                                   ssid='foobar',
                                   passphrase='password',
                                   ip='192.168.10.1',
                                   netmask='255.255.255.0',
                                   gateway='192.168.10.1'), """
auto wlan0
  iface wlan0 inet static
  address 192.168.10.1
  netmask 255.255.255.0
  gateway 192.168.10.1
  wireless-power off
  wpa-ssid foobar
  wpa-psk password
""")
コード例 #8
0
def ifconfig_with_one_dns_server():
    eq_(screenly_net_mgr.if_config(interface='eth0', dns='1.2.3.4'), """
auto eth0
  iface eth0 inet dhcp
  dns-nameservers 1.2.3.4
""")