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

Fixes #13291: Add a ncf_test scenario to rtf #129

Conversation

Fdall
Copy link
Contributor

@Fdall Fdall commented Aug 24, 2018

@Fdall Fdall force-pushed the ust_13291/add_a_ncf_test_scenario_to_rtf branch from ff3c235 to b0c8bdf Compare August 24, 2018 15:36
@Fdall
Copy link
Contributor Author

Fdall commented Aug 24, 2018

Commit modified

@Fdall Fdall force-pushed the ust_13291/add_a_ncf_test_scenario_to_rtf branch from b0c8bdf to a5c16b8 Compare August 24, 2018 15:39
@Fdall
Copy link
Contributor Author

Fdall commented Aug 24, 2018

Commit modified

@Fdall Fdall force-pushed the ust_13291/add_a_ncf_test_scenario_to_rtf branch from a5c16b8 to bb6182f Compare August 24, 2018 15:46
@Fdall
Copy link
Contributor Author

Fdall commented Aug 24, 2018

Commit modified

@Fdall Fdall force-pushed the ust_13291/add_a_ncf_test_scenario_to_rtf branch from bb6182f to 8c7f3f9 Compare August 24, 2018 15:51
@Fdall
Copy link
Contributor Author

Fdall commented Aug 24, 2018

Commit modified

@Fdall Fdall force-pushed the ust_13291/add_a_ncf_test_scenario_to_rtf branch from 8c7f3f9 to 9d3cf00 Compare August 24, 2018 15:57
@Fdall
Copy link
Contributor Author

Fdall commented Aug 24, 2018

Commit modified

rtf
@@ -802,8 +799,10 @@ class Platform:
rudder_url = host.get_url()
token = host.run('cat /root/rudder-token')
if rudder_url is None or token is None:
print("This platform has no rudder server, can't run this command")
exit(2)
rudder_url = ''
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests are done on single agent, there are no server deployed.

@Fdall Fdall force-pushed the ust_13291/add_a_ncf_test_scenario_to_rtf branch from 9d3cf00 to d79b3e6 Compare August 24, 2018 16:05
@Fdall
Copy link
Contributor Author

Fdall commented Aug 24, 2018

Commit modified

@Fdall
Copy link
Contributor Author

Fdall commented Aug 24, 2018

I also corrected lot of syntax typos. We are still missing a mechanism to destroy the machine if it fails for
an unknow reasons. This should only be effective when using the ncf_tests.

@Fdall Fdall force-pushed the ust_13291/add_a_ncf_test_scenario_to_rtf branch from d79b3e6 to c89a803 Compare August 27, 2018 11:56
@Fdall
Copy link
Contributor Author

Fdall commented Aug 27, 2018

Commit modified

rtf
""" Run a scenario on this platform """
# test ruby binary
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a try/catch to destroy the vm if an error occured while running the scenario

rtf
process = Popen(command, shell=True, universal_newlines=True)
else:
process = Popen(command, stdout=PIPE, shell=True, universal_newlines=True)
output, error = process.communicate()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this won't work when you have no pipe at all

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is working, doc says it returns None if no stdout are scpecified, which is fine here since we want the output to be print to the shell and not captured by python.https://docs.python.org/2/library/subprocess.html#subprocess.Popen.communicate

rtf Outdated
return "https://" + adress.group(1) + "/rudder"
command = "vagrant ssh-config " + self.platform + "_" + aws.group(1)
process = Popen(command, stdout=PIPE, shell=True, universal_newlines=True)
output, error = process.communicate()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a candidate for a call to the shell() function

@Fdall Fdall force-pushed the ust_13291/add_a_ncf_test_scenario_to_rtf branch from c89a803 to e33511d Compare August 28, 2018 14:35
@Fdall
Copy link
Contributor Author

Fdall commented Aug 28, 2018

Commit modified

@Normation-Quality-Assistant

OK, merging this PR

@Normation-Rudder-Jenkins Normation-Rudder-Jenkins merged commit e33511d into Normation:master Aug 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants