qa: shut down the daemon via the JSONRPC interface at teardown
This commit is contained in:
parent
726209cc0a
commit
eeac67dc0a
@ -101,6 +101,7 @@ fn connection_handler(
|
||||
let req_id = req.id.clone();
|
||||
if &req.method == "stop" {
|
||||
shutdown.store(true, atomic::Ordering::Relaxed);
|
||||
log::info!("Stopping the minisafe daemon.");
|
||||
}
|
||||
|
||||
log::trace!("JSONRPC request: {:?}", serde_json::to_string(&req));
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import logging
|
||||
import os
|
||||
|
||||
from test_framework.utils import (
|
||||
@ -52,6 +53,14 @@ class Minisafed(TailableProc):
|
||||
)
|
||||
|
||||
def stop(self, timeout=5):
|
||||
try:
|
||||
self.rpc.stop()
|
||||
self.wait_for_log(
|
||||
"Stopping the minisafe daemon.",
|
||||
)
|
||||
self.proc.wait(timeout)
|
||||
except Exception as e:
|
||||
logging.error(f"{self.prefix} : error when calling stop: '{e}'")
|
||||
return TailableProc.stop(self)
|
||||
|
||||
def cleanup(self):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user