コード例 #1
0
ファイル: test_api.py プロジェクト: vincentbernat/Kitero
    def setUp(self):
        r = Router.load(yaml.load("""
clients: eth0
interfaces:
  eth1:
    name: LAN
    description: "My first interface"
    qos:
      - qos1
      - qos2
  eth2:
    name: WAN
    description: "My second interface"
    password: 1234
    qos:
      - qos1
qos:
  qos1:
    name: 100M
    description: "My first QoS"
    bandwidth: 100mbps
    netem: delay 100ms 10ms distribution experimental
  qos2:
    name: 10M
    description: "My second QoS"
    bandwidth: 10mbps
    netem: delay 200ms 10ms
"""))
        self.service = Service({}, r) # helper
        configure(app, dict(web=dict(expire=2)))
        self.app = app.test_client() # web
        time.sleep(0.1)
コード例 #2
0
 def realSetup(self):
     self.router = Router.load(self.config)
     # Start the service in a separate process
     self.service = Service(
         dict(helper=dict(save=os.path.join(self.temp, "save.pickle"))),
         self.router)
     time.sleep(0.2)  # Safety
コード例 #3
0
 def setUp(self):
     r = Router.load({'clients': 'eth0'})
     # Start the service
     self.service = Service({}, r)
     time.sleep(0.2)  # Safety
     # Configure app
     configure(app)
コード例 #4
0
    def setUp(self):
        r = Router.load(
            yaml.load("""
clients: eth0
interfaces:
  eth1:
    name: LAN
    description: "My first interface"
    qos:
      - qos1
      - qos2
  eth2:
    name: WAN
    description: "My second interface"
    qos:
      - qos1
      - qos3
qos:
  qos1:
    name: 100M
    description: "My first QoS"
    bandwidth: 100mbps
    netem: delay 100ms 10ms distribution experimental
  qos2:
    name: 10M
    description: "My second QoS"
    bandwidth: 10mbps
    netem: delay 200ms 10ms
  qos3:
    name: 1M
    description: "My third QoS"
    bandwidth: 1mbps
    netem: delay 500ms 30ms
"""))
        # Start the service in a separate process
        self.service = Service({}, r)
        time.sleep(0.2)  # Safety