From 9f99f539f7cc98fa55ccbad3dc0524d2f1131a3e Mon Sep 17 00:00:00 2001 From: Dimitri Savineau Date: Fri, 12 Apr 2019 10:46:20 -0400 Subject: [PATCH] tests/functional/setup: change mount options In the CI jobs we can change the mount options of the main partition to avoid extra operations on disk. Adding jmespath to tests/requirements.txt due to the json_query filter usage. Signed-off-by: Dimitri Savineau --- tests/functional/setup.yml | 15 +++++++++++++++ tests/requirements.txt | 1 + 2 files changed, 16 insertions(+) diff --git a/tests/functional/setup.yml b/tests/functional/setup.yml index 52f8ebc5c..91eddb870 100644 --- a/tests/functional/setup.yml +++ b/tests/functional/setup.yml @@ -13,6 +13,21 @@ set_fact: is_atomic: '{{ stat_ostree.stat.exists }}' + - name: get root mount information + set_fact: + rootmount: "{{ ansible_mounts|json_query('[?mount==`/`]|[0]') }}" + + # mount -o remount doesn't work on RHEL 8 for now + - name: add mount options to / + mount: + path: '{{ rootmount.mount }}' + src: '{{ rootmount.device }}' + opts: noatime,nodiratime,nobarrier + fstype: '{{ rootmount.fstype }}' + state: mounted + when: not (ansible_os_family == 'RedHat' and + ansible_distribution_major_version == '8') + # we need to install this so the Socket testinfra module # can use netcat for testing - name: install net-tools diff --git a/tests/requirements.txt b/tests/requirements.txt index b24695747..8f89d8073 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -7,3 +7,4 @@ notario>=0.0.13 ansible~=2.7,<2.8 netaddr mock +jmespath -- 2.39.5