csit-func-tc-naming-change - phase 1
[csit.git] / tests / func / tap / api-crud-tap-func.robot
1 # Copyright (c) 2016 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 *** Settings ***
15 | Resource | resources/libraries/robot/default.robot
16 | Resource | resources/libraries/robot/ipv4.robot
17 | Resource | resources/libraries/robot/ipv6.robot
18 | Resource | resources/libraries/robot/interfaces.robot
19 | Resource | resources/libraries/robot/bridge_domain.robot
20 | Resource | resources/libraries/robot/testing_path.robot
21 | Resource | resources/libraries/robot/traffic.robot
22 | Library  | resources.libraries.python.Trace
23 | Library  | resources.libraries.python.Tap
24 | Library  | resources.libraries.python.Namespaces
25 | Library  | resources.libraries.python.IPUtil
26 | Force Tags | HW_ENV | VM_ENV | 3_NODE_DOUBLE_LINK_TOPO
27 | Test Setup | Run Keywords | Func Test Setup
28 | ...        | AND          | Clean Up Namespaces | ${nodes['DUT1']}
29 | Test Teardown | Run Keywords | Func Test Teardown
30 | ...           | AND          | Clean Up Namespaces | ${nodes['DUT1']}
31 | Documentation | *Tap Interface CRUD Tests*
32 | ... | *[Top] Network Topologies:* TG=DUT1 2-node topology with two links
33 | ... | between nodes.
34 | ... | *[Enc] Packet Encapsulations:* No packet sent.
35 | ... | *[Cfg] DUT configuration:* Add/Modify/Delete linux-TAP on DUT1.
36 | ... | *[Ver] Verification:* Check dump of tap interfaces for correctness.
37 | ... | *[Ref] Applicable standard specifications:*
38
39 *** Variables ***
40 | ${tap_int1}= | tap_int1
41 | ${tap_int2}= | tap_int2
42 | ${mod_tap_name}= | tap_int1MOD
43
44 *** Test Cases ***
45 | TC01: Tap Interface Modify And Delete
46 | | [Documentation]
47 | | ... | [Top] TG-DUT1-TG.
48 | | ... | [Enc] Eth-IPv4-ICMPv4.
49 | | ... | [Cfg] Set two TAP interfaces.
50 | | ... | [Ver] Verify that TAP interface can be modified, deleted, and no other
51 | | ... | TAP interface is affected.
52 | | Given Path for 2-node testing is set | ${nodes['TG']} | ${nodes['DUT1']}
53 | | ... | ${nodes['TG']}
54 | | And Interfaces in 2-node path are up
55 | | ${int1}= | And Add Tap Interface | ${dut_node} | ${tap_int1}
56 | | ${int2}= | And Add Tap Interface | ${dut_node} | ${tap_int2}
57 | | And Set Interface State | ${dut_node} | ${int1} | up
58 | | And Set Interface State | ${dut_node} | ${int2} | up
59 | | When Modify Tap Interface | ${dut_node} | ${int1} | ${mod_tap_name}
60 | | Then Check Tap Present | ${dut_node} | ${mod_tap_name}
61 | | When Delete Tap Interface | ${dut_node} | ${int1}
62 | | Then Run Keyword And Expect Error
63 | | ... | Tap interface :${mod_tap_name} does not exist
64 | | ... | Check Tap Present | ${dut_node} | ${mod_tap_name}
65 | | And Check Tap Present | ${dut_node} | ${tap_int2}
66 | | When Delete Tap Interface | ${dut_node} | ${int2}
67 | | Then Run Keyword And Expect Error
68 | | ... | ValueError: No JSON object could be decoded
69 | | ... | Check Tap Present | ${dut_node} | ${tap_int2}