File tree Expand file tree Collapse file tree 3 files changed +38
-10
lines changed
Expand file tree Collapse file tree 3 files changed +38
-10
lines changed Original file line number Diff line number Diff line change 2424ts .Disk .remap_config .AddLine (f"" ) # empty file
2525ts .Disk .records_config .update ({'proxy.config.url_remap.min_rules_required' : 1 })
2626ts .ReturnCode = 33 # expect to Emergency fail due to empty "remap.config".
27- ts .Ready = When . FileContains ( ts . Disk . diags_log . Name , "remap.config failed to load" )
27+ ts .Ready = 0
2828
2929tr = Test .AddTestRun ("test" )
30+
31+ # We have to wait upon TS to emit the expected log message, but it cannot be
32+ # the ts Ready criteria because autest might detect the process going away
33+ # before it detects the log message. So we add a separate process that waits
34+ # upon the log message.
35+ watcher = Test .Processes .Process ("watcher" )
36+ watcher .Command = "sleep 1"
37+ watcher .Ready = When .FileContains (ts .Disk .diags_log .Name , "remap.config failed to load" )
38+ watcher .StartBefore (ts )
39+
3040tr .Processes .Default .Command = "echo howdy"
3141tr .TimeOut = 5
32- tr .Processes .Default .StartBefore (ts )
42+ tr .Processes .Default .StartBefore (watcher )
Original file line number Diff line number Diff line change 4040# Load plugin
4141Test .PrepareTestPlugin (os .path .join (Test .Variables .AtsTestPluginsDir , 'emergency_shutdown.so' ), ts )
4242
43- # www.example.com Host
4443tr = Test .AddTestRun ()
44+
45+ # We have to wait upon TS to emit the expected log message, but it cannot be
46+ # the ts Ready criteria because autest might detect the process going away
47+ # before it detects the log message. So we add a separate process that waits
48+ # upon the log message.
49+ watcher = Test .Processes .Process ("watcher" )
50+ watcher .Command = "sleep 1"
51+ watcher .Ready = When .FileContains (ts .Disk .diags_log .Name , "testing emergency shutdown" )
52+ watcher .StartBefore (ts )
53+
4554tr .Processes .Default .Command = 'printf "Emergency Shutdown Test"'
4655tr .Processes .Default .ReturnCode = 0
47- tr .Processes .Default .StartBefore (ts )
48- tr .Timeout = 5
56+ tr .Processes .Default .StartBefore (watcher )
4957
58+ tr .Timeout = 5
5059ts .ReturnCode = 33
51- ts .Ready = When . FileContains ( ts . Disk . traffic_out . Name , "testing emergency shutdown" )
60+ ts .Ready = 0
5261ts .Disk .traffic_out .Content = Testers .ExcludesExpression ('failed to shutdown' , 'should NOT contain "failed to shutdown"' )
5362ts .Disk .diags_log .Content = Testers .IncludesExpression ('testing emergency shutdown' , 'should contain "testing emergency shutdown"' )
Original file line number Diff line number Diff line change 4040# Load plugin
4141Test .PrepareTestPlugin (os .path .join (Test .Variables .AtsTestPluginsDir , 'fatal_shutdown.so' ), ts )
4242
43- # www.example.com Host
4443tr = Test .AddTestRun ()
44+
45+ # We have to wait upon TS to emit the expected log message, but it cannot be
46+ # the ts Ready criteria because autest might detect the process going away
47+ # before it detects the log message. So we add a separate process that waits
48+ # upon the log message.
49+ watcher = Test .Processes .Process ("watcher" )
50+ watcher .Command = "sleep 1"
51+ watcher .Ready = When .FileContains (ts .Disk .diags_log .Name , "testing fatal shutdown" )
52+ watcher .StartBefore (ts )
53+
4554tr .Processes .Default .Command = 'printf "Fatal Shutdown Test"'
4655tr .Processes .Default .ReturnCode = 0
47- tr .Processes .Default .StartBefore (ts )
48- tr .Timeout = 5
56+ tr .Processes .Default .StartBefore (watcher )
4957
58+ tr .Timeout = 5
5059ts .ReturnCode = 70
51- ts .Ready = When . FileContains ( ts . Disk . traffic_out . Name , "testing fatal shutdown" )
60+ ts .Ready = 0
5261ts .Disk .traffic_out .Content = Testers .ExcludesExpression ('failed to shutdown' , 'should NOT contain "failed to shutdown"' )
5362ts .Disk .diags_log .Content = Testers .IncludesExpression ('testing fatal shutdown' , 'should contain "testing fatal shutdown"' )
You can’t perform that action at this time.
0 commit comments