From 19356c03e8ac8061e0e96383255190766c1a5a32 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bonicoli Date: Thu, 26 Apr 2018 03:03:46 +0200 Subject: [PATCH] filesystem tests: update ocfs2 fs size on Trusty Using Ubuntu 14.04, test fails because 'blkid' < 2.21 doesn't recognize 'ocfs2' filesystem smaller than 108Mo: https://github.com/karelzak/util-linux/commit/6baa15039873aac5513abde621f60c63537b88e9 filesystem: fix MKFS_FORCE_FLAGS for ocfs2 mkfs.ocfs2 -F won't work because mkfs.ocfs2 asks for a confirmation: $ mkfs.ocfs2 -F img mkfs.ocfs2 1.6.4 Cluster stack: classic o2cb Overwriting existing ocfs2 partition. WARNING: Cluster check disabled. Proceed (y/N): The undocumented 'x' switch must be used too. --- lib/ansible/modules/system/filesystem.py | 1 + test/integration/targets/filesystem/defaults/main.yml | 2 +- test/integration/targets/filesystem/tasks/main.yml | 9 +++++++++ .../integration/targets/filesystem/vars/Ubuntu-14.04.yml | 2 ++ test/integration/targets/filesystem/vars/default.yml | 2 ++ 5 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 test/integration/targets/filesystem/vars/Ubuntu-14.04.yml create mode 100644 test/integration/targets/filesystem/vars/default.yml diff --git a/lib/ansible/modules/system/filesystem.py b/lib/ansible/modules/system/filesystem.py index 322279e6db0..0b9b2fb3cf1 100644 --- a/lib/ansible/modules/system/filesystem.py +++ b/lib/ansible/modules/system/filesystem.py @@ -230,6 +230,7 @@ class Btrfs(Filesystem): class Ocfs2(Filesystem): MKFS = 'mkfs.ocfs2' + MKFS_FORCE_FLAGS = '-Fx' class VFAT(Filesystem): diff --git a/test/integration/targets/filesystem/defaults/main.yml b/test/integration/targets/filesystem/defaults/main.yml index 7208c80cfc4..10c27d2a5f0 100644 --- a/test/integration/targets/filesystem/defaults/main.yml +++ b/test/integration/targets/filesystem/defaults/main.yml @@ -12,5 +12,5 @@ tested_filesystems: xfs: {fssize: 20, grow: False} # grow requires a mounted filesystem btrfs: {fssize: 100, grow: False} # grow not implemented vfat: {fssize: 20, grow: True} - ocfs2: {fssize: 20, grow: False} # grow not implemented + ocfs2: {fssize: '{{ ocfs2_fssize }}', grow: False} # grow not implemented # untested: lvm, requires a block device diff --git a/test/integration/targets/filesystem/tasks/main.yml b/test/integration/targets/filesystem/tasks/main.yml index 03003497a98..6493f553542 100644 --- a/test/integration/targets/filesystem/tasks/main.yml +++ b/test/integration/targets/filesystem/tasks/main.yml @@ -4,6 +4,15 @@ msg: '{{ role_path|basename }}' - import_tasks: setup.yml +- include_vars: "{{ lookup('first_found', search) }}" + vars: + search: + files: + - '{{ ansible_distribution }}-{{ ansible_distribution_version }}.yml' + - 'default.yml' + paths: + - '../vars/' + - include_tasks: create_fs.yml vars: dev: '{{ ansible_user_dir }}/ansible_testing/img' diff --git a/test/integration/targets/filesystem/vars/Ubuntu-14.04.yml b/test/integration/targets/filesystem/vars/Ubuntu-14.04.yml new file mode 100644 index 00000000000..96a22bc7463 --- /dev/null +++ b/test/integration/targets/filesystem/vars/Ubuntu-14.04.yml @@ -0,0 +1,2 @@ +--- +ocfs2_fssize: 108 diff --git a/test/integration/targets/filesystem/vars/default.yml b/test/integration/targets/filesystem/vars/default.yml new file mode 100644 index 00000000000..85b052d4c23 --- /dev/null +++ b/test/integration/targets/filesystem/vars/default.yml @@ -0,0 +1,2 @@ +--- +ocfs2_fssize: 20