Skip to content
Snippets Groups Projects
Commit 6e513f06 authored by Benjamin Bertrand's avatar Benjamin Bertrand
Browse files

Add tests

parent c560c5e0
No related branches found
No related tags found
No related merge requests found
......@@ -3,20 +3,24 @@ import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("all")
def test_default(host):
cmd = host.run("/usr/local/bin/phoebus -help")
assert cmd.rc == 0
assert " _______ _______ _______ ______ _______ \n" + \
"( ____ )|\\ /|( ___ )( ____ \\( ___ \\ |\\ /|( ____ \\\n" + \
"| ( )|| ) ( || ( ) || ( \\/| ( ) )| ) ( || ( \\/\n" + \
"| (____)|| (___) || | | || (__ | (__/ / | | | || (_____ \n" + \
"| _____)| ___ || | | || __) | __ ( | | | |(_____ )\n" + \
"| ( | ( ) || | | || ( | ( \\ \\ | | | | ) |\n" + \
"| ) | ) ( || (___) || (____/\\| )___) )| (___) |/\\____) |\n" + \
"|/ |/ \\|(_______)(_______/|/ \\___/ (_______)\\_______)" in cmd.stdout
assert (
" _______ _______ _______ ______ _______ \n"
+ "( ____ )|\\ /|( ___ )( ____ \\( ___ \\ |\\ /|( ____ \\\n"
+ "| ( )|| ) ( || ( ) || ( \\/| ( ) )| ) ( || ( \\/\n"
+ "| (____)|| (___) || | | || (__ | (__/ / | | | || (_____ \n"
+ "| _____)| ___ || | | || __) | __ ( | | | |(_____ )\n"
+ "| ( | ( ) || | | || ( | ( \\ \\ | | | | ) |\n"
+ "| ) | ) ( || (___) || (____/\\| )___) )| (___) |/\\____) |\n"
+ "|/ |/ \\|(_______)(_______/|/ \\___/ (_______)\\_______)"
in cmd.stdout
)
def test_settings(host):
......@@ -24,3 +28,15 @@ def test_settings(host):
assert settings.exists
assert settings.is_file
assert settings.contains("org.phoebus.pv.ca/addr_list=127.0.0.1")
def test_opis_repositories(host):
for filename in (
"/usr/local/share/cs-studio/ess-opis/README.md",
"/data/opis-pbi/opis-pbi-systemexpert/README.md",
"/data/opis-pbi/10-Developer/10-ACC/99-PBI/README.md",
"/data/opis-pbi/30-Operator/10-ACC/99-PBI/README.md",
):
assert host.file(filename).exists
cmd = host.run("cd /data/opis-pbi/opis-pbi-systemexpert;git rev-parse HEAD")
assert cmd.stdout.strip() == "1d34327ea88a12fec5e64c38839e038361e0a660"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment