Statistics
| Branch: | Revision:

wcn_emulator / Test / test_disabledefaultroutes.py @ 2a8b9496

History | View | Annotate | Download (1.16 KB)

1
from time import time
2
import os
3

    
4
from test_generic import MininetTest
5

    
6

    
7
def test_disable_default_routes():
8
    os.system("sudo rm -rf pingTestNoRoutes_toy*")
9
    os.system("sudo ./nepa_test.py -f conf/ping.ini -t pingTestNoRoutes")
10
    for f in os.listdir("."):
11
        if f.startswith("pingTestNoRoutes_toy"):
12
            for log in os.listdir(f):
13
                if log.endswith(".log") and not log.startswith("h1"):
14
                    with open(f + "/" + log, "r") as log_file:
15
                        content = log_file.read()
16
                        assert(content.find("bytes from") == -1) 
17
    os.system("sudo rm -rf pingTestNoRoutes_toy*")
18

    
19

    
20
def test_enable_default_routes():
21
    os.system("sudo rm -rf pingTest_toy*")
22
    os.system("sudo ./nepa_test.py -f conf/ping.ini -t pingTest")
23
    for f in os.listdir("."):
24
        if f.startswith("pingTest_toy"):
25
            for log in os.listdir(f):
26
                if log.endswith(".log"):
27
                    with open(f + "/" + log, "r") as log_file:
28
                        content = log_file.read()
29
                        assert(content.find("Destination Host Unreachable") == -1) 
30
    os.system("sudo rm -rf pingTest_toy*")