Commit 4736ed35 authored by Spiros Koulouzis's avatar Spiros Koulouzis

changed playbook to save results

parent ad821dc7
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
<h1 class="page-header">Files and Libraries</h1> <h1 class="page-header">Files and Libraries</h1>
<h3 id="artifact_gwt_json_overlay">GWT JSON Overlay</h3> <h3 id="artifact_gwt_json_overlay">GWT JSON Overlay</h3>
<p class="lead">Created March 28, 2017</p> <p class="lead">Created March 31, 2017</p>
<p> <p> <p> <p>
The <a href="http://code.google.com/webtoolkit/">Google Web Toolkit</a> JSON Overlay library provides the JSON Overlays that The <a href="http://code.google.com/webtoolkit/">Google Web Toolkit</a> JSON Overlay library provides the JSON Overlays that
can be used to access the Web service API for this application. can be used to access the Web service API for this application.
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
</tbody> </tbody>
</table> </table>
<h3 id="artifact_java_json_client_library">Java JSON Client Library</h3> <h3 id="artifact_java_json_client_library">Java JSON Client Library</h3>
<p class="lead">Created March 28, 2017</p> <p class="lead">Created March 31, 2017</p>
<p><p> <p><p>
The Java client-side library is used to provide the set of Java objects that can be serialized The Java client-side library is used to provide the set of Java objects that can be serialized
to/from JSON using <a href="http://jackson.codehaus.org/">Jackson</a>. This is useful for accessing the to/from JSON using <a href="http://jackson.codehaus.org/">Jackson</a>. This is useful for accessing the
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
</tbody> </tbody>
</table> </table>
<h3 id="artifact_java_xml_client_library">Java XML Client Library</h3> <h3 id="artifact_java_xml_client_library">Java XML Client Library</h3>
<p class="lead">Created March 28, 2017</p> <p class="lead">Created March 31, 2017</p>
<p><p> <p><p>
The Java client-side library is used to access the Web service API for this application using Java. The Java client-side library is used to access the Web service API for this application using Java.
</p> </p>
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
</tbody> </tbody>
</table> </table>
<h3 id="artifact_js_client_library">JavaScript Client Library</h3> <h3 id="artifact_js_client_library">JavaScript Client Library</h3>
<p class="lead">Created March 28, 2017</p> <p class="lead">Created March 31, 2017</p>
<p><p> <p><p>
The JavaScript client-side library defines classes that can be (de)serialized to/from JSON. The JavaScript client-side library defines classes that can be (de)serialized to/from JSON.
This is useful for accessing the resources that are published by this application, but only This is useful for accessing the resources that are published by this application, but only
...@@ -190,7 +190,7 @@ ...@@ -190,7 +190,7 @@
</tbody> </tbody>
</table> </table>
<h3 id="artifact_php_json_client_library">PHP JSON Client Library</h3> <h3 id="artifact_php_json_client_library">PHP JSON Client Library</h3>
<p class="lead">Created March 28, 2017</p> <p class="lead">Created March 31, 2017</p>
<p><p> <p><p>
The PHP JSON client-side library defines the PHP classes that can be (de)serialized to/from JSON. The PHP JSON client-side library defines the PHP classes that can be (de)serialized to/from JSON.
This is useful for accessing the resources that are published by this application, but only This is useful for accessing the resources that are published by this application, but only
...@@ -219,7 +219,7 @@ ...@@ -219,7 +219,7 @@
</tbody> </tbody>
</table> </table>
<h3 id="artifact_php_xml_client_library">PHP XML Client Library</h3> <h3 id="artifact_php_xml_client_library">PHP XML Client Library</h3>
<p class="lead">Created March 28, 2017</p> <p class="lead">Created March 31, 2017</p>
<p><p> <p><p>
The PHP client-side library defines the PHP classes that can be (de)serialized to/from XML. The PHP client-side library defines the PHP classes that can be (de)serialized to/from XML.
This is useful for accessing the resources that are published by this application, but only This is useful for accessing the resources that are published by this application, but only
...@@ -251,7 +251,7 @@ ...@@ -251,7 +251,7 @@
</tbody> </tbody>
</table> </table>
<h3 id="artifact_ruby_json_client_library">Ruby JSON Client Library</h3> <h3 id="artifact_ruby_json_client_library">Ruby JSON Client Library</h3>
<p class="lead">Created March 28, 2017</p> <p class="lead">Created March 31, 2017</p>
<p><p> <p><p>
The Ruby JSON client-side library defines the Ruby classes that can be (de)serialized to/from JSON. The Ruby JSON client-side library defines the Ruby classes that can be (de)serialized to/from JSON.
This is useful for accessing the REST endpoints that are published by this application, but only This is useful for accessing the REST endpoints that are published by this application, but only
......
...@@ -23,7 +23,7 @@ from results_collector import ResultsCollector ...@@ -23,7 +23,7 @@ from results_collector import ResultsCollector
hosts='172.17.0.2,172.17.0.3,' hosts='172.17.0.2,'
playbook_path = 'playbook.yml' playbook_path = 'playbook.yml'
if not os.path.exists(playbook_path): if not os.path.exists(playbook_path):
print '[ERROR] The playbook does not exist' print '[ERROR] The playbook does not exist'
...@@ -31,7 +31,7 @@ if not os.path.exists(playbook_path): ...@@ -31,7 +31,7 @@ if not os.path.exists(playbook_path):
user='vm_user' user='vm_user'
ssh_key_file='id_ras' ssh_key_file='id_ras'
extra_vars = {'resultslocation':'/tmp/res'} extra_vars = {} #{'resultslocation':'/tmp/res','ansible_sudo_pass':'123'}
variable_manager = VariableManager() variable_manager = VariableManager()
...@@ -63,35 +63,23 @@ results = pbex.run() ...@@ -63,35 +63,23 @@ results = pbex.run()
ok = results_callback.host_ok ok = results_callback.host_ok
count=0; answer = []
for res in ok: for res in ok:
re = json.dumps(res['result']._result) resp = json.dumps({"host":res['ip'], "result":res['result']._result})
++count answer.append({"host":res['ip'], "result":res['result']._result})
target = open("ok"+str(count)+".json", 'w')
target.write(re)
target.close()
print re
count=0;
unreachable = results_callback.host_unreachable unreachable = results_callback.host_unreachable
for res in unreachable: for res in unreachable:
re = json.dumps(res['result']._result) resp = json.dumps({"host":res['ip'], "result":res['result']._result})
++count answer.append({"host":res['ip'], "result":res['result']._result})
target = open("unreachable"+str(count)+".json", 'w')
target.write(re)
target.close()
print re
count=0;
host_failed = results_callback.host_failed host_failed = results_callback.host_failed
for res in host_failed: for res in host_failed:
re = json.dumps(res['result']._result) resp = json.dumps({"host":res['ip'], "result":res['result']._result})
++count answer.append({"host":res['ip'], "result":res['result']._result})
target = open("host_failed"+str(count)+".json", 'w')
target.write(re)
target.close()
print re
print json.dumps(answer,indent=4)
\ No newline at end of file
...@@ -21,6 +21,25 @@ import paramiko, os ...@@ -21,6 +21,25 @@ import paramiko, os
import threading import threading
import ansible.runner import ansible.runner
from results_collector import ResultsCollector from results_collector import ResultsCollector
import json
from collections import namedtuple
from ansible.parsing.dataloader import DataLoader
from ansible.vars import VariableManager
from ansible.inventory import Inventory
from ansible.playbook.play import Play
from ansible.executor.task_queue_manager import TaskQueueManager
import ansible.executor.task_queue_manager
import ansible.inventory
import ansible.parsing.dataloader
import ansible.playbook.play
import ansible.plugins.callback
import ansible.vars
from ansible.executor.playbook_executor import PlaybookExecutor
from ansible.plugins import callback_loader
import logging
import yaml
import sys
def install_prerequisites(vm): def install_prerequisites(vm):
try: try:
...@@ -40,14 +59,65 @@ def install_prerequisites(vm): ...@@ -40,14 +59,65 @@ def install_prerequisites(vm):
ssh.close() ssh.close()
return "SUCCESS" return "SUCCESS"
def run(vm_list,playbook):
ips="" def execute_playbook(hosts, playbook_path,user,ssh_key_file,extra_vars,passwords):
privatekey="" if not os.path.exists(playbook_path):
print '[ERROR] The playbook does not exist'
return '[ERROR] The playbook does not exist'
variable_manager = VariableManager()
loader = DataLoader()
inventory = Inventory(loader=loader, variable_manager=variable_manager, host_list=hosts)
Options = namedtuple('Options', ['listtags', 'listtasks', 'listhosts', 'syntax', 'connection','module_path', 'forks', 'remote_user', 'private_key_file', 'ssh_common_args', 'ssh_extra_args', 'sftp_extra_args', 'scp_extra_args', 'become', 'become_method', 'become_user', 'verbosity', 'check'])
options = Options(listtags=False, listtasks=False, listhosts=False, syntax=False, connection='smart', module_path=None, forks=None, remote_user=user, private_key_file=ssh_key_file, ssh_common_args=None, ssh_extra_args=None, sftp_extra_args=None, scp_extra_args=None, become=True, become_method='sudo', become_user='root', verbosity=None, check=False)
variable_manager.extra_vars = extra_vars
pbex = PlaybookExecutor(playbooks=[playbook_path],
inventory=inventory,
variable_manager=variable_manager,
loader=loader,
options=options,
passwords=passwords,
)
results_callback = ResultsCollector()
pbex._tqm._stdout_callback = results_callback
results = pbex.run()
ok = results_callback.host_ok
answer = []
for res in ok:
resp = json.dumps({"host":res['ip'], "result":res['result']._result})
answer.append({"host":res['ip'], "result":res['result']._result})
unreachable = results_callback.host_unreachable
for res in unreachable:
resp = json.dumps({"host":res['ip'], "result":res['result']._result})
answer.append({"host":res['ip'], "result":res['result']._result})
host_failed = results_callback.host_failed
for res in host_failed:
resp = json.dumps({"host":res['ip'], "result":res['result']._result})
answer.append({"host":res['ip'], "result":res['result']._result})
return json.dumps(answer)
def run(vm_list,playbook_path):
hosts=""
ssh_key_file=""
for vm in vm_list: for vm in vm_list:
ret = install_prerequisites(vm) ret = install_prerequisites(vm)
ips+=vm.ip+"," hosts+=vm.ip+","
privatekey = vm.key ssh_key_file = vm.key
user = vm.user user = vm.user
if "ERROR" in ret: return ret if "ERROR" in ret: return ret
return "SUCCESS" extra_vars = {}
\ No newline at end of file passwords = {}
return execute_playbook(hosts,playbook_path,user,ssh_key_file,extra_vars,passwords)
\ No newline at end of file
#! /bin/bash #! /bin/bash
apt-get update apt-get update
apt-get upgrade apt-get upgrade
apt-get -y install software-properties-common python apt-get -y install software-properties-common python openssh-server sudo
service ssh restart service ssh restart
\ No newline at end of file
{
"host": "172.17.0.2",
"result": {
"_ansible_parsed": false,
"_ansible_no_log": false,
"module_stderr": "Shared connection to 172.17.0.2 closed.\r\n",
"changed": false,
"module_stdout": "/bin/sh: 1: sudo: not found\r\n",
"failed": true,
"invocation": {
"module_name": "setup"
},
"msg": "MODULE FAILURE"
}
}
\ No newline at end of file
[
{
"host": "172.17.0.2",
"result": {
"msg": "All items completed",
"changed": false,
"results": [
{
"_ansible_parsed": true,
"changed": false,
"_ansible_no_log": false,
"cache_updated": true,
"_ansible_item_result": true,
"item": [
"phoronix-test-suite",
"sysbench",
"expect",
"git",
"python-pexpect",
"php-zip"
],
"invocation": {
"module_name": "apt",
"module_args": {
"dpkg_options": "force-confdef,force-confold",
"autoremove": false,
"force": false,
"name": [
"phoronix-test-suite",
"sysbench",
"expect",
"git",
"python-pexpect",
"php-zip"
],
"install_recommends": null,
"package": [
"phoronix-test-suite",
"sysbench",
"expect",
"git",
"python-pexpect",
"php-zip"
],
"purge": false,
"allow_unauthenticated": false,
"state": "latest",
"upgrade": null,
"update_cache": true,
"deb": null,
"only_upgrade": false,
"default_release": null,
"cache_valid_time": 0
}
},
"cache_update_time": 1490964270
}
]
}
},
{
"host": "172.17.0.2",
"result": {
"_ansible_parsed": true,
"changed": true,
"end": "2017-03-31 13:12:05.108373",
"_ansible_no_log": false,
"stdout": "spawn phoronix-test-suite\r\n\r\nPhoronix Test Suite v5.2.1 (Khanino)\r\n\r\nThe Phoronix Test Suite is the most comprehensive testing and benchmarking platform available for Linux, Solaris, Mac OS X, and BSD operating systems. The Phoronix Test Suite allows for carrying out tests in a fully automated manner from test installation to execution and reporting. All tests are meant to be easily reproducible, easy-to-use, and support fully automated execution. The Phoronix Test Suite is open-source under the GNU GPLv3 license and is developed by Phoronix Media in cooperation with partners.\r\n\r\nView the included PDF / HTML documentation or visit http://www.phoronix-test-suite.com/ for full details.\r\n\r\nTEST INSTALLATION\r\n\r\n install [Test | Suite | OpenBenchmarking.org ID | Test Result] ...\r\n install-dependencies [Test | Suite | OpenBenchmarking.org ID | Test Result] ...\r\n make-download-cache\r\n remove-installed-test [Test]\r\n\r\nTESTING\r\n\r\n auto-compare\r\n benchmark [Test | Suite | OpenBenchmarking.org ID | Test Result] ...\r\n finish-run [Test Result]\r\n run [Test | Suite | OpenBenchmarking.org ID | Test Result] ...\r\n run-random-tests\r\n run-tests-in-suite\r\n\r\nBATCH TESTING\r\n\r\n batch-benchmark [Test | Suite | OpenBenchmarking.org ID | Test Result] ...\r\n batch-install [Test | Suite | OpenBenchmarking.org ID | Test Result] ...\r\n batch-run [Test | Suite | OpenBenchmarking.org ID | Test Result] ...\r\n batch-setup\r\n default-benchmark [Test | Suite | OpenBenchmarking.org ID | Test Result] ...\r\n default-run [Test | Suite | OpenBenchmarking.org ID | Test Result] ...\r\n internal-run [Test | Suite | OpenBenchmarking.org ID | Test Result] ...\r\n\r\nOPENBENCHMARKING.ORG\r\n\r\n clone-result [OpenBenchmarking ID] ...\r\n list-recommended-tests\r\n openbenchmarking-changes\r\n openbenchmarking-launcher\r\n openbenchmarking-login\r\n openbenchmarking-refresh\r\n openbenchmarking-repositories\r\n upload-result [Test Result]\r\n upload-test-profile\r\n upload-test-suite\r\n\r\nSYSTEM\r\n\r\n detailed-system-info\r\n diagnostics\r\n interactive\r\n system-info\r\n system-sensors\r\n\r\nINFORMATION\r\n\r\n info [Test | Suite | OpenBenchmarking.org ID | Test Result]\r\n list-available-suites\r\n list-available-tests\r\n list-available-virtual-suites\r\n list-installed-dependencies\r\n list-installed-suites\r\n list-installed-tests\r\n list-missing-dependencies\r\n list-possible-dependencies\r\n list-saved-results\r\n list-test-usage\r\n list-unsupported-tests\r\n\r\nASSET CREATION\r\n\r\n debug-install [Test | Suite | OpenBenchmarking.org ID | Test Result] ...\r\n debug-run [Test | Suite | OpenBenchmarking.org ID | Test Result] ...\r\n debug-test-download-links [Test | Suite]\r\n download-test-files [Test | Suite | OpenBenchmarking.org ID | Test Result] ...\r\n force-install [Test | Suite | OpenBenchmarking.org ID | Test Result] ...\r\n result-file-to-suite [Test Result]\r\n validate-result-file\r\n validate-test-profile\r\n validate-test-suite\r\n\r\nRESULT MANAGEMENT\r\n\r\n auto-sort-result-file [Test Result]\r\n copy-run-in-result-file [Test Result]\r\n edit-result-file [Test Result]\r\n extract-from-result-file [Test Result]\r\n merge-results [Test Result] ...\r\n refresh-graphs [Test Result]\r\n remove-from-result-file [Test Result]\r\n remove-result [Test Result]\r\n rename-identifier-in-result-file [Test Result]\r\n rename-result-file [Test Result]\r\n reorder-result-file [Test Result]\r\n result-file-to-csv [Test Result]\r\n result-file-to-pdf [Test Result]\r\n result-file-to-text [Test Result]\r\n show-result [Test Result]\r\n\r\nRESULT ANALYTICS\r\n\r\n analyze-all-runs [Test Result]\r\n analyze-batch [Test Result]\r\n analyze-image-delta [Test Result]\r\n\r\nOTHER\r\n\r\n build-suite\r\n debug-self-test\r\n help\r\n network-setup\r\n rebuild-composite-xml [Test Result]\r\n user-config-reset\r\n user-config-set\r\n version\r\n\r\nWEB / GUI SUPPORT\r\n\r\n gui\r\n start-remote-gui-server\r\n start-ws-server\r\n\r\nMODULES\r\n\r\n list-modules\r\n module-info [Phoronix Test Suite Module]\r\n module-setup [Phoronix Test Suite Module]\r\n test-module [Phoronix Test Suite Module]\r\n\r\nGUI / WEB SUPPORT\r\n\r\n start-phoromatic-server",
"cmd": [
"expect",
"-c",
"spawn phoronix-test-suite; expect \"Do you agree to these terms and wish to proceed \\(Y/n\\):\"; send \"Y\\n\"; expect \"Enable anonymous usage / statistics reporting \\(Y/n\\):\"; send \"n\\n\"; expect \"Enable anonymous statistical reporting of installed software / hardware \\(Y/n\\):\"; send \"n\\n\"; interact;"
],
"rc": 0,
"start": "2017-03-31 13:12:04.457758",
"stderr": "send: spawn id exp4 not open\n while executing\n\"send \"Y\\n\"\"",
"delta": "0:00:00.650615",
"invocation": {
"module_name": "command",
"module_args": {
"warn": true,
"executable": null,
"_uses_shell": false,
"_raw_params": "expect -c \"spawn phoronix-test-suite; expect \\\"Do you agree to these terms and wish to proceed \\(Y/n\\):\\\"; send \\\"Y\\n\\\"; expect \\\"Enable anonymous usage / statistics reporting \\(Y/n\\):\\\"; send \\\"n\\n\\\"; expect \\\"Enable anonymous statistical reporting of installed software / hardware \\(Y/n\\):\\\"; send \\\"n\\n\\\"; interact;\"",
"removes": null,
"creates": null,
"chdir": null
}
},
"stdout_lines": [
"spawn phoronix-test-suite",
"",
"Phoronix Test Suite v5.2.1 (Khanino)",
"",
"The Phoronix Test Suite is the most comprehensive testing and benchmarking platform available for Linux, Solaris, Mac OS X, and BSD operating systems. The Phoronix Test Suite allows for carrying out tests in a fully automated manner from test installation to execution and reporting. All tests are meant to be easily reproducible, easy-to-use, and support fully automated execution. The Phoronix Test Suite is open-source under the GNU GPLv3 license and is developed by Phoronix Media in cooperation with partners.",
"",
"View the included PDF / HTML documentation or visit http://www.phoronix-test-suite.com/ for full details.",
"",
"TEST INSTALLATION",
"",
" install [Test | Suite | OpenBenchmarking.org ID | Test Result] ...",
" install-dependencies [Test | Suite | OpenBenchmarking.org ID | Test Result] ...",
" make-download-cache",
" remove-installed-test [Test]",
"",
"TESTING",
"",
" auto-compare",
" benchmark [Test | Suite | OpenBenchmarking.org ID | Test Result] ...",
" finish-run [Test Result]",
" run [Test | Suite | OpenBenchmarking.org ID | Test Result] ...",
" run-random-tests",
" run-tests-in-suite",
"",
"BATCH TESTING",
"",
" batch-benchmark [Test | Suite | OpenBenchmarking.org ID | Test Result] ...",
" batch-install [Test | Suite | OpenBenchmarking.org ID | Test Result] ...",
" batch-run [Test | Suite | OpenBenchmarking.org ID | Test Result] ...",
" batch-setup",
" default-benchmark [Test | Suite | OpenBenchmarking.org ID | Test Result] ...",
" default-run [Test | Suite | OpenBenchmarking.org ID | Test Result] ...",
" internal-run [Test | Suite | OpenBenchmarking.org ID | Test Result] ...",
"",
"OPENBENCHMARKING.ORG",
"",
" clone-result [OpenBenchmarking ID] ...",
" list-recommended-tests",
" openbenchmarking-changes",
" openbenchmarking-launcher",
" openbenchmarking-login",
" openbenchmarking-refresh",
" openbenchmarking-repositories",
" upload-result [Test Result]",
" upload-test-profile",
" upload-test-suite",
"",
"SYSTEM",
"",
" detailed-system-info",
" diagnostics",
" interactive",
" system-info",
" system-sensors",
"",
"INFORMATION",
"",
" info [Test | Suite | OpenBenchmarking.org ID | Test Result]",
" list-available-suites",
" list-available-tests",
" list-available-virtual-suites",
" list-installed-dependencies",
" list-installed-suites",
" list-installed-tests",
" list-missing-dependencies",
" list-possible-dependencies",
" list-saved-results",
" list-test-usage",
" list-unsupported-tests",
"",
"ASSET CREATION",
"",
" debug-install [Test | Suite | OpenBenchmarking.org ID | Test Result] ...",
" debug-run [Test | Suite | OpenBenchmarking.org ID | Test Result] ...",
" debug-test-download-links [Test | Suite]",
" download-test-files [Test | Suite | OpenBenchmarking.org ID | Test Result] ...",
" force-install [Test | Suite | OpenBenchmarking.org ID | Test Result] ...",
" result-file-to-suite [Test Result]",
" validate-result-file",
" validate-test-profile",
" validate-test-suite",
"",
"RESULT MANAGEMENT",
"",
" auto-sort-result-file [Test Result]",
" copy-run-in-result-file [Test Result]",
" edit-result-file [Test Result]",
" extract-from-result-file [Test Result]",
" merge-results [Test Result] ...",
" refresh-graphs [Test Result]",
" remove-from-result-file [Test Result]",
" remove-result [Test Result]",
" rename-identifier-in-result-file [Test Result]",
" rename-result-file [Test Result]",
" reorder-result-file [Test Result]",
" result-file-to-csv [Test Result]",
" result-file-to-pdf [Test Result]",
" result-file-to-text [Test Result]",
" show-result [Test Result]",
"",
"RESULT ANALYTICS",
"",
" analyze-all-runs [Test Result]",
" analyze-batch [Test Result]",
" analyze-image-delta [Test Result]",
"",
"OTHER",
"",
" build-suite",
" debug-self-test",
" help",
" network-setup",
" rebuild-composite-xml [Test Result]",
" user-config-reset",
" user-config-set",
" version",
"",
"WEB / GUI SUPPORT",
"",
" gui",
" start-remote-gui-server",
" start-ws-server",
"",
"MODULES",
"",
" list-modules",
" module-info [Phoronix Test Suite Module]",
" module-setup [Phoronix Test Suite Module]",
" test-module [Phoronix Test Suite Module]",
"",
"GUI / WEB SUPPORT",
"",
" start-phoromatic-server"
],
"warnings": []
}
},
{
"host": "172.17.0.2",
"result": {
"_ansible_parsed": true,
"changed": true,
"end": "2017-03-31 13:12:05.975397",
"_ansible_no_log": false,
"stdout": "\nPhoronix Test Suite v5.2.1\n\n Installed: pts/stream-1.3.1",
"cmd": [
"phoronix-test-suite",
"install-test",
"stream"
],
"rc": 0,
"start": "2017-03-31 13:12:05.303164",
"stderr": "",
"delta": "0:00:00.672233",
"invocation": {
"module_name": "command",
"module_args": {
"warn": true,
"executable": null,
"_uses_shell": false,
"_raw_params": "phoronix-test-suite install-test stream",
"removes": null,
"creates": null,
"chdir": null
}
},
"stdout_lines": [
"",
"Phoronix Test Suite v5.2.1",
"",
" Installed: pts/stream-1.3.1"
],
"warnings": []
}
},
{
"host": "172.17.0.2",
"result": {
"_ansible_parsed": true,
"changed": true,
"end": "2017-03-31 13:12:06.776180",
"_ansible_no_log": false,
"stdout": "\nPhoronix Test Suite v5.2.1\n\n Installed: pts/iozone-1.8.0",
"cmd": [
"phoronix-test-suite",
"install-test",
"iozone"
],
"rc": 0,
"start": "2017-03-31 13:12:06.164241",
"stderr": "",
"delta": "0:00:00.611939",
"invocation": {
"module_name": "command",
"module_args": {
"warn": true,
"executable": null,
"_uses_shell": false,
"_raw_params": "phoronix-test-suite install-test iozone",
"removes": null,
"creates": null,
"chdir": null
}
},
"stdout_lines": [
"",
"Phoronix Test Suite v5.2.1",
"",
" Installed: pts/iozone-1.8.0"
],
"warnings": []
}
},
{
"host": "172.17.0.2",
"result": {
"_ansible_parsed": true,
"changed": true,
"end": "2017-03-31 13:12:07.697561",
"_ansible_no_log": false,
"stdout": "spawn phoronix-test-suite run-test stream\r\n\r\n\r\nStream 2013-01-17:\r\n pts/stream-1.3.1\r\n Memory Test Configuration\r\n 1: Copy\r\n 2: Scale\r\n 3: Add\r\n 4: Triad\r\n 5: Test All Options\r\n Type: 4\r\n\r\n\r\nPhoronix Test Suite v5.2.1\r\nSystem Information\r\n\r\nHardware:\r\nProcessor: Intel Core i5-4200U @ 2.60GHz (4 Cores), Motherboard: LENOVO 20AY007PMH, Memory: 8192MB, Disk: 256GB SAMSUNG MZ7TD256\r\n\r\nSoftware:\r\nOS: Ubuntu 16.04, Kernel: 4.4.0-71-generic (x86_64), Compiler: GCC 5.4.0 20160609, File-System: aufs, Screen Resolution: 1600x900, System Layer: docker\r\n\r\n Would you like to save these test results (Y/n): n",
"cmd": [
"expect",
"-c",
"spawn phoronix-test-suite run-test stream; expect \"Type:\"; send \"4\\n\"; expect \"\\(Y/n\\):\"; send \"n\\n\"; interact;"
],
"rc": 0,
"start": "2017-03-31 13:12:06.957754",
"stderr": "",
"delta": "0:00:00.739807",
"invocation": {
"module_name": "command",
"module_args": {
"warn": true,
"executable": null,
"_uses_shell": false,
"_raw_params": "expect -c \"spawn phoronix-test-suite run-test stream; expect \\\"Type:\\\"; send \\\"4\\n\\\"; expect \\\"\\(Y/n\\):\\\"; send \\\"n\\n\\\"; interact;\"",
"removes": null,
"creates": null,
"chdir": null
}
},
"stdout_lines": [
"spawn phoronix-test-suite run-test stream",
"",
"",
"Stream 2013-01-17:",
" pts/stream-1.3.1",
" Memory Test Configuration",
" 1: Copy",
" 2: Scale",
" 3: Add",
" 4: Triad",
" 5: Test All Options",
" Type: 4",
"",
"",
"Phoronix Test Suite v5.2.1",
"System Information",
"",
"Hardware:",
"Processor: Intel Core i5-4200U @ 2.60GHz (4 Cores), Motherboard: LENOVO 20AY007PMH, Memory: 8192MB, Disk: 256GB SAMSUNG MZ7TD256",
"",
"Software:",
"OS: Ubuntu 16.04, Kernel: 4.4.0-71-generic (x86_64), Compiler: GCC 5.4.0 20160609, File-System: aufs, Screen Resolution: 1600x900, System Layer: docker",
"",
" Would you like to save these test results (Y/n): n"
],
"warnings": []
}
},
{
"host": "172.17.0.2",
"result": {
"invocation": {
"module_name": "debug",
"module_args": {
"msg": "spawn phoronix-test-suite run-test stream\r\n\r\n\r\nStream 2013-01-17:\r\n pts/stream-1.3.1\r\n Memory Test Configuration\r\n 1: Copy\r\n 2: Scale\r\n 3: Add\r\n 4: Triad\r\n 5: Test All Options\r\n Type: 4\r\n\r\n\r\nPhoronix Test Suite v5.2.1\r\nSystem Information\r\n\r\nHardware:\r\nProcessor: Intel Core i5-4200U @ 2.60GHz (4 Cores), Motherboard: LENOVO 20AY007PMH, Memory: 8192MB, Disk: 256GB SAMSUNG MZ7TD256\r\n\r\nSoftware:\r\nOS: Ubuntu 16.04, Kernel: 4.4.0-71-generic (x86_64), Compiler: GCC 5.4.0 20160609, File-System: aufs, Screen Resolution: 1600x900, System Layer: docker\r\n\r\n Would you like to save these test results (Y/n): n"
}
},
"msg": "spawn phoronix-test-suite run-test stream\r\n\r\n\r\nStream 2013-01-17:\r\n pts/stream-1.3.1\r\n Memory Test Configuration\r\n 1: Copy\r\n 2: Scale\r\n 3: Add\r\n 4: Triad\r\n 5: Test All Options\r\n Type: 4\r\n\r\n\r\nPhoronix Test Suite v5.2.1\r\nSystem Information\r\n\r\nHardware:\r\nProcessor: Intel Core i5-4200U @ 2.60GHz (4 Cores), Motherboard: LENOVO 20AY007PMH, Memory: 8192MB, Disk: 256GB SAMSUNG MZ7TD256\r\n\r\nSoftware:\r\nOS: Ubuntu 16.04, Kernel: 4.4.0-71-generic (x86_64), Compiler: GCC 5.4.0 20160609, File-System: aufs, Screen Resolution: 1600x900, System Layer: docker\r\n\r\n Would you like to save these test results (Y/n): n",
"changed": false,
"_ansible_verbose_always": true,
"_ansible_no_log": false
}
},
{
"host": "172.17.0.2",
"result": {
"invocation": {
"module_name": "debug",
"module_args": {
"msg": ""
}
},
"msg": "",
"changed": false,
"_ansible_verbose_always": true,
"_ansible_no_log": false
}
}
]
...@@ -25,40 +25,43 @@ ...@@ -25,40 +25,43 @@
become: true become: true
- name: Count vCPU #- name: Count vCPU
command: nproc #command: nproc
register: vcpunumber #register: vcpunumber
become: true #become: true
#- debug: msg="{{ vcpunumber.stdout }}"
- debug: msg="{{ vcpunumber.stdout }}"
- name: Run sysbench #- name: Run sysbench
command: sysbench --test=cpu --cpu-max-prime=100000 --num-threads={{ vcpunumber.stdout }} run #command: sysbench --test=cpu --cpu-max-prime=100000 --num-threads={{ vcpunumber.stdout }} run
register: sysbenchoutput #register: sysbenchoutput
become: true #become: true
#- debug: msg="{{ sysbenchoutput.stdout }}"
- debug: msg="{{ sysbenchoutput.stdout }}" #- local_action: copy content="{{ sysbenchoutput.stdout }}" dest="{{ resultslocation }}sysbench"
- local_action: copy content="{{ sysbenchoutput.stdout }}" dest="{{ resultslocation }}sysbench"
- name: Run stream - name: Run stream
command: expect -c "spawn phoronix-test-suite run-test stream; expect \"Type:\"; send \"4\n\"; expect \"\(Y/n\):\"; send \"n\n\"; interact;" command: expect -c "spawn phoronix-test-suite run-test stream; expect \"Type:\"; send \"4\n\"; expect \"\(Y/n\):\"; send -- \"y\r\"; expect \"Enter a name to save these results under: \"; send -- \"out\r\"; expect \"Enter a unique name to describe this test run / configuration:\"; send -- \"unique\r\"; expect \"New Description:\"; send \"\r\";interact;"
#command: ls -all
register: streamoutput register: streamoutput
become: true become: true
- debug: msg="{{ streamoutput.stdout }}" - debug: msg="{{ streamoutput.stdout }}"
- local_action: copy content="{{ streamoutput.stdout }}" dest="{{ resultslocation }}stream"
- name: Run iozone
command: expect -c "spawn phoronix-test-suite run-test iozone; expect \"Record Size:\"; send \"2\n\"; expect \"File Size:\"; send \"2\n\"; expect \"Disk Test:\"; send \"3\n\"; expect \"\(Y/n\):\"; send \"n\n\"; interact;" - name: Get stream results
register: iozoneoutput command: expect -c ""
register: streamoutput
become: true become: true
- debug: msg="{{ streamoutput.stdout }}"
#- name: Run iozone
#command: expect -c "spawn phoronix-test-suite run-test iozone; expect \"Record Size:\"; send \"2\n\"; expect \"File Size:\"; send \"2\n\"; expect \"Disk Test:\"; send \"3\n\"; expect \"\(Y/n\):\"; send \"n\n\"; interact;"
#register: iozoneoutput
#become: true
- debug: msg="{{ iozoneoutput.stdout }}" #- debug: msg="{{ iozoneoutput.stdout }}"
- local_action: copy content="{{ iozoneoutput.stdout }}" dest="{{ resultslocation }}iozone" #- local_action: copy content="{{ iozoneoutput.stdout }}" dest="{{ resultslocation }}iozone"
{
"host": "172.17.0.3",
"result": {
"msg": "Failed to connect to the host via ssh: ssh: connect to host 172.17.0.3 port 22: No route to host\r\n",
"unreachable": true,
"changed": false
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment