From ef839a7bbc871399c3a8156eba1c170a0a7124ed Mon Sep 17 00:00:00 2001 From: Chris Evich Date: Wed, 20 Sep 2017 17:34:01 -0400 Subject: [PATCH 1/2] integration-playbook: Don't re-swap If the playbook is run multiple times, it can result in the in-use swap file being truncated. A decidedly bad thing that can be avoided by checking for it's existence first. Signed-off-by: Chris Evich --- contrib/test/crio-integration-playbook.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/test/crio-integration-playbook.yaml b/contrib/test/crio-integration-playbook.yaml index 44441bb0..7369a024 100644 --- a/contrib/test/crio-integration-playbook.yaml +++ b/contrib/test/crio-integration-playbook.yaml @@ -84,11 +84,12 @@ when: ansible_distribution == 'Fedora' - name: Setup swap to prevent kernel firing off the OOM killer shell: | + [ ! -f /root/swap ] && \ truncate -s 8G /root/swap && \ export SWAPDEV=$(losetup --show -f /root/swap | head -1) && \ mkswap $SWAPDEV && \ swapon $SWAPDEV && \ - swapon --show + swapon --show || true - name: Make testing directories to conform to testing standards file: path: "{{ item }}" From 7bbad0c7ad4ed161118418f9140b62c060b47f07 Mon Sep 17 00:00:00 2001 From: Chris Evich Date: Thu, 21 Sep 2017 11:28:38 -0400 Subject: [PATCH 2/2] fixup! integration-playbook: Don't re-swap --- contrib/test/crio-integration-playbook.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/contrib/test/crio-integration-playbook.yaml b/contrib/test/crio-integration-playbook.yaml index 7369a024..b64236a6 100644 --- a/contrib/test/crio-integration-playbook.yaml +++ b/contrib/test/crio-integration-playbook.yaml @@ -88,8 +88,11 @@ truncate -s 8G /root/swap && \ export SWAPDEV=$(losetup --show -f /root/swap | head -1) && \ mkswap $SWAPDEV && \ - swapon $SWAPDEV && \ - swapon --show || true + swapon $SWAPDEV || true + - name: Capture current state of swap for debugging + command: swapon --show + register: result + - debug: var=result - name: Make testing directories to conform to testing standards file: path: "{{ item }}"