From 5f92cfbf3791e573964887200f9b5597a3ec8904 Mon Sep 17 00:00:00 2001
From: psklenar <psklenar@masox.brq.redhat.com>
Date: Mar 21 2017 08:55:12 +0000
Subject: [PATCH 1/4] use port 8077


---

diff --git a/examples/haproxy/config.yaml b/examples/haproxy/config.yaml
index d871ece..654243c 100644
--- a/examples/haproxy/config.yaml
+++ b/examples/haproxy/config.yaml
@@ -12,7 +12,7 @@ testdependecies:
         - nc
 module:
     docker:
-        start: "docker run -it -p 80:80 -v $(pwd)/local-haproxy.cfg:/etc/haproxy/haproxy.cfg"
+        start: "docker run -it -p 8077:80 -v $(pwd)/local-haproxy.cfg:/etc/haproxy/haproxy.cfg"
         labels:
             description: "HAProxy is a TCP/HTTP reverse proxy which is particularly suited for high availability environments."
             io.k8s.description: "HAProxy is a TCP/HTTP reverse proxy which is particularly suited for high availability environments."
diff --git a/examples/haproxy/simpleTest.py b/examples/haproxy/simpleTest.py
index 23f0706..72a88ae 100755
--- a/examples/haproxy/simpleTest.py
+++ b/examples/haproxy/simpleTest.py
@@ -24,9 +24,8 @@ class simpleTests(module_framework.AvocadoTest):
         self.runHost('docker rm http_name_8001')
 
     def testAssertIn(self):
-
-        self.runHost('sed s/127.0.0.1/%s/ my-haproxy.cfg > local-haproxy.cfg' % myip, shell=True)
+        self.runHost(('sed s/127.0.0.1/{}/ my-haproxy.cfg > local-haproxy.cfg').format(myip), shell = True)
         self.runHost('chcon -t etc_t local-haproxy.cfg')
         self.start()
-        self.assertIn('It works!',self.runHost('curl localhost:80').stdout)
+        self.assertIn('It works!',self.runHost('curl localhost:8077').stdout)
 

From 3ac8a859b32ae827cee258d977a54b33247b992b Mon Sep 17 00:00:00 2001
From: psklenar <psklenar@masox.brq.redhat.com>
Date: Mar 21 2017 11:59:47 +0000
Subject: [PATCH 2/4] added :z for selinux


---

diff --git a/examples/haproxy/config.yaml b/examples/haproxy/config.yaml
index 654243c..9687b69 100644
--- a/examples/haproxy/config.yaml
+++ b/examples/haproxy/config.yaml
@@ -12,7 +12,7 @@ testdependecies:
         - nc
 module:
     docker:
-        start: "docker run -it -p 8077:80 -v $(pwd)/local-haproxy.cfg:/etc/haproxy/haproxy.cfg"
+        start: "docker run -it -p 8077:80 -v $(pwd)/local-haproxy.cfg:/etc/haproxy/haproxy.cfg:Z"
         labels:
             description: "HAProxy is a TCP/HTTP reverse proxy which is particularly suited for high availability environments."
             io.k8s.description: "HAProxy is a TCP/HTTP reverse proxy which is particularly suited for high availability environments."
diff --git a/examples/haproxy/simpleTest.py b/examples/haproxy/simpleTest.py
index 72a88ae..8eb5e27 100755
--- a/examples/haproxy/simpleTest.py
+++ b/examples/haproxy/simpleTest.py
@@ -25,7 +25,7 @@ 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.runHost('chcon -t etc_t local-haproxy.cfg')
+        #self.runHost('chcon -t etc_t local-haproxy.cfg')
         self.start()
         self.assertIn('It works!',self.runHost('curl localhost:8077').stdout)
 

From 56c4161dbb81e52e1c232f807296f445179ad0ab Mon Sep 17 00:00:00 2001
From: psklenar <psklenar@masox.brq.redhat.com>
Date: Mar 21 2017 12:00:23 +0000
Subject: [PATCH 3/4] added :z for selinux


---

diff --git a/examples/haproxy/simpleTest.py b/examples/haproxy/simpleTest.py
index 8eb5e27..72a88ae 100755
--- a/examples/haproxy/simpleTest.py
+++ b/examples/haproxy/simpleTest.py
@@ -25,7 +25,7 @@ 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.runHost('chcon -t etc_t local-haproxy.cfg')
+        self.runHost('chcon -t etc_t local-haproxy.cfg')
         self.start()
         self.assertIn('It works!',self.runHost('curl localhost:8077').stdout)
 

From dc65cbb07cd670e6f638470edd0d5bd4605e9d39 Mon Sep 17 00:00:00 2001
From: psklenar <psklenar@masox.brq.redhat.com>
Date: Mar 21 2017 12:00:36 +0000
Subject: [PATCH 4/4] added :z for selinux


---

diff --git a/examples/haproxy/simpleTest.py b/examples/haproxy/simpleTest.py
index 72a88ae..1dd51a9 100755
--- a/examples/haproxy/simpleTest.py
+++ b/examples/haproxy/simpleTest.py
@@ -25,7 +25,6 @@ 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.runHost('chcon -t etc_t local-haproxy.cfg')
         self.start()
         self.assertIn('It works!',self.runHost('curl localhost:8077').stdout)
 

