Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not use ros2cli daemon in generate_policy tests. #212

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions sros2/test/sros2/commands/security/verbs/test_generate_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ def test_generate_policy_topics():

# Generate the policy for the running node
assert cli.main(
argv=['security', 'generate_policy', os.path.join(tmpdir, 'test-policy.xml')]) == 0
argv=['security',
'generate_policy',
'--no-daemon',
'--spin-time', '1',
os.path.join(tmpdir, 'test-policy.xml')]) == 0
finally:
node.destroy_node()
rclpy.shutdown(context=context)
Expand Down Expand Up @@ -94,7 +98,11 @@ def test_generate_policy_services():

# Generate the policy for the running node
assert cli.main(
argv=['security', 'generate_policy', os.path.join(tmpdir, 'test-policy.xml')]) == 0
argv=['security',
'generate_policy',
'--no-daemon',
'--spin-time', '1',
os.path.join(tmpdir, 'test-policy.xml')]) == 0
finally:
node.destroy_node()
rclpy.shutdown(context=context)
Expand Down Expand Up @@ -131,7 +139,10 @@ def test_generate_policy_services():
def test_generate_policy_no_nodes(capsys):
with tempfile.TemporaryDirectory() as tmpdir:
assert cli.main(argv=[
'security', 'generate_policy', os.path.join(tmpdir, 'test-policy.xml')]) != 0
'security',
'generate_policy',
'--no-daemon',
os.path.join(tmpdir, 'test-policy.xml')]) != 0
stderr = capsys.readouterr().err.strip()
assert stderr == 'No nodes detected in the ROS graph. No policy file was generated.'

Expand Down