Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 627AE40BE5 for ; Fri, 12 Apr 2024 20:50:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712955006; cv=none; b=t4qTbL2F+KTHIZdUBeLztxtz9e0+X+pvyY8CRmoqlx7Iuyp4+YNvaABkkt2AiqYzPAKEn9hvuLHMQgcxmWFUqZU4TfI91YVdieADT+TexLgK9ANYvZE1OOEXbFiKCWCNDCC7Qc3QIxFgiK5shdqr6i0OLrQdE5XIK3a3L6q1nWk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712955006; c=relaxed/simple; bh=sYrNr/AOKVab/fQfCifrcCEkrxUXQuRfSUsWaThl3NY=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=RUb+SmUNIjrikGKsB5C7WjYsP6TedtEjuZGE3mktLAkZKyE5QsQsT2kYqt/IirRuj6x5g2TRFM/9un/NOfdJ7XC52OFcYYXyfeMQBBMMhXDTLX+0H5Le2aoGyoxcItyWzeiRFydNEgAh974/XYEFu9wZ7cJP7bDZEhAE3DvL+rQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=H2Cb6UcX; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="H2Cb6UcX" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712955003; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=00qHbUq7MfQBnTQXmXcF9VMaY9JlGVYWlKGzjMVHYfU=; b=H2Cb6UcX7B2OfPLIKNAqFDeoT4HVRWvI3HTNjN81MOHv4zFoyMG4amhri994d/C7m5FVFM Qi58JNp2ka5kG8cNdYRQmx8bf8Pq5uLOyiwKBGvmcGH51H8GHADwFKKsCsQwNaJ5fgmW8s 96bIwg12BM86uezXnCzxxAGL0cDfVA4= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-157-AX9Tq9beNX6bPW2mHbCd7g-1; Fri, 12 Apr 2024 16:50:02 -0400 X-MC-Unique: AX9Tq9beNX6bPW2mHbCd7g-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BC12A3803509 for ; Fri, 12 Apr 2024 20:50:01 +0000 (UTC) Received: from aion.redhat.com (unknown [10.22.9.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A41211121306 for ; Fri, 12 Apr 2024 20:50:01 +0000 (UTC) Received: from aion.redhat.com (localhost [IPv6:::1]) by aion.redhat.com (Postfix) with ESMTP id 435441483E0 for ; Fri, 12 Apr 2024 16:50:01 -0400 (EDT) From: Scott Mayhew To: kdevops@lists.linux.dev Subject: [PATCH 5/6] fstests: add an option for testing on CIFS Date: Fri, 12 Apr 2024 16:49:59 -0400 Message-ID: <20240412205000.2329837-6-smayhew@redhat.com> In-Reply-To: <20240412205000.2329837-1-smayhew@redhat.com> References: <20240412205000.2329837-1-smayhew@redhat.com> Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true Signed-off-by: Scott Mayhew --- playbooks/roles/fstests/defaults/main.yml | 6 ++ .../tasks/install-deps/debian/main.yml | 1 + .../tasks/install-deps/redhat/main.yml | 1 + .../fstests/tasks/install-deps/suse/main.yml | 11 +++ playbooks/roles/fstests/tasks/main.yml | 39 ++++++++++ .../roles/fstests/templates/cifs/cifs.config | 33 ++++++++ workflows/fstests/Kconfig | 20 ++++- workflows/fstests/Makefile | 4 + workflows/fstests/cifs/Kconfig | 75 +++++++++++++++++++ workflows/fstests/cifs/Makefile | 17 +++++ 10 files changed, 206 insertions(+), 1 deletion(-) create mode 100644 playbooks/roles/fstests/templates/cifs/cifs.config create mode 100644 workflows/fstests/cifs/Kconfig create mode 100644 workflows/fstests/cifs/Makefile diff --git a/playbooks/roles/fstests/defaults/main.yml b/playbooks/roles/fstests/defaults/main.yml index 3c6029f..a59287a 100644 --- a/playbooks/roles/fstests/defaults/main.yml +++ b/playbooks/roles/fstests/defaults/main.yml @@ -169,6 +169,12 @@ fstests_nfs_section_v41: False fstests_nfs_section_v40: False fstests_nfs_section_v3: False +fstests_cifs_enable: False +fstests_cifs_use_kdevops_smbd: False +fstests_cifs_section_smb3: False +fstests_cifs_section_smb3_seal: False +fstests_cifs_section_smb3_sign: False + fstests_tmpfs_enable: False fstests_tmpfs_test_dev: "/media/test" fstests_tmpfs_scratch_devpool: "/media/scratch" diff --git a/playbooks/roles/fstests/tasks/install-deps/debian/main.yml b/playbooks/roles/fstests/tasks/install-deps/debian/main.yml index a90798b..c43031d 100644 --- a/playbooks/roles/fstests/tasks/install-deps/debian/main.yml +++ b/playbooks/roles/fstests/tasks/install-deps/debian/main.yml @@ -71,6 +71,7 @@ - parted - nfs-common - xfsdump + - cifs-utils state: present update_cache: yes tags: [ 'fstests', 'deps' ] diff --git a/playbooks/roles/fstests/tasks/install-deps/redhat/main.yml b/playbooks/roles/fstests/tasks/install-deps/redhat/main.yml index ff0b7c6..e6be4ef 100644 --- a/playbooks/roles/fstests/tasks/install-deps/redhat/main.yml +++ b/playbooks/roles/fstests/tasks/install-deps/redhat/main.yml @@ -84,6 +84,7 @@ - parted - nfs-utils - liburing-devel + - cifs-utils - name: Install xfsprogs-xfs_scrub become: yes diff --git a/playbooks/roles/fstests/tasks/install-deps/suse/main.yml b/playbooks/roles/fstests/tasks/install-deps/suse/main.yml index 951dfc6..43d4df2 100644 --- a/playbooks/roles/fstests/tasks/install-deps/suse/main.yml +++ b/playbooks/roles/fstests/tasks/install-deps/suse/main.yml @@ -247,3 +247,14 @@ state: started when: - fstests_fstyp == "nfs" + +- name: Install cifs-utils + become: yes + become_method: sudo + ansible.builtin.package: + name: + - cifs-utils + state: present + when: + - repos_present|bool + - fstests_fstyp == "cifs" diff --git a/playbooks/roles/fstests/tasks/main.yml b/playbooks/roles/fstests/tasks/main.yml index 29b3bb5..b9b0a3b 100644 --- a/playbooks/roles/fstests/tasks/main.yml +++ b/playbooks/roles/fstests/tasks/main.yml @@ -808,6 +808,45 @@ - fstests_nfs_auth_flavor is defined - fstests_nfs_auth_flavor +- name: Create SMB share for test vol + include_role: + name: smbd_add_share + vars: + server_host: "{{ fstests_smb_server_host }}" + share_volname: "{{ volname_prefix }}-t" + share_fstype: "{{ smbd_share_fstype }}" + share_size: 20g + when: + - fstests_fstyp == "cifs" + - fstests_cifs_use_kdevops_smbd|bool + +- name: Create SMB share for scratch vol + include_role: + name: smbd_add_share + vars: + server_host: "{{ fstests_smb_server_host }}" + share_volname: "{{ volname_prefix }}-s" + share_fstype: "{{ smbd_share_fstype }}" + share_size: 30g + when: + - fstests_fstyp == "cifs" + - fstests_cifs_use_kdevops_smbd|bool + +- name: Copy and force overwrite of the target filesystem fstests configuration for CIFS + tags: [ 'oscheck', 'fstests', 'run_tests', 'kdevops_fstests_setup', 'install' , 'generate-fstests-config' ] + become: yes + become_flags: 'su - -c' + become_method: sudo + vars: + fstests_cifs_test_dev: "//{{ fstests_smb_server_host }}/{{ volname_prefix }}-t" + fstests_cifs_scratch_devpool: "//{{ fstests_smb_server_host }}/{{ volname_prefix }}-s" + template: + src: "{{ fstests_fstyp }}/{{ fstests_fstyp }}.config" + dest: "{{ fstests_data_target }}/configs/{{ ansible_host }}.config" + force: yes + when: + - fstests_fstyp == "cifs" + - name: Reboot system before our test so we know everything is sane tags: [ 'oscheck', 'fstests', 'run_tests', 'reboot' ] become: yes diff --git a/playbooks/roles/fstests/templates/cifs/cifs.config b/playbooks/roles/fstests/templates/cifs/cifs.config new file mode 100644 index 0000000..ec52b9e --- /dev/null +++ b/playbooks/roles/fstests/templates/cifs/cifs.config @@ -0,0 +1,33 @@ +# Automatically generated file by kdevops +# +# Default mount options +# +[default] +FSTYP=cifs +TEST_DIR={{ fstests_test_dir }} +SCRATCH_MNT={{ fstests_scratch_mnt }} +SCRATCH_DEV={{ fstests_cifs_scratch_devpool }} +RESULT_BASE=$PWD/results/$HOST/$(uname -r) +TEST_DEV={{ fstests_cifs_test_dev }} +CANON_DEVS=yes +{% if fstests_cifs_section_smb3 -%} + +# Test with SMB3 +[cifs_smb3] +TEST_FS_MOUNT_OPTS="-ousername=root,password={{ smb_root_pw }},noperm,vers=3.0,mfsymlinks,actimeo=0" +MOUNT_OPTIONS="-ousername=root,password={{ smb_root_pw }},noperm,vers=3.0,mfsymlinks,actimeo=0" +{% endif %} +{% if fstests_cifs_section_smb3_seal -%} + +# Test SMB3 with encryption +[cifs_smb3_seal] +TEST_FS_MOUNT_OPTS="-ousername=root,password={{ smb_root_pw }},noperm,vers=3.0,mfsymlinks,actimeo=0,seal" +MOUNT_OPTIONS="-ousername=root,password={{ smb_root_pw }},noperm,vers=3.0,mfsymlinks,actimeo=0,seal" +{% endif %} +{% if fstests_cifs_section_smb3_sign -%} + +# Test SMB3 with signing +[cifs_smb3_sign] +TEST_FS_MOUNT_OPTS="-ousername=root,password={{ smb_root_pw }},noperm,vers=3.0,mfsymlinks,actimeo=0,sign" +MOUNT_OPTIONS="-ousername=root,password={{ smb_root_pw }},noperm,vers=3.0,mfsymlinks,actimeo=0,sign" +{% endif %} diff --git a/workflows/fstests/Kconfig b/workflows/fstests/Kconfig index c797b24..e6664bf 100644 --- a/workflows/fstests/Kconfig +++ b/workflows/fstests/Kconfig @@ -30,6 +30,9 @@ config FSTESTS_TMPFS_ENABLE config FSTESTS_NFS_ENABLE bool +config FSTESTS_CIFS_ENABLE + bool + config FSTESTS_USES_NO_DEVICES bool @@ -64,6 +67,12 @@ config FSTESTS_NFS help This will target testing the Network File System (NFS). +config FSTESTS_CIFS + bool "cifs" + select FSTESTS_CIFS_ENABLE + help + This will target testing the Server Message Block (SMB) protocol. + config FSTESTS_TMPFS bool "tmpfs" select FSTESTS_TMPFS_ENABLE @@ -80,6 +89,7 @@ config FSTESTS_FSTYP default "btrfs" if FSTESTS_BTRFS default "ext4" if FSTESTS_EXT4 default "nfs" if FSTESTS_NFS + default "cifs" if FSTESTS_CIFS default "tmpfs" if FSTESTS_TMPFS help The filesystem to test. This will be automatically set depending on @@ -267,6 +277,14 @@ endmenu endif # FSTESTS_NFS +if FSTESTS_CIFS + +menu "Configure how CIFS should be tested" +source "workflows/fstests/cifs/Kconfig" +endmenu + +endif # FSTESTS_CIFS + if FSTESTS_TMPFS menu "Configure how tmpfs should be tested" @@ -326,7 +344,7 @@ config FSTESTS_TESTDEV_UNDER_DEVELOPMENT want to help develop and test new features which let you use real drives to test fstests with. -if !FSTESTS_TMPFS && !FSTESTS_NFS +if !FSTESTS_TMPFS && !FSTESTS_NFS && !FSTESTS_CIFS choice prompt "Strategy for device pool" diff --git a/workflows/fstests/Makefile b/workflows/fstests/Makefile index cb09ef2..ee70a3c 100644 --- a/workflows/fstests/Makefile +++ b/workflows/fstests/Makefile @@ -58,6 +58,10 @@ ifeq (y,$(CONFIG_FSTESTS_NFS)) include $(TOPDIR)/workflows/fstests/nfs/Makefile endif +ifeq (y,$(CONFIG_FSTESTS_CIFS)) +include $(TOPDIR)/workflows/fstests/cifs/Makefile +endif + ifeq (y,$(CONFIG_FSTESTS_TMPFS)) include $(TOPDIR)/workflows/fstests/tmpfs/Makefile endif diff --git a/workflows/fstests/cifs/Kconfig b/workflows/fstests/cifs/Kconfig new file mode 100644 index 0000000..b88d1fe --- /dev/null +++ b/workflows/fstests/cifs/Kconfig @@ -0,0 +1,75 @@ +config FSTESTS_USE_KDEVOPS_SMBD + bool "Test against the kdevops SMB server" + select KDEVOPS_SETUP_SMBD + default y + help + Do you want to test against Linux smbd as deployed by kdevops? + If so, select this option. If you want to test against another + (already-deployed and reachable) server, disable this and specify + the location. + +config FSTESTS_SMB_SERVER_HOST + string "Test Server hostname" + default "" + depends on !FSTESTS_USE_KDEVOPS_SMBD + help + The SMB server hostname or address to test against. Note that + the clients will expect that an appropriate hierarchy is already + created for them to mount and use. + FIXME: document how to make that. + +# Distributions actively maintaining btrfs support should select this and then +# be careful to select any of the other HAVE_DISTRO_SMB_* below so that +# testers can know what to test for. +config HAVE_DISTRO_CIFS_PREFERS_MANUAL + bool + default n + +config FSTESTS_CIFS_MANUAL_COVERAGE + bool "Enable manual coverage selection" + default y if HAVE_DISTRO_CIFS_PREFERS_MANUAL + default n if !HAVE_DISTRO_CIFS_PREFERS_MANUAL + help + By default we aim to spawn enough hosts to cover testing the full + range of supported features upstream on the Linux kernel for SMB, + and for you to also be able to do development on each section + concurrently. Distributions however may override sensible defaults + and only support certain features. Enabling this option lets you + select and test only specific configurations. + + By default we enables all tests, but certain distributions may + disable certain features and as such don't need to run certain + type of tests. + + You can enable this to allow you to override the default test + coverage. + +if FSTESTS_CIFS_MANUAL_COVERAGE + +config FSTESTS_CIFS_SECTION_SMB3 + bool "Enable testing section: smb3" + default y + help + Enabling this will test SMB3. + +config FSTESTS_CIFS_SECTION_SMB3_SEAL + bool "Enable testing section: smb3_seal" + default n + help + Enabling this will test SMB3 with encryption. + +config FSTESTS_CIFS_SECTION_SMB3_SIGN + bool "Enable testing section: smb3_sign" + default n + help + Enabling this will test SMB3 with signing. + +endif # FSTESTS_CIFS_MANUAL_COVERAGE + +if !FSTESTS_CIFS_MANUAL_COVERAGE + +config FSTESTS_CIFS_SECTION_SMB3 + bool + default y + +endif # !FSTESTS_CIFS_MANUAL_COVERAGE diff --git a/workflows/fstests/cifs/Makefile b/workflows/fstests/cifs/Makefile new file mode 100644 index 0000000..3ee02ca --- /dev/null +++ b/workflows/fstests/cifs/Makefile @@ -0,0 +1,17 @@ +FSTESTS_ARGS += fstests_cifs_enable='True' +FSTESTS_SMB_SERVER_HOST:=$(subst ",,$(CONFIG_FSTESTS_SMB_SERVER_HOST)) +ifeq (y,$(CONFIG_FSTESTS_USE_KDEVOPS_SMBD)) +FSTESTS_SMB_SERVER_HOST:=$(subst ",,$(CONFIG_KDEVOPS_HOSTS_PREFIX))-smbd +FSTESTS_ARGS += fstests_cifs_use_kdevops_smbd='True' +endif # CONFIG_FSTESTS_USE_KDEVOPS_SMBD +FSTESTS_ARGS += fstests_smb_server_host='$(FSTESTS_SMB_SERVER_HOST)' + +ifeq (y,$(CONFIG_FSTESTS_CIFS_SECTION_SMB3)) +FSTESTS_ARGS += fstests_cifs_section_smb3=True +endif +ifeq (y,$(CONFIG_FSTESTS_CIFS_SECTION_SMB3_SEAL)) +FSTESTS_ARGS += fstests_cifs_section_smb3_seal=True +endif +ifeq (y,$(CONFIG_FSTESTS_CIFS_SECTION_SMB3_SIGN)) +FSTESTS_ARGS += fstests_cifs_section_smb3_sign=True +endif -- 2.44.0