Upgrade autogen to NICs and search types
[csit.git] / resources / libraries / python / autogen / DefaultTestcase.py
1 # Copyright (c) 2018 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 """Module with utilities for autogeneration of non-customizable testcases."""
15
16 from .Testcase import Testcase
17
18
19 class DefaultTestcase(Testcase):
20     """Testcase subclass with a rigid template string."""
21
22     def __init__(self, suite_id):
23         """Construct instance for identified suite.
24
25         :param suite_id: Suite identifier, without NIC prefix and .robot suffix.
26             Example: ethip6srhip6-ip6base-srv6enc2sids-nodecaps-ndrpdr
27         :type suite_id: str
28         """
29         self.suite_id = suite_id
30         template_string = r'''
31 | ${tc_num}-${frame_str}-${cores_str}c-''' + suite_id + r'''
32 | | [Tags] | ${frame_str} | ${cores_str}C
33 | | frame_size=${frame_num} | phy_cores=${cores_num}
34 '''
35         super(DefaultTestcase, self).__init__(template_string)