@@ -98,6 +98,110 @@ def execute(self) -> bool:
98
98
return super ().execute ()
99
99
100
100
101
+ class EndToEndTestJobOnWindows (BaseWindowsJob ):
102
+
103
+ def __init__ (self , config , job_name : str ):
104
+ self .job_name = job_name
105
+ self .all_pass = config ["all_pass" ]
106
+ super ().__init__ (config , job_name )
107
+
108
+ def execute (self , server_cmd : str , client_cmd : str ) -> bool :
109
+ serverTask : RunOnWindows = RunOnWindows (
110
+ super ().server (), super ().repository (), server_cmd , super ().is_debug (), super ().is_sudo (), super ().config_path ())
111
+ jobs : dict [str , subprocess .Popen [str ]] = {}
112
+ jobs [self .job_name + "-server-" +
113
+ super ().server ()] = serverTask .execute ()
114
+ time .sleep (super ().delay ())
115
+ clientTask : RunOnWindows = RunOnWindows (
116
+ super ().client (), super ().repository (), client_cmd , super ().is_debug (), super ().is_sudo (), super ().config_path ())
117
+ jobs [self .job_name + "-client-" +
118
+ super ().client ()] = clientTask .execute ()
119
+ return wait_and_report (self .job_name , super ().log_directory (), jobs , self .all_pass )
120
+
121
+
122
+ class SystemTestJobOnWindows (EndToEndTestJobOnWindows ):
123
+ def __init__ (self , config : dict ):
124
+ self .test_name = config ["test_name" ]
125
+ self .server_args = config ["server_args" ]
126
+ self .client_args = config ["client_args" ]
127
+ super ().__init__ (config , f"system-test-{ config ['test_alias' ]} " )
128
+
129
+ def execute (self ) -> bool :
130
+ server_cmd : str = f"test-system-rust LIBOS={ super ().libos ()} TEST={ self .test_name } ARGS=\\ '{ self .server_args } \\ '"
131
+ client_cmd : str = f"test-system-rust LIBOS={ super ().libos ()} TEST={ self .test_name } ARGS=\\ '{ self .client_args } \\ '"
132
+ return super ().execute (server_cmd , client_cmd )
133
+
134
+
135
+ class TcpCloseTest (SystemTestJobOnWindows ):
136
+ def __init__ (self , config : dict , run_mode : str , who_closes : str , nclients : int ):
137
+ config ["test_name" ] = "tcp-close"
138
+ config ["test_alias" ] = f"tcp-close-{ run_mode } -{ who_closes } -closes-sockets"
139
+ config ["all_pass" ] = True
140
+ config ["server_args" ] = f"--peer server --address { config ['server_addr' ]} :12345 --nclients { nclients } --run-mode { run_mode } --whocloses { who_closes } "
141
+ config ["client_args" ] = f"--peer client --address { config ['server_addr' ]} :12345 --nclients { nclients } --run-mode { run_mode } --whocloses { who_closes } "
142
+ super ().__init__ (config )
143
+
144
+
145
+ class TcpEchoTest (SystemTestJobOnWindows ):
146
+ def __init__ (self , config : dict , run_mode : str , nclients : int , bufsize : int , nrequests : int , nthreads : int ):
147
+ config ["test_name" ] = "tcp-echo"
148
+ config ["test_alias" ] = f"tcp-echo-{ run_mode } -{ nclients } -{ bufsize } -{ nrequests } -{ nthreads } "
149
+ config ["all_pass" ] = True
150
+ config ["server_args" ] = f"--peer server --address { config ['server_addr' ]} :12345 --nthreads { nthreads } "
151
+ config ["client_args" ] = f"--peer client --address { config ['server_addr' ]} :12345 --nclients { nclients } --nrequests { nrequests } --bufsize { bufsize } --run-mode { run_mode } "
152
+ super ().__init__ (config )
153
+
154
+
155
+ class TcpPingPongTest (SystemTestJobOnWindows ):
156
+ def __init__ (self , config : dict ):
157
+ config ["test_name" ] = "tcp-ping-pong"
158
+ config ["test_alias" ] = "tcp-ping-pong"
159
+ config ["all_pass" ] = True
160
+ config ["server_args" ] = f"--server { config ['server_addr' ]} :12345"
161
+ config ["client_args" ] = f"--client { config ['server_addr' ]} :12345"
162
+ super ().__init__ (config )
163
+
164
+
165
+ class TcpPushPopTest (SystemTestJobOnWindows ):
166
+ def __init__ (self , config : dict ):
167
+ config ["test_name" ] = "tcp-push-pop"
168
+ config ["test_alias" ] = "tcp-push-pop"
169
+ config ["all_pass" ] = True
170
+ config ["server_args" ] = f"--server { config ['server_addr' ]} :12345"
171
+ config ["client_args" ] = f"--client { config ['server_addr' ]} :12345"
172
+ super ().__init__ (config )
173
+
174
+
175
+ class TcpWaitTest (SystemTestJobOnWindows ):
176
+ def __init__ (self , config : dict , scenario : str , nclients : int ):
177
+ config ["test_name" ] = "tcp-wait"
178
+ config ["test_alias" ] = f"tcp-wait-scenario-{ scenario } "
179
+ config ["all_pass" ] = True
180
+ config ["server_args" ] = f"--peer server --address { config ['server_addr' ]} :12345 --nclients { nclients } --scenario { scenario } "
181
+ config ["client_args" ] = f"--peer client --address { config ['server_addr' ]} :12345 --nclients { nclients } --scenario { scenario } "
182
+ super ().__init__ (config )
183
+
184
+
185
+ class UdpPingPongTest (SystemTestJobOnWindows ):
186
+ def __init__ (self , config : dict ):
187
+ config ["test_name" ] = "udp-ping-pong"
188
+ config ["test_alias" ] = "udp-ping-pong"
189
+ config ["all_pass" ] = False
190
+ config ["server_args" ] = f"--server { config ['server_addr' ]} :12345 { config ['client_addr' ]} :23456"
191
+ config ["client_args" ] = f"--client { config ['client_addr' ]} :23456 { config ['server_addr' ]} :12345"
192
+ super ().__init__ (config )
193
+
194
+
195
+ class UdpPushPopTest (SystemTestJobOnWindows ):
196
+ def __init__ (self , config : dict ):
197
+ config ["test_name" ] = "udp-push-pop"
198
+ config ["test_alias" ] = "udp-push-pop"
199
+ config ["all_pass" ] = True
200
+ config ["server_args" ] = f"--server { config ['server_addr' ]} :12345 { config ['client_addr' ]} :23456"
201
+ config ["client_args" ] = f"--client { config ['client_addr' ]} :23456 { config ['server_addr' ]} :12345"
202
+ super ().__init__ (config )
203
+
204
+
101
205
class IntegrationTestJobOnWindows (BaseWindowsJob ):
102
206
def __init__ (self , config : dict , name : str ):
103
207
super ().__init__ (config , name )
0 commit comments