geekoops-pureftpd/molecule/default/tests/test_default.py
Felix Niederwanger 49b3cec463
Fix molecule for Leap 15.4
Fix the molecule test for Leap 15.4
2023-01-30 16:35:30 +01:00

18 lines
470 B
Python
Executable file

#!/usr/bin/python3
# -*- coding: utf-8 -*-
import testinfra.utils.ansible_runner
import os
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_ftp(host):
cmd = host.run("curl -v --fail ftp://127.0.0.1/testfile.txt")
assert cmd.succeeded
assert "Happy test file" in cmd.stdout
cmd = host.run("curl -v --fail ftp://127.0.0.1/secrets.txt")
assert cmd.failed
assert "550" in cmd.stderr