Browse code

Disable apparmor for openSUSE distros

Dnsmasq and haproxy are used frequently by neutron and nova, apparmor
profiles can block some operations and the deployed cloud can't
work properly so some tests are going to fail.

Some openSUSE distros has apparmor enabled by default so we need to
disable it.

Change-Id: I30fda684effb09810643e58bf0b31a73d7d9b378
Signed-off-by: aojeagarcia <aojeagarcia@suse.com>

aojeagarcia authored on 2018/09/24 17:17:16
Showing 1 changed files
... ...
@@ -205,6 +205,19 @@ function fixup_fedora {
205 205
     fi
206 206
 }
207 207
 
208
+function fixup_suse {
209
+    if ! is_suse; then
210
+        return
211
+    fi
212
+
213
+    # Disable apparmor profiles in openSUSE distros
214
+    # to avoid issues with haproxy and dnsmasq
215
+    if [ -x /usr/sbin/aa-enabled ] && sudo /usr/sbin/aa-enabled -q; then
216
+        sudo systemctl disable apparmor
217
+        sudo /usr/sbin/aa-teardown
218
+    fi
219
+}
220
+
208 221
 # The version of pip(1.5.4) supported by python-virtualenv(1.11.4) has
209 222
 # connection issues under proxy so re-install the latest version using
210 223
 # pip. To avoid having pip's virtualenv overwritten by the distro's
... ...
@@ -239,5 +252,6 @@ function fixup_all {
239 239
     fixup_uca
240 240
     fixup_python_packages
241 241
     fixup_fedora
242
+    fixup_suse
242 243
     fixup_virtualenv
243 244
 }