# Path: os_vif/internal/ip/api.py
# LOG = logging.getLogger(__name__)
# 
# Path: os_vif/tests/functional/base.py
# CONF = cfg.CONF
# LOG = logging.getLogger(__name__)
# DEFAULT_LOG_DIR = os.path.join(_get_test_log_path(), 'osvif-functional-logs')
#     COMPONENT_NAME = 'os_vif'
#     PRIVILEGED_GROUP = 'os_vif_privileged'
# def _get_test_log_path():
# def wait_until_true(predicate, timeout=15, sleep=1):
#     def __init__(cls, name, bases, dct):
#     def _catch_timeout(f):
#         def func(self, *args, **kwargs):
# def setup_logging(component_name):
# def sanitize_log_path(path):
#     def setUp(self):
#     def flags(self, **kw):
# class _CatchTimeoutMetaclass(abc.ABCMeta):
# class BaseFunctionalTestCase(base.BaseTestCase,
#                              metaclass=_CatchTimeoutMetaclass):
# 
# Path: os_vif/tests/functional/privsep.py



import os
import re
from oslo_concurrency import processutils
from oslo_utils import excutils
from os_vif.internal.ip.api import ip as ip_lib
from os_vif.tests.functional import base
from os_vif.tests.functional import privsep
                   vlan_id=None):
        if 'vlan' == dev_type:
            _execute_command('ip', 'link', 'add', 'link', link,
                             'name', device, 'type', dev_type, 'vlan', 'id',
                             vlan_id)
        elif 'veth' == dev_type:
            _execute_command('ip', 'link', 'add', device, 'type', dev_type,
                             'peer', 'name', peer)
        elif 'dummy' == dev_type:
            _execute_command('ip', 'link', 'add', device, 'type', dev_type)

    def del_device(self, device):
        if self.exist_device(device):
            _execute_command('ip', 'link', 'del', device)

    def set_status_up(self, device):
        _execute_command('ip', 'link', 'set', device, 'up')

    def set_status_down(self, device):
        _execute_command('ip', 'link', 'set', device, 'down')

    def set_device_mtu(self, device, mtu):
        _execute_command('ip', 'link', 'set', device, 'mtu', mtu)

    def show_device(self, device):
        val, err = _execute_command('ip', 'link', 'show', device)
        return val.splitlines()

    def exist_device(self, device):
        try:

# Path: os_vif/internal/ip/api.py
# LOG = logging.getLogger(__name__)
# 
# Path: os_vif/tests/functional/base.py
# CONF = cfg.CONF
# LOG = logging.getLogger(__name__)
# DEFAULT_LOG_DIR = os.path.join(_get_test_log_path(), 'osvif-functional-logs')
#     COMPONENT_NAME = 'os_vif'
#     PRIVILEGED_GROUP = 'os_vif_privileged'
# def _get_test_log_path():
# def wait_until_true(predicate, timeout=15, sleep=1):
#     def __init__(cls, name, bases, dct):
#     def _catch_timeout(f):
#         def func(self, *args, **kwargs):
# def setup_logging(component_name):
# def sanitize_log_path(path):
#     def setUp(self):
#     def flags(self, **kw):
# class _CatchTimeoutMetaclass(abc.ABCMeta):
# class BaseFunctionalTestCase(base.BaseTestCase,
#                              metaclass=_CatchTimeoutMetaclass):
# 
# Path: os_vif/tests/functional/privsep.py



# Path: os_vif/tests/functional/internal/command/ip/test_impl_pyroute2.py
import os
import re
from oslo_concurrency import processutils
from oslo_utils import excutils
from os_vif.internal.ip.api import ip as ip_lib
from os_vif.tests.functional import base
from os_vif.tests.functional import privsep

                   vlan_id=None):
        if 'vlan' == dev_type:
            _execute_command('ip', 'link', 'add', 'link', link,
                             'name', device, 'type', dev_type, 'vlan', 'id',
                             vlan_id)
        elif 'veth' == dev_type:
            _execute_command('ip', 'link', 'add', device, 'type', dev_type,
                             'peer', 'name', peer)
        elif 'dummy' == dev_type:
            _execute_command('ip', 'link', 'add', device, 'type', dev_type)

    def del_device(self, device):
        if self.exist_device(device):
            _execute_command('ip', 'link', 'del', device)

    def set_status_up(self, device):
        _execute_command('ip', 'link', 'set', device, 'up')

    def set_status_down(self, device):
        _execute_command('ip', 'link', 'set', device, 'down')

    def set_device_mtu(self, device, mtu):
        _execute_command('ip', 'link', 'set', device, 'mtu', mtu)

    def show_device(self, device):
        val, err = _execute_command('ip', 'link', 'show', device)
        return val.splitlines()

    def exist_device(self, device):
        try:

            _execute_command('ip', 'link', 'show', device)