File: test_ipbatch.py

package info (click to toggle)
pyroute2 0.8.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,700 kB
  • sloc: python: 50,245; makefile: 280; javascript: 183; ansic: 81; sh: 44; awk: 17
file content (17 lines) | stat: -rw-r--r-- 380 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from pr2test.marks import require_root

from pyroute2 import IPBatch

pytestmark = [require_root()]


def test_link_add(context):
    ifname = context.new_ifname

    ipb = IPBatch()
    ipb.link('add', ifname=ifname, kind='dummy')
    data = ipb.batch
    ipb.reset()
    ipb.close()
    context.ipr.sendto(data, (0, 0))
    context.ndb.interfaces.wait(ifname=ifname, timeout=3)