def runTest(self):
     board.sendline('\nuci set firewall.@defaults[0].forward=REJECT')
     board.expect('uci set firewall')
     board.expect(prompt)
     board.sendline('uci set firewall.@zone[0].forward=REJECT')
     board.expect(prompt)
     board.sendline('uci set firewall.@zone[1].input=REJECT')
     board.expect(prompt)
     board.sendline('uci set firewall.@zone[1].forward=REJECT')
     board.expect(prompt)
     board.sendline('uci commit firewall')
     board.expect(prompt)
     board.firewall_restart()
 def runTest(self):
     board.sendline('\nuci set firewall.@defaults[0].forward=REJECT')
     board.expect('uci set firewall')
     board.expect(prompt)
     board.sendline('uci set firewall.@zone[0].forward=REJECT')
     board.expect(prompt)
     board.sendline('uci set firewall.@zone[1].input=REJECT')
     board.expect(prompt)
     board.sendline('uci set firewall.@zone[1].forward=REJECT')
     board.expect(prompt)
     board.sendline('uci commit firewall')
     board.expect(prompt)
     board.firewall_restart()
Exemple #3
0
    def runTest(self):
        board.sendline('uci set network.lan.ifname="%s %s"' %
                       (board.wan_iface, board.lan_iface))
        board.expect(prompt)
        board.sendline('uci set firewall.@defaults[0]=defaults')
        board.expect(prompt)
        board.sendline('uci set firewall.@defaults[0].input=ACCEPT')
        board.expect(prompt)
        board.sendline('uci set firewall.@defaults[0].output=ACCEPT')
        board.expect(prompt)
        board.sendline('uci set firewall.@defaults[0].syn_flood=1')
        board.expect(prompt)
        board.sendline('uci set firewall.@defaults[0].forward=ACCEPT')
        board.expect(prompt)
        board.sendline('uci set firewall.@zone[0]=zone')
        board.expect(prompt)
        board.sendline('uci set firewall.@zone[0].name=lan')
        board.expect(prompt)
        board.sendline('uci set firewall.@zone[0].network=lan')
        board.expect(prompt)
        board.sendline('uci set firewall.@zone[0].input=ACCEPT')
        board.expect(prompt)
        board.sendline('uci set firewall.@zone[0].output=ACCEPT')
        board.expect(prompt)
        board.sendline('uci set firewall.@zone[0].forward=ACCEPT')
        board.expect(prompt)
        board.sendline('uci set firewall.@zone[1]=zone')
        board.expect(prompt)
        board.sendline('uci set firewall.@zone[1].name=wan')
        board.expect(prompt)
        board.sendline('uci set firewall.@zone[1].network=wan')
        board.expect(prompt)
        board.sendline('uci set firewall.@zone[1].output=ACCEPT')
        board.expect(prompt)
        board.sendline('uci set firewall.@zone[1].mtu_fix=1')
        board.expect(prompt)
        board.sendline('uci set firewall.@zone[1].input=ACCEPT')
        board.expect(prompt)
        board.sendline('uci set firewall.@zone[1].forward=ACCEPT')
        board.expect(prompt)
        board.sendline('uci commit')
        board.expect(prompt)
        board.network_restart()
        board.firewall_restart()

        lan.sendline('ifconfig eth1 192.168.0.2')
        lan.expect(prompt)
    def runTest(self):
        board.sendline('uci set network.lan.ifname="%s %s"' % (board.wan_iface, board.lan_iface))
        board.expect(prompt)
        board.sendline('uci set firewall.@defaults[0]=defaults')
        board.expect(prompt)
        board.sendline('uci set firewall.@defaults[0].input=ACCEPT')
        board.expect(prompt)
        board.sendline('uci set firewall.@defaults[0].output=ACCEPT')
        board.expect(prompt)
        board.sendline('uci set firewall.@defaults[0].syn_flood=1')
        board.expect(prompt)
        board.sendline('uci set firewall.@defaults[0].forward=ACCEPT')
        board.expect(prompt)
        board.sendline('uci set firewall.@zone[0]=zone')
        board.expect(prompt)
        board.sendline('uci set firewall.@zone[0].name=lan')
        board.expect(prompt)
        board.sendline('uci set firewall.@zone[0].network=lan')
        board.expect(prompt)
        board.sendline('uci set firewall.@zone[0].input=ACCEPT')
        board.expect(prompt)
        board.sendline('uci set firewall.@zone[0].output=ACCEPT')
        board.expect(prompt)
        board.sendline('uci set firewall.@zone[0].forward=ACCEPT')
        board.expect(prompt)
        board.sendline('uci set firewall.@zone[1]=zone')
        board.expect(prompt)
        board.sendline('uci set firewall.@zone[1].name=wan')
        board.expect(prompt)
        board.sendline('uci set firewall.@zone[1].network=wan')
        board.expect(prompt)
        board.sendline('uci set firewall.@zone[1].output=ACCEPT')
        board.expect(prompt)
        board.sendline('uci set firewall.@zone[1].mtu_fix=1')
        board.expect(prompt)
        board.sendline('uci set firewall.@zone[1].input=ACCEPT')
        board.expect(prompt)
        board.sendline('uci set firewall.@zone[1].forward=ACCEPT')
        board.expect(prompt)
        board.sendline('uci commit')
        board.expect(prompt)
        board.network_restart()
        board.firewall_restart()

        lan.sendline('ifconfig eth1 192.168.0.2')
        lan.expect(prompt)