#
# Copyright (c) 2019 PANTHEON.tech.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
import unittest
import util
from framewrok import SweetcombTestCase
class TestIetfInterfaces(SweetcombTestCase):
def setUp(self):
super(TestIetfInterfaces, self).setUp()
self.create_topoly()
def tearDown(self):
super(TestIetfInterfaces, self).setUp()
self.topology.close_topology()
def test_interface_up(self):
self.vpp.show_interface()
self.netopeer_cli.get("/ietf-interfaces:*")
ts = '''
local0
true
host-vpp1
true
'''
self.netopeer_cli.edit_config(ts)
self.netopeer_cli.get("/ietf-interfaces:*")
self.vpp.show_interface()
def test_ip_addr(self):
self.vpp.show_address()
self.netopeer_cli.get("/ietf-interfaces:*")
util.ping('192.168.0.1')
ts = '''
host-vpp1
true
true
192.168.0.1
24
'''
self.netopeer_cli.edit_config(ts)
self.netopeer_cli.get("/ietf-interfaces:*")
self.vpp.show_address()
util.ping('192.168.0.1')