From f6b98279a1b68ec500b7f598cc0d57aed8335a89 Mon Sep 17 00:00:00 2001 From: psklenar Date: Mar 23 2017 09:34:23 +0000 Subject: added setup and test for rpm module for haproxy --- diff --git a/examples/haproxy/config.yaml b/examples/haproxy/config.yaml index 9687b69..4801984 100644 --- a/examples/haproxy/config.yaml +++ b/examples/haproxy/config.yaml @@ -19,7 +19,13 @@ module: source: https://github.com/container-images/haproxy container: docker.io/modularitycontainers/haproxy rpm: - start: systemctl start haproxy + start: sed -i 's/bind\*/bind :8077/' $(pwd)/local-haproxy.cfg; + cp $(pwd)/local-haproxy.cfg /etc/haproxy/haproxy.cfg; + semanage port -a -t http_port_t -p tcp 8001; + semanage port -a -t http_port_t -p tcp 8000; + semanage port -a -t http_port_t -p tcp 8077; + sleep 4; + systemctl start haproxy stop: systemctl stop haproxy status: systemctl status haproxy repos: diff --git a/examples/haproxy/simpleTest.py b/examples/haproxy/simpleTest.py index 1dd51a9..39ac593 100755 --- a/examples/haproxy/simpleTest.py +++ b/examples/haproxy/simpleTest.py @@ -26,5 +26,5 @@ class simpleTests(module_framework.AvocadoTest): def testAssertIn(self): self.runHost(('sed s/127.0.0.1/{}/ my-haproxy.cfg > local-haproxy.cfg').format(myip), shell = True) self.start() - self.assertIn('It works!',self.runHost('curl localhost:8077').stdout) + self.assertIn('It works!',self.runHost('curl localhost:8077', shell = True).stdout)