Skip to content

Commit 21035f6

Browse files
author
simon
committed
Each Interface individual test, looping over testcases
1 parent 468b786 commit 21035f6

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

crc_errors/CRC_Count_check.py

+38
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,15 @@ def create_testcases(self):
4747
#below creates a loop over the CRC_count_Check Class using dev as the iterator
4848
aetest.loop.mark(CRC_count_Check, dev=self.parent.parameters['dev'])
4949

50+
51+
52+
###################################################################
53+
# TESTCASES SECTION #
54+
###################################################################
55+
56+
#Capture Interfaces statistics on the device and tabulate
57+
#Also look for CRC Errors. If CRC Errors fail then change
58+
#variable 'passing' from 0 to 1
5059
class CRC_count_Check(aetest.Testcase):
5160
@aetest.setup
5261
def setup(self, dev):
@@ -96,6 +105,8 @@ def setup(self, dev):
96105

97106
aetest.loop.mark(self.interface_check, intf=list_of_interfaces)
98107

108+
# create table and display. Test fails if variable 'passing' = 1.
109+
# which means there are some CRC errors
99110
@aetest.test
100111
def table_display(self):
101112
log.info(tabulate(self.parent.parameters['megatable'],
@@ -109,6 +120,7 @@ def table_display(self):
109120
else:
110121
self.passed
111122

123+
# Test created for each interface. If CRC errors then Interface test will fail
112124
@aetest.test
113125
def interface_check(self, intf):
114126
# This test has been marked for loop. intf is the looping argument (list of interfaces)
@@ -120,3 +132,29 @@ def interface_check(self, intf):
120132
self.passed(f'No errors on {int}')
121133

122134

135+
# #####################################################################
136+
# #### COMMON CLEANUP SECTION ###
137+
# #####################################################################
138+
139+
140+
# This is how to create a CommonCleanup
141+
# You can have 0 , or 1 CommonCleanup.
142+
# CommonCleanup can be named whatever you want :)
143+
class common_cleanup(aetest.CommonCleanup):
144+
""" Common Cleanup for Sample Test """
145+
146+
# CommonCleanup follow exactly the same rule as CommonSetup regarding
147+
# subsection
148+
# You can have 1 to as many subsections as wanted
149+
# here is an example of 1 subsection
150+
151+
@aetest.subsection
152+
153+
def disconnect(self):
154+
log.info("Aetest Common Cleanup disconnecting devices")
155+
for dev in self.parent.parameters['dev']:
156+
dev.disconnect()
157+
158+
159+
if __name__ == '__main__': # pragma: no cover
160+
aetest.main()

0 commit comments

Comments
 (0)