@@ -47,6 +47,15 @@ def create_testcases(self):
47
47
#below creates a loop over the CRC_count_Check Class using dev as the iterator
48
48
aetest .loop .mark (CRC_count_Check , dev = self .parent .parameters ['dev' ])
49
49
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
50
59
class CRC_count_Check (aetest .Testcase ):
51
60
@aetest .setup
52
61
def setup (self , dev ):
@@ -96,6 +105,8 @@ def setup(self, dev):
96
105
97
106
aetest .loop .mark (self .interface_check , intf = list_of_interfaces )
98
107
108
+ # create table and display. Test fails if variable 'passing' = 1.
109
+ # which means there are some CRC errors
99
110
@aetest .test
100
111
def table_display (self ):
101
112
log .info (tabulate (self .parent .parameters ['megatable' ],
@@ -109,6 +120,7 @@ def table_display(self):
109
120
else :
110
121
self .passed
111
122
123
+ # Test created for each interface. If CRC errors then Interface test will fail
112
124
@aetest .test
113
125
def interface_check (self , intf ):
114
126
# This test has been marked for loop. intf is the looping argument (list of interfaces)
@@ -120,3 +132,29 @@ def interface_check(self, intf):
120
132
self .passed (f'No errors on { int } ' )
121
133
122
134
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