def test_eth3_dhcp(): eq_(screenly_net_mgr.if_config( interface='eth3' ), """ auto eth3 iface eth3 inet dhcp """)
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 """)
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 """)
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 """)
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 """)
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 """)
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 """)
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 """)