fix(startup): shut down after server exit
This commit is contained in:
parent
38addf85fd
commit
d7ec0bef1c
@ -1,4 +1,4 @@
|
||||
local _VERSION = '1.3.1'
|
||||
local _VERSION = '1.3.2'
|
||||
|
||||
local LOCAL_MANIFEST_PATH = '/trapos/manifest.json';
|
||||
|
||||
@ -56,3 +56,5 @@ if #SERVERS > 0 then
|
||||
end
|
||||
|
||||
parallel.waitForAll(shellFn, table.unpack(servers));
|
||||
|
||||
os.shutdown();
|
||||
|
||||
@ -5,6 +5,7 @@ local testlib = createLibTest({ ... });
|
||||
local function runStartupWithStubs()
|
||||
local calls = {
|
||||
rebooted = false,
|
||||
shutdown = false,
|
||||
shellRuns = {},
|
||||
prints = {},
|
||||
};
|
||||
@ -19,6 +20,9 @@ local function runStartupWithStubs()
|
||||
reboot = function()
|
||||
calls.rebooted = true;
|
||||
end,
|
||||
shutdown = function()
|
||||
calls.shutdown = true;
|
||||
end,
|
||||
sleep = function() end,
|
||||
},
|
||||
parallel = {
|
||||
@ -54,10 +58,11 @@ local function runStartupWithStubs()
|
||||
return calls;
|
||||
end
|
||||
|
||||
testlib.test('shell exit does not force reboot', function()
|
||||
testlib.test('shell exit shuts down without rebooting', function()
|
||||
local calls = runStartupWithStubs();
|
||||
|
||||
testlib.assertEquals(calls.shellRuns[1], 'shell');
|
||||
testlib.assertEquals(calls.shutdown, true);
|
||||
testlib.assertEquals(calls.rebooted, false);
|
||||
for _, message in ipairs(calls.prints) do
|
||||
testlib.assertTrue(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user