Skip to content

Commit 0e5d57b

Browse files
committed
Refs #22518: Review - Use stop to shutdown server
Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
1 parent 3f477af commit 0e5d57b

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

test/system/tools/fastdds/test_discovery_parser.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def test_parser_shutdown_when_on(self, mock_rpc_stopall, mock_rpc_nbrequest, moc
6565
mock_shutdown.return_value = True
6666
mock_is_running.return_value = True
6767

68-
argv = ['shutdown']
68+
argv = ['stop']
6969
parser = Parser(argv)
7070

7171
mock_is_running.assert_called_once()
@@ -88,7 +88,7 @@ def test_parser_shutdown_when_off(self, mock_rpc_stopall, mock_rpc_nbrequest, mo
8888
mock_shutdown.return_value = False
8989
mock_is_running.return_value = False
9090

91-
argv = ['shutdown']
91+
argv = ['stop']
9292
try:
9393
parser = Parser(argv)
9494
except SystemExit as e:
@@ -299,7 +299,7 @@ def test_parser_stop_when_off(self, mock_rpc_stop_once, mock_rpc_nbrequest, mock
299299
self.check_command = [str(command_to_int[Command.STOP]), '-d', '0']
300300
mock_rpc_brequest.side_effect = self.side_effect_rpc
301301

302-
argv = ['stop']
302+
argv = ['stop', '-d', '0']
303303
try:
304304
parser = Parser(argv)
305305
except SystemExit as e:
@@ -329,7 +329,7 @@ def test_parser_stop_when_on(self, mock_rpc_stop_once, mock_rpc_nbrequest, mock_
329329
self.check_command = [str(command_to_int[Command.STOP]), '-d', '0']
330330
mock_rpc_brequest.side_effect = self.side_effect_rpc
331331

332-
argv = ['stop']
332+
argv = ['stop', '-d', '0']
333333
parser = Parser(argv)
334334

335335
mock_is_running.assert_called_once()

test/system/tools/fds/tests.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ class Command_test(Enum):
6363
SET = "set"
6464
LIST = "list"
6565
INFO = "info"
66-
SHUTDOWN = "shutdown"
6766
UNKNOWN = "unknown"
6867

6968
# This map is used to convert the string command to an integer used in the cpp tool
@@ -75,7 +74,6 @@ class Command_test(Enum):
7574
Command_test.SET: 4,
7675
Command_test.LIST: 5,
7776
Command_test.INFO: 6,
78-
Command_test.SHUTDOWN: 7,
7977
Command_test.SERVER: 42
8078
}
8179

tools/fastdds/discovery/parser.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ class Command(Enum):
5050
SET = "set"
5151
LIST = "list"
5252
INFO = "info"
53-
SHUTDOWN = "shutdown"
5453
UNKNOWN = "unknown"
5554

5655
# This map is used to convert the string command to an integer used in the cpp tool
@@ -62,7 +61,6 @@ class Command(Enum):
6261
Command.SET: 4,
6362
Command.LIST: 5,
6463
Command.INFO: 6,
65-
Command.SHUTDOWN: 7,
6664
Command.SERVER: 42
6765
}
6866

@@ -176,7 +174,8 @@ def __init__(self, argv):
176174
for unknown_arg in unknown_args:
177175
args_for_cpp.append(unknown_arg)
178176

179-
if command_int == command_to_int[Command.SHUTDOWN]:
177+
# Use the 'stop' command without domain to stop all servers and shutdown the daemon
178+
if command_int == command_to_int[Command.STOP] and daemon_args.domain is None:
180179
if not self.__is_daemon_running():
181180
print('The Fast DDS daemon is not running.')
182181
raise SystemExit(0)

0 commit comments

Comments
 (0)