From 0d770a8b22a5cd59a8321c6f48482c631a626456 Mon Sep 17 00:00:00 2001 From: Jonathan Rosser Date: Sun, 29 Jul 2018 16:50:38 +0100 Subject: [PATCH] Add lxc3 compatibility to tests lxc3 deprecates many legacy config keys [1]. [1] https://discuss.linuxcontainers.org/t/lxc-2-1-has-been-released/487 Depends-On: https://review.openstack.org/#/c/586898 Change-Id: I2947a633ea256460db4f43f7921d20d6dfec5aab --- tests/group_vars/all_containers.yml | 8 ++++++++ tests/test-install-previous-neutron.yml | 3 +-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/group_vars/all_containers.yml b/tests/group_vars/all_containers.yml index 9710edfe..708ad55e 100644 --- a/tests/group_vars/all_containers.yml +++ b/tests/group_vars/all_containers.yml @@ -24,3 +24,11 @@ container_networks: physical_host: localhost properties: service_name: "{{ inventory_hostname }}" + +lxc2_container_config_list: + - 'lxc.aa_profile=unconfined' + +lxc3_container_config_list: + - 'lxc.apparmor.profile=unconfined' + +lxc_container_config_list: "{{ lookup('pipe', 'lxc-info --version || echo 2.0.0') is version_compare('3.0.0', 'lt') | ternary(lxc2_container_config_list, lxc3_container_config_list) }}" diff --git a/tests/test-install-previous-neutron.yml b/tests/test-install-previous-neutron.yml index 663219bf..fd9bd815 100644 --- a/tests/test-install-previous-neutron.yml +++ b/tests/test-install-previous-neutron.yml @@ -27,8 +27,7 @@ - name: Use the unconfined aa profile lxc_container: name: "{{ container_name }}" - container_config: - - "lxc.aa_profile=unconfined" + container_config: "{{ lxc_container_config_list }}" delegate_to: "{{ physical_host }}" - name: Set mount path for kernel modules (Ubuntu)