public inbox for kdevops@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH 0/6] Add an option for running fstests on CIFS
@ 2024-04-12 20:49 Scott Mayhew
  2024-04-12 20:49 ` [PATCH 1/6] oscheck.sh: add some special cases for cifs Scott Mayhew
                   ` (7 more replies)
  0 siblings, 8 replies; 13+ messages in thread
From: Scott Mayhew @ 2024-04-12 20:49 UTC (permalink / raw)
  To: kdevops

These patches add the ability to run fstests on CIFS.  The playbooks are
very similar to their NFS counterparts.  The smbd playbook sets up a
Samba server, but could be expanded to set up ksmbd in the future.  The
following options are available:  plain SMB3, SMB3 with signing, and
SMB3 with encryption.

The expunge files are based on the tests that were consistently failing
on 6.8.4-200.fc39.x86_64, plus some tests that just take way too long
(generic/476, generic/650).

-Scott

Scott Mayhew (6):
  oscheck.sh: add some special cases for cifs
  gendisks.sh: add special case for cifs
  bringup: add a playbook to bring up an SMB server
  playbooks: add a playbook to create smb shares
  fstests: add an option for testing on CIFS
  fstests: add expunges for cifs

 Makefile                                      |   1 +
 kconfigs/Kconfig.bringup.goals                |   1 +
 kconfigs/Kconfig.smbd                         |  72 ++++++++++++
 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 ++++++
 playbooks/roles/gen_hosts/defaults/main.yml   |   1 +
 .../roles/gen_hosts/templates/fstests.j2      |   6 +
 playbooks/roles/gen_nodes/defaults/main.yml   |   1 +
 playbooks/roles/gen_nodes/tasks/main.yml      |  19 ++++
 playbooks/roles/smbd/defaults/main.yml        |   5 +
 .../smbd/tasks/install-deps/debian/main.yml   |  31 ++++++
 .../roles/smbd/tasks/install-deps/main.yml    |  12 ++
 .../smbd/tasks/install-deps/redhat/main.yml   |  33 ++++++
 .../smbd/tasks/install-deps/suse/main.yml     |  29 +++++
 playbooks/roles/smbd/tasks/main.yml           |  95 ++++++++++++++++
 playbooks/roles/smbd/templates/smb.conf.j2    |  11 ++
 playbooks/roles/smbd/vars/Debian.yml          |  10 ++
 playbooks/roles/smbd/vars/RedHat.yml          |  12 ++
 playbooks/roles/smbd/vars/Suse.yml            |  10 ++
 playbooks/roles/smbd_add_share/README.md      |  57 ++++++++++
 .../roles/smbd_add_share/defaults/main.yml    |   5 +
 playbooks/roles/smbd_add_share/tasks/main.yml | 103 ++++++++++++++++++
 .../roles/smbd_add_share/templates/share.j2   |   7 ++
 playbooks/smbd.yml                            |   4 +
 scripts/smbd.Makefile                         |  20 ++++
 workflows/fstests/Kconfig                     |  20 +++-
 workflows/fstests/Makefile                    |   4 +
 workflows/fstests/cifs/Kconfig                |  75 +++++++++++++
 workflows/fstests/cifs/Makefile               |  17 +++
 .../expunges/any/cifs/unassigned/all.txt      |  60 ++++++++++
 .../any/cifs/unassigned/cifs_smb3_sign.txt    |   2 +
 workflows/fstests/scripts/gendisks.sh         |   2 +-
 workflows/fstests/scripts/oscheck.sh          |   8 +-
 37 files changed, 818 insertions(+), 6 deletions(-)
 create mode 100644 kconfigs/Kconfig.smbd
 create mode 100644 playbooks/roles/fstests/templates/cifs/cifs.config
 create mode 100644 playbooks/roles/smbd/defaults/main.yml
 create mode 100644 playbooks/roles/smbd/tasks/install-deps/debian/main.yml
 create mode 100644 playbooks/roles/smbd/tasks/install-deps/main.yml
 create mode 100644 playbooks/roles/smbd/tasks/install-deps/redhat/main.yml
 create mode 100644 playbooks/roles/smbd/tasks/install-deps/suse/main.yml
 create mode 100644 playbooks/roles/smbd/tasks/main.yml
 create mode 100644 playbooks/roles/smbd/templates/smb.conf.j2
 create mode 100644 playbooks/roles/smbd/vars/Debian.yml
 create mode 100644 playbooks/roles/smbd/vars/RedHat.yml
 create mode 100644 playbooks/roles/smbd/vars/Suse.yml
 create mode 100644 playbooks/roles/smbd_add_share/README.md
 create mode 100644 playbooks/roles/smbd_add_share/defaults/main.yml
 create mode 100644 playbooks/roles/smbd_add_share/tasks/main.yml
 create mode 100644 playbooks/roles/smbd_add_share/templates/share.j2
 create mode 100644 playbooks/smbd.yml
 create mode 100644 scripts/smbd.Makefile
 create mode 100644 workflows/fstests/cifs/Kconfig
 create mode 100644 workflows/fstests/cifs/Makefile
 create mode 100644 workflows/fstests/expunges/any/cifs/unassigned/all.txt
 create mode 100644 workflows/fstests/expunges/any/cifs/unassigned/cifs_smb3_sign.txt

-- 
2.44.0


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 1/6] oscheck.sh: add some special cases for cifs
  2024-04-12 20:49 [PATCH 0/6] Add an option for running fstests on CIFS Scott Mayhew
@ 2024-04-12 20:49 ` Scott Mayhew
  2024-04-12 20:49 ` [PATCH 2/6] gendisks.sh: add special case " Scott Mayhew
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Scott Mayhew @ 2024-04-12 20:49 UTC (permalink / raw)
  To: kdevops

There's a few routines where we exit without doing anything if the
filesystem is NFS.  We need to do that for CIFS as well.

Signed-off-by: Scott Mayhew <smayhew@redhat.com>
---
 workflows/fstests/scripts/oscheck.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/workflows/fstests/scripts/oscheck.sh b/workflows/fstests/scripts/oscheck.sh
index 5a3167a..3421244 100755
--- a/workflows/fstests/scripts/oscheck.sh
+++ b/workflows/fstests/scripts/oscheck.sh
@@ -439,8 +439,8 @@ _check_dev_setup()
 {
 	mkdir -p $TEST_DIR
 
-	# Nothing to be done for NFS
-	if [ "$FSTYP" = "nfs" ]; then
+	# Nothing to be done for NFS or CIFS
+	if [ "$FSTYP" = "nfs" -o "$FSTYP" = "cifs" ]; then
 		return
 	fi
 
@@ -520,7 +520,7 @@ check_test_dev_setup()
 	fi
 
 	# FIXME: check server for reachability?
-	if [ "$FSTYP" = "nfs" ]; then
+	if [ "$FSTYP" = "nfs" -o "$FSTYP" = "cifs" ]; then
 		return
 	fi
 
@@ -548,7 +548,7 @@ check_dev_pool()
 {
 	DEV_POOL_RET=0
 
-	if [ "$FSTYP" = "nfs" ]; then
+	if [ "$FSTYP" = "nfs" -o "$FSTYP" = "cifs" ]; then
 		return 0
 	fi
 
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 2/6] gendisks.sh: add special case for cifs
  2024-04-12 20:49 [PATCH 0/6] Add an option for running fstests on CIFS Scott Mayhew
  2024-04-12 20:49 ` [PATCH 1/6] oscheck.sh: add some special cases for cifs Scott Mayhew
@ 2024-04-12 20:49 ` Scott Mayhew
  2024-04-12 20:49 ` [PATCH 3/6] bringup: add a playbook to bring up an SMB server Scott Mayhew
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Scott Mayhew @ 2024-04-12 20:49 UTC (permalink / raw)
  To: kdevops

As with NFS, there's no mkfs for CIFS.

Signed-off-by: Scott Mayhew <smayhew@redhat.com>
---
 workflows/fstests/scripts/gendisks.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/workflows/fstests/scripts/gendisks.sh b/workflows/fstests/scripts/gendisks.sh
index e5aa02a..17ef95f 100755
--- a/workflows/fstests/scripts/gendisks.sh
+++ b/workflows/fstests/scripts/gendisks.sh
@@ -176,7 +176,7 @@ else
 	if [[ "$TEST_RTDEV" != "" ]]; then
 		RT_MKFS_OPTS="-r rtdev=$TEST_RTDEV"
 	fi
-	if [ $FSTYP = "nfs" ]; then
+	if [ $FSTYP = "nfs" -o $FSTYP = "cifs" ]; then
 		echo "$(basename $0) skipping mkfs"
 	else
 		echo "$(basename $0) mkfs for TEST_DEV:"
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 3/6] bringup: add a playbook to bring up an SMB server
  2024-04-12 20:49 [PATCH 0/6] Add an option for running fstests on CIFS Scott Mayhew
  2024-04-12 20:49 ` [PATCH 1/6] oscheck.sh: add some special cases for cifs Scott Mayhew
  2024-04-12 20:49 ` [PATCH 2/6] gendisks.sh: add special case " Scott Mayhew
@ 2024-04-12 20:49 ` Scott Mayhew
  2024-04-12 20:49 ` [PATCH 4/6] playbooks: add a playbook to create smb shares Scott Mayhew
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Scott Mayhew @ 2024-04-12 20:49 UTC (permalink / raw)
  To: kdevops

Add a playbook to bring up an SMB server so that we can do CIFS testing.
Right now we're just setting up Samba but it could be extended to add an
option to configure ksmbd instead.

Signed-off-by: Scott Mayhew <smayhew@redhat.com>
---
 Makefile                                      |  1 +
 kconfigs/Kconfig.bringup.goals                |  1 +
 kconfigs/Kconfig.smbd                         | 72 ++++++++++++++
 playbooks/roles/gen_hosts/defaults/main.yml   |  1 +
 .../roles/gen_hosts/templates/fstests.j2      |  6 ++
 playbooks/roles/gen_nodes/defaults/main.yml   |  1 +
 playbooks/roles/gen_nodes/tasks/main.yml      | 19 ++++
 playbooks/roles/smbd/defaults/main.yml        |  5 +
 .../smbd/tasks/install-deps/debian/main.yml   | 31 ++++++
 .../roles/smbd/tasks/install-deps/main.yml    | 12 +++
 .../smbd/tasks/install-deps/redhat/main.yml   | 33 +++++++
 .../smbd/tasks/install-deps/suse/main.yml     | 29 ++++++
 playbooks/roles/smbd/tasks/main.yml           | 95 +++++++++++++++++++
 playbooks/roles/smbd/templates/smb.conf.j2    | 11 +++
 playbooks/roles/smbd/vars/Debian.yml          | 10 ++
 playbooks/roles/smbd/vars/RedHat.yml          | 12 +++
 playbooks/roles/smbd/vars/Suse.yml            | 10 ++
 playbooks/smbd.yml                            |  4 +
 scripts/smbd.Makefile                         | 20 ++++
 19 files changed, 373 insertions(+)
 create mode 100644 kconfigs/Kconfig.smbd
 create mode 100644 playbooks/roles/smbd/defaults/main.yml
 create mode 100644 playbooks/roles/smbd/tasks/install-deps/debian/main.yml
 create mode 100644 playbooks/roles/smbd/tasks/install-deps/main.yml
 create mode 100644 playbooks/roles/smbd/tasks/install-deps/redhat/main.yml
 create mode 100644 playbooks/roles/smbd/tasks/install-deps/suse/main.yml
 create mode 100644 playbooks/roles/smbd/tasks/main.yml
 create mode 100644 playbooks/roles/smbd/templates/smb.conf.j2
 create mode 100644 playbooks/roles/smbd/vars/Debian.yml
 create mode 100644 playbooks/roles/smbd/vars/RedHat.yml
 create mode 100644 playbooks/roles/smbd/vars/Suse.yml
 create mode 100644 playbooks/smbd.yml
 create mode 100644 scripts/smbd.Makefile

diff --git a/Makefile b/Makefile
index cd4e639..266eccd 100644
--- a/Makefile
+++ b/Makefile
@@ -107,6 +107,7 @@ endif # CONFIG_WORKFLOWS
 include scripts/siw.Makefile
 include scripts/ktls.Makefile
 include scripts/nfsd.Makefile
+include scripts/smbd.Makefile
 include scripts/krb5.Makefile
 
 include scripts/devconfig.Makefile
diff --git a/kconfigs/Kconfig.bringup.goals b/kconfigs/Kconfig.bringup.goals
index dd7f449..e6d3b18 100644
--- a/kconfigs/Kconfig.bringup.goals
+++ b/kconfigs/Kconfig.bringup.goals
@@ -97,4 +97,5 @@ config KDEVOPS_SETUP_KTLS
 	  necessary for testing RPC over TLS, or NVMe over TCP.
 
 source "kconfigs/Kconfig.nfsd"
+source "kconfigs/Kconfig.smbd"
 source "kconfigs/Kconfig.krb5"
diff --git a/kconfigs/Kconfig.smbd b/kconfigs/Kconfig.smbd
new file mode 100644
index 0000000..251327d
--- /dev/null
+++ b/kconfigs/Kconfig.smbd
@@ -0,0 +1,72 @@
+# FIXME: need defaults for terraform hosts
+config KDEVOPS_SETUP_SMBD
+	bool "Set up the Samba SMB server"
+	default n
+	help
+	  Configure and bring up the Samba SMB server. This will provision
+	  a filesystem on a block device, mount it, share it and start up the
+	  smb server and associated daemons.
+
+if KDEVOPS_SETUP_SMBD
+
+menu "Configure the Samba SMB server"
+
+config SMBD_SHARE_DEVICE_PREFIX
+	string "The device prefix to use for LVM PVs"
+	default "/dev/disk/by-id/nvme-QEMU_NVMe_Ctrl_kdevops" if LIBVIRT && LIBVIRT_EXTRA_STORAGE_DRIVE_NVME
+	default "/dev/disk/by-id/virtio-kdevops" if LIBVIRT && LIBVIRT_EXTRA_STORAGE_DRIVE_VIRTIO
+	default "/dev/disk/by-id/ata-QEMU_HARDDISK_kdevops" if LIBVIRT && LIBVIRT_EXTRA_STORAGE_DRIVE_IDE
+	default ""
+	help
+	  To set up smbd for testing, we give it filesystems to share. This string
+	  will be the prefix for the block devices used as PVs for LVM.
+
+config SMBD_SHARE_DEVICE_COUNT
+	int "Number of devices to add as LVM PVs"
+	default 3 if LIBVIRT
+	help
+	  The number of disk devices to dedicate as LVM PVs. In general, we
+	  avoid using device index 0 as that is used for /data.
+
+choice
+	prompt "Type of filesystem to share"
+	default SMBD_SHARE_FSTYPE_BTRFS
+
+config SMBD_SHARE_FSTYPE_BTRFS
+	bool "btrfs"
+
+config SMBD_SHARE_FSTYPE_XFS
+	bool "xfs"
+
+config SMBD_SHARE_FSTYPE_EXT4
+	bool "ext4"
+
+config SMBD_SHARE_FSTYPE_TMPFS
+	bool "tmpfs"
+
+endchoice
+
+config SMBD_SHARE_FSTYPE
+	string
+	default "btrfs" if SMBD_SHARE_FSTYPE_BTRFS
+	default "xfs" if SMBD_SHARE_FSTYPE_XFS
+	default "ext4" if SMBD_SHARE_FSTYPE_EXT4
+	default "tmpfs" if SMBD_SHARE_FSTYPE_TMPFS
+
+config SMBD_SHARE_PATH
+	string "The path under which to mount the devices to be shared."
+	default "/share"
+	help
+	  This is the path that will be shared from the smbd server. The
+	  share devices are mounted here under numbered directories starting
+	  with 0.
+
+config SMB_ROOT_PW
+        string "SMB root password"
+        default "kdevops"
+        help
+          SMB password to use for the root user.
+
+endmenu
+
+endif
diff --git a/playbooks/roles/gen_hosts/defaults/main.yml b/playbooks/roles/gen_hosts/defaults/main.yml
index 5cd941c..8d0ca3b 100644
--- a/playbooks/roles/gen_hosts/defaults/main.yml
+++ b/playbooks/roles/gen_hosts/defaults/main.yml
@@ -33,4 +33,5 @@ fs_config_role_path: "/dev/null"
 fs_config_data: "[section_1]"
 
 kdevops_nfsd_enable: False
+kdevops_smbd_enable: False
 kdevops_krb5_enable: False
diff --git a/playbooks/roles/gen_hosts/templates/fstests.j2 b/playbooks/roles/gen_hosts/templates/fstests.j2
index 985e3f7..eb01088 100644
--- a/playbooks/roles/gen_hosts/templates/fstests.j2
+++ b/playbooks/roles/gen_hosts/templates/fstests.j2
@@ -27,6 +27,12 @@ ansible_python_interpreter =  "{{ kdevops_python_interpreter }}"
 [nfsd:vars]
 ansible_python_interpreter =  "{{ kdevops_python_interpreter }}"
 {% endif %}
+{% if kdevops_smbd_enable %}
+[smbd]
+{{ kdevops_hosts_prefix }}-smbd
+[smbd:vars]
+ansible_python_interpreter =  "{{ kdevops_python_interpreter }}"
+{% endif %}
 {% if kdevops_krb5_enable %}
 [kdc]
 {{ kdevops_hosts_prefix }}-kdc
diff --git a/playbooks/roles/gen_nodes/defaults/main.yml b/playbooks/roles/gen_nodes/defaults/main.yml
index d03306b..a5e31ac 100644
--- a/playbooks/roles/gen_nodes/defaults/main.yml
+++ b/playbooks/roles/gen_nodes/defaults/main.yml
@@ -14,6 +14,7 @@ kdevops_workflow_enable_gitr: False
 kdevops_workflow_enable_ltp: False
 kdevops_workflow_enable_selftests: False
 kdevops_nfsd_enable: False
+kdevops_smbd_enable: False
 kdevops_krb5_enable: False
 
 virtualbox_provider: False
diff --git a/playbooks/roles/gen_nodes/tasks/main.yml b/playbooks/roles/gen_nodes/tasks/main.yml
index ee175f4..bc55c4b 100644
--- a/playbooks/roles/gen_nodes/tasks/main.yml
+++ b/playbooks/roles/gen_nodes/tasks/main.yml
@@ -55,6 +55,18 @@
   when:
     - kdevops_nfsd_enable|bool
 
+- name: Set smbd_nodes list
+  set_fact:
+    smbd_nodes: "{{ [ kdevops_host_prefix + '-smbd' ] }}"
+  when:
+    - kdevops_smbd_enable|bool
+
+- name: Add an smb server if one was selected
+  set_fact:
+    generic_nodes: "{{ generic_nodes + smbd_nodes }}"
+  when:
+    - kdevops_smbd_enable|bool
+
 - name: Set kdc_nodes list
   set_fact:
     kdc_nodes: "{{ [ kdevops_host_prefix + '-kdc' ] }}"
@@ -285,6 +297,13 @@
     - is_fstests|bool
     - kdevops_nfsd_enable|bool
 
+- name: Add the smb server if one was selected
+  set_fact:
+    fstests_enabled_nodes: "{{ fstests_enabled_nodes + smbd_nodes }}"
+  when:
+    - is_fstests|bool
+    - kdevops_smbd_enable|bool
+
 - name: Add the KRB5 KDC if one was selected
   set_fact:
     fstests_enabled_nodes: "{{ fstests_enabled_nodes + kdc_nodes }}"
diff --git a/playbooks/roles/smbd/defaults/main.yml b/playbooks/roles/smbd/defaults/main.yml
new file mode 100644
index 0000000..d75cc0b
--- /dev/null
+++ b/playbooks/roles/smbd/defaults/main.yml
@@ -0,0 +1,5 @@
+---
+smbd_lvm_pvs: []
+smbd_share_device_prefix: ""
+smbd_share_device_count: 0
+smbd_share_label: "share"
diff --git a/playbooks/roles/smbd/tasks/install-deps/debian/main.yml b/playbooks/roles/smbd/tasks/install-deps/debian/main.yml
new file mode 100644
index 0000000..beb1acd
--- /dev/null
+++ b/playbooks/roles/smbd/tasks/install-deps/debian/main.yml
@@ -0,0 +1,31 @@
+---
+- name: Get OS-specific variables
+  ansible.builtin.include_vars: "{{ lookup('ansible.builtin.first_found', params) }}"
+  vars:
+    params:
+      files:
+        - '{{ansible_distribution}}.yml'
+        - '{{ansible_os_family}}.yml'
+        - default.yml
+      paths:
+        - 'vars'
+
+- name: Determine which fsprogs package is needed for "{{ smbd_share_fstype }}"
+  set_fact:
+    fsprogs: "{{ fstype_userspace_progs[smbd_share_fstype] | default() }}"
+
+- name: Add {{ fsprogs }} to the smbd packages list
+  set_fact:
+    smbd_packages: "{{ smbd_packages + [fsprogs] }}"
+  when:
+    - fsprogs is defined
+    - fsprogs
+
+- name: Install smbd dependencies
+  become: yes
+  become_method: sudo
+  apt:
+    name: "{{ smbd_packages }}"
+    state: present
+    update_cache: yes
+  tags: [ 'deps' ]
diff --git a/playbooks/roles/smbd/tasks/install-deps/main.yml b/playbooks/roles/smbd/tasks/install-deps/main.yml
new file mode 100644
index 0000000..c4d2ed1
--- /dev/null
+++ b/playbooks/roles/smbd/tasks/install-deps/main.yml
@@ -0,0 +1,12 @@
+---
+- name: Debian-specific set up
+  ansible.builtin.include_tasks: roles/tasks/nfsd/install-deps/debian/main.yml
+  when: ansible_os_family == 'Debian'
+
+- name: SuSE-specific set up
+  ansible.builtin.include_tasks: roles/tasks/nfsd/install-deps/suse/main.yml
+  when: ansible_os_family == 'Suse'
+
+- name: Red Hat-specific set up
+  ansible.builtin.include_tasks: roles/tasks/nfsd/install-deps/redhat/main.yml
+  when: ansible_os_family == 'RedHat'
diff --git a/playbooks/roles/smbd/tasks/install-deps/redhat/main.yml b/playbooks/roles/smbd/tasks/install-deps/redhat/main.yml
new file mode 100644
index 0000000..1f4e62b
--- /dev/null
+++ b/playbooks/roles/smbd/tasks/install-deps/redhat/main.yml
@@ -0,0 +1,33 @@
+---
+- name: Get OS-specific variables
+  ansible.builtin.include_vars: "{{ lookup('ansible.builtin.first_found', params) }}"
+  vars:
+    params:
+      files:
+        - '{{ansible_distribution}}.yml'
+        - '{{ansible_os_family}}.yml'
+        - default.yml
+      paths:
+        - 'vars'
+
+- name: Determine which fsprogs package is needed for "{{ smbd_share_fstype }}"
+  set_fact:
+    fsprogs: "{{ fstype_userspace_progs[smbd_share_fstype] | default() }}"
+
+- name: Add {{ fsprogs }} to the smbd packages list
+  set_fact:
+    smbd_packages: "{{ smbd_packages + [fsprogs] }}"
+  when:
+    - fsprogs is defined
+    - fsprogs
+
+- name: Install smbd dependencies
+  become: yes
+  become_method: sudo
+  yum:
+    update_cache: yes
+    name: "{{ smbd_packages }}"
+  retries: 3
+  delay: 5
+  register: result
+  until: result.rc == 0
diff --git a/playbooks/roles/smbd/tasks/install-deps/suse/main.yml b/playbooks/roles/smbd/tasks/install-deps/suse/main.yml
new file mode 100644
index 0000000..e90fe89
--- /dev/null
+++ b/playbooks/roles/smbd/tasks/install-deps/suse/main.yml
@@ -0,0 +1,29 @@
+---
+- name: Get OS-specific variables
+  ansible.builtin.include_vars: "{{ lookup('ansible.builtin.first_found', params) }}"
+  vars:
+    params:
+      files:
+        - '{{ansible_distribution}}.yml'
+        - '{{ansible_os_family}}.yml'
+        - default.yml
+      paths:
+        - 'vars'
+
+- name: Determine which fsprogs package is needed for "{{ smbd_share_fstype }}"
+  set_fact:
+    fsprogs: "{{ fstype_userspace_progs[smbd_share_fstype] | default() }}"
+
+- name: Add {{ fsprogs }} to the smbd packages list
+  set_fact:
+    smbd_packages: "{{ smbd_packages + [fsprogs] }}"
+  when:
+    - fsprogs is defined
+    - fsprogs
+
+- name: Install smbd dependencies
+  become: yes
+  become_method: sudo
+  ansible.builtin.package:
+    name: "{{ smbd_packages }}"
+    state: present
diff --git a/playbooks/roles/smbd/tasks/main.yml b/playbooks/roles/smbd/tasks/main.yml
new file mode 100644
index 0000000..bb19009
--- /dev/null
+++ b/playbooks/roles/smbd/tasks/main.yml
@@ -0,0 +1,95 @@
+---
+- name: Debian-specific setup
+  ansible.builtin.include_tasks: roles/smbd/tasks/install-deps/debian/main.yml
+  when: ansible_os_family == 'Debian'
+
+- name: SuSE-specific setup
+  ansible.builtin.include_tasks: roles/smbd/tasks/install-deps/suse/main.yml
+  when: ansible_os_family == 'Suse'
+
+- name: Red Hat-specific setup
+  ansible.builtin.include_tasks: roles/smbd/tasks/install-deps/redhat/main.yml
+  when: ansible_os_family == 'RedHat'
+
+- name: Create smb.conf
+  become: yes
+  become_flags: 'su - -c'
+  become_method: sudo
+  ansible.builtin.template:
+    src: smb.conf.j2
+    dest: /etc/samba/smb.conf
+    owner: root
+    group: root
+    mode: 0644
+
+- name: Build string of devices to use as PVs
+  set_fact:
+    smbd_lvm_pvs: "{{ smbd_lvm_pvs + [ smbd_share_device_prefix + item|string ] }}"
+  with_items: "{{ range(1, smbd_share_device_count + 1) }}"
+
+- name: Print the PV list
+  ansible.builtin.debug:
+    var: smbd_lvm_pvs
+
+- name: Create a new LVM VG
+  become: yes
+  become_flags: 'su - -c'
+  become_method: sudo
+  community.general.lvg:
+    vg: "shares"
+    pvs: "{{ smbd_lvm_pvs | join(',') }}"
+
+- name: Create {{ smbd_share_path }}
+  become: yes
+  become_flags: 'su - -c'
+  become_method: sudo
+  ansible.builtin.file:
+    path: "{{ smbd_share_path }}"
+    state: directory
+    mode: 0755
+
+- name: Test whether SELinux is enabled
+  command: /usr/sbin/selinuxenabled
+  register: selinux_status
+  changed_when: False
+  failed_when: False
+
+- name: Set samba_export_all_rw selinux boolean
+  become: yes
+  become_flags: 'su - -c'
+  become_method: sudo
+  ansible.posix.seboolean:
+    name: samba_export_all_rw
+    state: true
+    persistent: true
+  when: selinux_status.rc == 0
+
+- name: Populate service facts
+  ansible.builtin.service_facts:
+
+- name: Allow access to samba in firewalld
+  become: yes
+  become_flags: 'su - -c'
+  become_method: sudo
+  ansible.posix.firewalld:
+    service: samba
+    permanent: true
+    immediate: true
+    state: enabled
+  when: '"firewalld.service" in ansible_facts.services'
+
+- name: Start and enable samba systemd service
+  become: yes
+  become_flags: 'su - -c'
+  become_method: sudo
+  ansible.builtin.systemd:
+    name: smb
+    enabled: true
+    state: started
+
+- name: Set SMB password for root
+  become: yes
+  become_flags: 'su - -c'
+  become_method: sudo
+  ansible.builtin.shell:
+    cmd: printf "{{ smb_root_pw }}\n{{ smb_root_pw }}" | smbpasswd -a root -s
diff --git a/playbooks/roles/smbd/templates/smb.conf.j2 b/playbooks/roles/smbd/templates/smb.conf.j2
new file mode 100644
index 0000000..7665142
--- /dev/null
+++ b/playbooks/roles/smbd/templates/smb.conf.j2
@@ -0,0 +1,11 @@
+[global]
+	workgroup = SAMBA
+	security = user
+
+	passdb backend = tdbsam
+
+	printing = cups
+	printcap name = cups
+	load printers = yes
+	cups options = raw
+
diff --git a/playbooks/roles/smbd/vars/Debian.yml b/playbooks/roles/smbd/vars/Debian.yml
new file mode 100644
index 0000000..1ad76f2
--- /dev/null
+++ b/playbooks/roles/smbd/vars/Debian.yml
@@ -0,0 +1,10 @@
+---
+smbd_packages:
+  - lvm2
+  - policycoreutils
+  - samba
+
+fstype_userspace_progs:
+  btrfs: btrfs-progs
+  ext4: e2fsprogs
+  xfs: xfsprogs
diff --git a/playbooks/roles/smbd/vars/RedHat.yml b/playbooks/roles/smbd/vars/RedHat.yml
new file mode 100644
index 0000000..a95eca0
--- /dev/null
+++ b/playbooks/roles/smbd/vars/RedHat.yml
@@ -0,0 +1,12 @@
+---
+smbd_packages:
+  - checkpolicy
+  - lvm2
+  - policycoreutils
+  - python3-policycoreutils
+  - samba
+
+fstype_userspace_progs:
+  btrfs: btrfs-progs
+  ext4: e2fsprogs
+  xfs: xfsprogs
diff --git a/playbooks/roles/smbd/vars/Suse.yml b/playbooks/roles/smbd/vars/Suse.yml
new file mode 100644
index 0000000..219ba05
--- /dev/null
+++ b/playbooks/roles/smbd/vars/Suse.yml
@@ -0,0 +1,10 @@
+---
+smbd_packages:
+  - lvm2
+  - policycoreutils
+  - samba
+
+fstype_userspace_progs:
+  btrfs: btrfsprogs
+  ext4: e2fsprogs
+  xfs: xfsprogs
diff --git a/playbooks/smbd.yml b/playbooks/smbd.yml
new file mode 100644
index 0000000..47cd022
--- /dev/null
+++ b/playbooks/smbd.yml
@@ -0,0 +1,4 @@
+---
+- hosts: all
+  roles:
+    - role: smbd
diff --git a/scripts/smbd.Makefile b/scripts/smbd.Makefile
new file mode 100644
index 0000000..ae23497
--- /dev/null
+++ b/scripts/smbd.Makefile
@@ -0,0 +1,20 @@
+ifeq (y,$(CONFIG_KDEVOPS_SETUP_SMBD))
+
+SMBD_EXTRA_ARGS += smbd_share_device_prefix='$(subst ",,$(CONFIG_SMBD_SHARE_DEVICE_PREFIX))'
+SMBD_EXTRA_ARGS += smbd_share_device_count='$(subst ",,$(CONFIG_SMBD_SHARE_DEVICE_COUNT))'
+SMBD_EXTRA_ARGS += smbd_share_fstype='$(subst ",,$(CONFIG_SMBD_SHARE_FSTYPE))'
+SMBD_EXTRA_ARGS += smbd_share_path='$(subst ",,$(CONFIG_SMBD_SHARE_PATH))'
+SMBD_EXTRA_ARGS += smb_root_pw='$(subst ",,$(CONFIG_SMB_ROOT_PW))'
+SMBD_EXTRA_ARGS += kdevops_smbd_enable=True
+
+ANSIBLE_EXTRA_ARGS += $(SMBD_EXTRA_ARGS)
+
+smbd:
+	$(Q)ansible-playbook $(ANSIBLE_VERBOSE) --extra-vars=@./extra_vars.yaml \
+		-f 30 -i hosts -l smbd playbooks/smbd.yml
+
+KDEVOPS_BRING_UP_DEPS += smbd
+
+PHONY += smbd
+
+endif
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 4/6] playbooks: add a playbook to create smb shares
  2024-04-12 20:49 [PATCH 0/6] Add an option for running fstests on CIFS Scott Mayhew
                   ` (2 preceding siblings ...)
  2024-04-12 20:49 ` [PATCH 3/6] bringup: add a playbook to bring up an SMB server Scott Mayhew
@ 2024-04-12 20:49 ` Scott Mayhew
  2024-04-12 20:49 ` [PATCH 5/6] fstests: add an option for testing on CIFS Scott Mayhew
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Scott Mayhew @ 2024-04-12 20:49 UTC (permalink / raw)
  To: kdevops

Yoinked almost entirely from nfsd_add_export, this playbook is for
creating share on the SMB server.

Signed-off-by: Scott Mayhew <smayhew@redhat.com>
---
 playbooks/roles/smbd_add_share/README.md      |  57 ++++++++++
 .../roles/smbd_add_share/defaults/main.yml    |   5 +
 playbooks/roles/smbd_add_share/tasks/main.yml | 103 ++++++++++++++++++
 .../roles/smbd_add_share/templates/share.j2   |   7 ++
 4 files changed, 172 insertions(+)
 create mode 100644 playbooks/roles/smbd_add_share/README.md
 create mode 100644 playbooks/roles/smbd_add_share/defaults/main.yml
 create mode 100644 playbooks/roles/smbd_add_share/tasks/main.yml
 create mode 100644 playbooks/roles/smbd_add_share/templates/share.j2

diff --git a/playbooks/roles/smbd_add_share/README.md b/playbooks/roles/smbd_add_share/README.md
new file mode 100644
index 0000000..6d7bb0d
--- /dev/null
+++ b/playbooks/roles/smbd_add_share/README.md
@@ -0,0 +1,57 @@
+smbd_add_share
+================
+
+The smbd_add_share role lets you create an SMB share on the Samba
+server set up by kdevops.  Basically a rip-off of nfsd_add_export.
+
+Requirements
+------------
+
+None. SMB server and LVM administrative tools are installed on the
+kdevops Samba server automatically.
+
+Role Variables
+--------------
+
+  * server_host: the hostname or IP address of the SMB server where
+    the new share is to be created
+  * share_volname: the name of the new share, to be created under
+    the /shares directory on the SMB server
+  * share_options: the share options for the new share (currently not used)
+  * share_fstype: the file system type of the new share
+  * share_size: the maximum size of the new share
+  * share_user: the owner of the new share
+  * share_group: the owner group of the new share
+  * share_mode: the mode bits for the new share's root directory
+
+Dependencies
+------------
+
+None.
+
+Example Playbook
+----------------
+
+Below is an example playbook task:
+
+```
+- name: Create SMB share for test vol
+  include_role:
+    name: smbd_add_share
+  vars:
+    server_host: "kdevops-smbd"
+    share_volname: "test"
+    share_fstype: "btrfs"
+    share_size: 20g
+  when:
+    - test_fstype == "cifs"
+    - test_cifs_use_kdevops_smbd|bool
+```
+
+For further examples refer to one of this role's users, the
+[https://github.com/linux-kdevops/kdevops](kdevops) project.
+
+License
+-------
+
+GPL-2.0+
diff --git a/playbooks/roles/smbd_add_share/defaults/main.yml b/playbooks/roles/smbd_add_share/defaults/main.yml
new file mode 100644
index 0000000..4cbfa91
--- /dev/null
+++ b/playbooks/roles/smbd_add_share/defaults/main.yml
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier GPL-2.0+
+---
+share_user: "root"
+share_group: "root"
+share_mode: "u=rwx,g=rwx,o=rwxt"
diff --git a/playbooks/roles/smbd_add_share/tasks/main.yml b/playbooks/roles/smbd_add_share/tasks/main.yml
new file mode 100644
index 0000000..4958d6a
--- /dev/null
+++ b/playbooks/roles/smbd_add_share/tasks/main.yml
@@ -0,0 +1,103 @@
+---
+- name: Create a new LVM partition
+  become: yes
+  become_flags: 'su - -c'
+  become_method: sudo
+  delegate_to: "{{ server_host }}"
+  community.general.lvol:
+    vg: shares
+    lv: "{{ share_volname }}"
+    size: "{{ share_size }}"
+  when:
+    - share_fstype != "tmpfs"
+
+- name: Format new volume for {{ share_fstype }}
+  become: yes
+  become_flags: 'su - -c'
+  become_method: sudo
+  delegate_to: "{{ server_host }}"
+  filesystem:
+    fstype: "{{ share_fstype }}"
+    dev: "/dev/shares/{{ share_volname }}"
+  when:
+    - share_fstype != "tmpfs"
+
+- name: Mount volume under {{ smbd_share_path }}
+  become: yes
+  become_flags: 'su - -c'
+  become_method: sudo
+  delegate_to: "{{ server_host }}"
+  throttle: 1  # running this in parallel can clobber fstab changes
+  mount:
+    path: "{{ smbd_share_path }}/{{ share_volname }}"
+    src: "/dev/shares/{{ share_volname }}"
+    fstype: "{{ share_fstype }}"
+    state: mounted
+  when:
+    - share_fstype != "tmpfs"
+
+- name: Mount tmpfs under {{ smbd_share_path }}
+  become: yes
+  become_flags: 'su - -c'
+  become_method: sudo
+  delegate_to: "{{ server_host }}"
+  throttle: 1  # running this in parallel can clobber fstab changes
+  mount:
+    path: "{{ smbd_share_path }}/{{ share_volname }}"
+    src: "tmpfs"
+    fstype: "tmpfs"
+    state: mounted
+  when:
+    - share_fstype == "tmpfs"
+
+- name: Ensure {{ share_volname }} has correct permissions
+  become: yes
+  become_flags: 'su - -c'
+  become_method: sudo
+  delegate_to: "{{ server_host }}"
+  file:
+    state: directory
+    path: "{{ smbd_share_path }}/{{ share_volname }}"
+    owner: "{{ share_user }}"
+    group: "{{ share_group }}"
+    mode: "{{ share_mode }}"
+
+- name: Test whether SELinux is enabled
+  command: /usr/sbin/selinuxenabled
+  register: selinux_status
+  delegate_to: "{{ server_host }}"
+  changed_when: False
+  failed_when: False
+
+- name: Fix SELinux file context under new mount
+  become: yes
+  become_flags: 'su - -c'
+  become_method: sudo
+  delegate_to: "{{ server_host }}"
+  command: /usr/sbin/restorecon -R "{{ smbd_share_path }}/{{ share_volname }}"
+  when: selinux_status.rc == 0
+
+- name: Create an SMB share for the new fs
+  become: yes
+  become_flags: 'su - -c'
+  become_method: sudo
+  delegate_to: "{{ server_host }}"
+  throttle: 1  # running this in parallel can clobber smb.conf changes
+  ansible.builtin.blockinfile:
+    dest: /etc/samba/smb.conf
+    block: "{{ lookup('template', 'share.j2') }}"
+    marker: "; {mark} share configuration for {{ share_volname }}"
+    marker_begin: "begin"
+    marker_end: "end"
+    insertafter: "EOF"
+
+- name: Reload the smb services
+  become: yes
+  become_flags: 'su - -c'
+  become_method: sudo
+  delegate_to: "{{ server_host }}"
+  ansible.builtin.systemd_service:
+    name: smb.service 
+    enabled: true
+    state: reloaded
+
diff --git a/playbooks/roles/smbd_add_share/templates/share.j2 b/playbooks/roles/smbd_add_share/templates/share.j2
new file mode 100644
index 0000000..e40de38
--- /dev/null
+++ b/playbooks/roles/smbd_add_share/templates/share.j2
@@ -0,0 +1,7 @@
+[{{ share_volname }}]
+        path={{ smbd_share_path }}/{{ share_volname }}
+        browseable = Yes
+        read only = No
+        create mask = 0664
+        directory mask = 0775
+
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 5/6] fstests: add an option for testing on CIFS
  2024-04-12 20:49 [PATCH 0/6] Add an option for running fstests on CIFS Scott Mayhew
                   ` (3 preceding siblings ...)
  2024-04-12 20:49 ` [PATCH 4/6] playbooks: add a playbook to create smb shares Scott Mayhew
@ 2024-04-12 20:49 ` Scott Mayhew
  2024-04-12 21:42   ` Luis Chamberlain
  2024-04-12 20:50 ` [PATCH 6/6] fstests: add expunges for cifs Scott Mayhew
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 13+ messages in thread
From: Scott Mayhew @ 2024-04-12 20:49 UTC (permalink / raw)
  To: kdevops

Signed-off-by: Scott Mayhew <smayhew@redhat.com>
---
 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


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 6/6] fstests: add expunges for cifs
  2024-04-12 20:49 [PATCH 0/6] Add an option for running fstests on CIFS Scott Mayhew
                   ` (4 preceding siblings ...)
  2024-04-12 20:49 ` [PATCH 5/6] fstests: add an option for testing on CIFS Scott Mayhew
@ 2024-04-12 20:50 ` Scott Mayhew
  2024-04-12 20:52 ` [PATCH 0/6] Add an option for running fstests on CIFS Chuck Lever III
  2024-04-12 21:46 ` Luis Chamberlain
  7 siblings, 0 replies; 13+ messages in thread
From: Scott Mayhew @ 2024-04-12 20:50 UTC (permalink / raw)
  To: kdevops

Signed-off-by: Scott Mayhew <smayhew@redhat.com>
---
 .../expunges/any/cifs/unassigned/all.txt      | 60 +++++++++++++++++++
 .../any/cifs/unassigned/cifs_smb3_sign.txt    |  2 +
 2 files changed, 62 insertions(+)
 create mode 100644 workflows/fstests/expunges/any/cifs/unassigned/all.txt
 create mode 100644 workflows/fstests/expunges/any/cifs/unassigned/cifs_smb3_sign.txt

diff --git a/workflows/fstests/expunges/any/cifs/unassigned/all.txt b/workflows/fstests/expunges/any/cifs/unassigned/all.txt
new file mode 100644
index 0000000..e1d8e9f
--- /dev/null
+++ b/workflows/fstests/expunges/any/cifs/unassigned/all.txt
@@ -0,0 +1,60 @@
+generic/009
+generic/017
+generic/035
+generic/058
+generic/060
+generic/061
+generic/063
+generic/064
+generic/087
+generic/088
+generic/089
+generic/091
+generic/092
+generic/094
+generic/123
+generic/126
+generic/127
+generic/193
+generic/236
+generic/263
+generic/285
+generic/286
+generic/314
+generic/317
+generic/355
+generic/357
+generic/378
+generic/392
+generic/404
+generic/474
+generic/476
+generic/478
+generic/485
+generic/486
+generic/490
+generic/494
+generic/496
+generic/503
+generic/523
+generic/528
+generic/530
+generic/539
+generic/586
+generic/597
+generic/611
+generic/616
+generic/617
+generic/622
+generic/623
+generic/633
+generic/647
+generic/650
+generic/683
+generic/684
+generic/685
+generic/686
+generic/687
+generic/707
+generic/728
+generic/729
diff --git a/workflows/fstests/expunges/any/cifs/unassigned/cifs_smb3_sign.txt b/workflows/fstests/expunges/any/cifs/unassigned/cifs_smb3_sign.txt
new file mode 100644
index 0000000..2879479
--- /dev/null
+++ b/workflows/fstests/expunges/any/cifs/unassigned/cifs_smb3_sign.txt
@@ -0,0 +1,2 @@
+generic/095
+generic/438
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH 0/6] Add an option for running fstests on CIFS
  2024-04-12 20:49 [PATCH 0/6] Add an option for running fstests on CIFS Scott Mayhew
                   ` (5 preceding siblings ...)
  2024-04-12 20:50 ` [PATCH 6/6] fstests: add expunges for cifs Scott Mayhew
@ 2024-04-12 20:52 ` Chuck Lever III
  2024-04-16 21:54   ` Scott Mayhew
  2024-04-12 21:46 ` Luis Chamberlain
  7 siblings, 1 reply; 13+ messages in thread
From: Chuck Lever III @ 2024-04-12 20:52 UTC (permalink / raw)
  To: Scott Mayhew; +Cc: kdevops@lists.linux.dev



> On Apr 12, 2024, at 4:49 PM, Scott Mayhew <smayhew@redhat.com> wrote:
> 
> These patches add the ability to run fstests on CIFS.  The playbooks are
> very similar to their NFS counterparts.  The smbd playbook sets up a
> Samba server, but could be expanded to set up ksmbd in the future.  The
> following options are available:  plain SMB3, SMB3 with signing, and
> SMB3 with encryption.

You could also add SMB direct using siw, but maybe Samba doesn't
support that.


> The expunge files are based on the tests that were consistently failing
> on 6.8.4-200.fc39.x86_64, plus some tests that just take way too long
> (generic/476, generic/650).
> 
> -Scott
> 
> Scott Mayhew (6):
>  oscheck.sh: add some special cases for cifs
>  gendisks.sh: add special case for cifs
>  bringup: add a playbook to bring up an SMB server
>  playbooks: add a playbook to create smb shares
>  fstests: add an option for testing on CIFS
>  fstests: add expunges for cifs
> 
> Makefile                                      |   1 +
> kconfigs/Kconfig.bringup.goals                |   1 +
> kconfigs/Kconfig.smbd                         |  72 ++++++++++++
> 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 ++++++
> playbooks/roles/gen_hosts/defaults/main.yml   |   1 +
> .../roles/gen_hosts/templates/fstests.j2      |   6 +
> playbooks/roles/gen_nodes/defaults/main.yml   |   1 +
> playbooks/roles/gen_nodes/tasks/main.yml      |  19 ++++
> playbooks/roles/smbd/defaults/main.yml        |   5 +
> .../smbd/tasks/install-deps/debian/main.yml   |  31 ++++++
> .../roles/smbd/tasks/install-deps/main.yml    |  12 ++
> .../smbd/tasks/install-deps/redhat/main.yml   |  33 ++++++
> .../smbd/tasks/install-deps/suse/main.yml     |  29 +++++
> playbooks/roles/smbd/tasks/main.yml           |  95 ++++++++++++++++
> playbooks/roles/smbd/templates/smb.conf.j2    |  11 ++
> playbooks/roles/smbd/vars/Debian.yml          |  10 ++
> playbooks/roles/smbd/vars/RedHat.yml          |  12 ++
> playbooks/roles/smbd/vars/Suse.yml            |  10 ++
> playbooks/roles/smbd_add_share/README.md      |  57 ++++++++++
> .../roles/smbd_add_share/defaults/main.yml    |   5 +
> playbooks/roles/smbd_add_share/tasks/main.yml | 103 ++++++++++++++++++
> .../roles/smbd_add_share/templates/share.j2   |   7 ++
> playbooks/smbd.yml                            |   4 +
> scripts/smbd.Makefile                         |  20 ++++
> workflows/fstests/Kconfig                     |  20 +++-
> workflows/fstests/Makefile                    |   4 +
> workflows/fstests/cifs/Kconfig                |  75 +++++++++++++
> workflows/fstests/cifs/Makefile               |  17 +++
> .../expunges/any/cifs/unassigned/all.txt      |  60 ++++++++++
> .../any/cifs/unassigned/cifs_smb3_sign.txt    |   2 +
> workflows/fstests/scripts/gendisks.sh         |   2 +-
> workflows/fstests/scripts/oscheck.sh          |   8 +-
> 37 files changed, 818 insertions(+), 6 deletions(-)
> create mode 100644 kconfigs/Kconfig.smbd
> create mode 100644 playbooks/roles/fstests/templates/cifs/cifs.config
> create mode 100644 playbooks/roles/smbd/defaults/main.yml
> create mode 100644 playbooks/roles/smbd/tasks/install-deps/debian/main.yml
> create mode 100644 playbooks/roles/smbd/tasks/install-deps/main.yml
> create mode 100644 playbooks/roles/smbd/tasks/install-deps/redhat/main.yml
> create mode 100644 playbooks/roles/smbd/tasks/install-deps/suse/main.yml
> create mode 100644 playbooks/roles/smbd/tasks/main.yml
> create mode 100644 playbooks/roles/smbd/templates/smb.conf.j2
> create mode 100644 playbooks/roles/smbd/vars/Debian.yml
> create mode 100644 playbooks/roles/smbd/vars/RedHat.yml
> create mode 100644 playbooks/roles/smbd/vars/Suse.yml
> create mode 100644 playbooks/roles/smbd_add_share/README.md
> create mode 100644 playbooks/roles/smbd_add_share/defaults/main.yml
> create mode 100644 playbooks/roles/smbd_add_share/tasks/main.yml
> create mode 100644 playbooks/roles/smbd_add_share/templates/share.j2
> create mode 100644 playbooks/smbd.yml
> create mode 100644 scripts/smbd.Makefile
> create mode 100644 workflows/fstests/cifs/Kconfig
> create mode 100644 workflows/fstests/cifs/Makefile
> create mode 100644 workflows/fstests/expunges/any/cifs/unassigned/all.txt
> create mode 100644 workflows/fstests/expunges/any/cifs/unassigned/cifs_smb3_sign.txt
> 
> -- 
> 2.44.0
> 
> 

--
Chuck Lever



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 5/6] fstests: add an option for testing on CIFS
  2024-04-12 20:49 ` [PATCH 5/6] fstests: add an option for testing on CIFS Scott Mayhew
@ 2024-04-12 21:42   ` Luis Chamberlain
  2024-04-16 21:56     ` Scott Mayhew
  0 siblings, 1 reply; 13+ messages in thread
From: Luis Chamberlain @ 2024-04-12 21:42 UTC (permalink / raw)
  To: Scott Mayhew; +Cc: kdevops

On Fri, Apr 12, 2024 at 04:49:59PM -0400, Scott Mayhew wrote:
> Signed-off-by: Scott Mayhew <smayhew@redhat.com>
> ---
> diff --git a/workflows/fstests/Kconfig b/workflows/fstests/Kconfig
> index c797b24..e6664bf 100644
> --- a/workflows/fstests/Kconfig
> +++ b/workflows/fstests/Kconfig
> 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_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

                                        btrfs / CIFS

> +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

I think you're just missing here the defaults for:

  * SMB3_SEAL
  * SMB3_SIGN

Otherwise looks good.

Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>

  Luis

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 0/6] Add an option for running fstests on CIFS
  2024-04-12 20:49 [PATCH 0/6] Add an option for running fstests on CIFS Scott Mayhew
                   ` (6 preceding siblings ...)
  2024-04-12 20:52 ` [PATCH 0/6] Add an option for running fstests on CIFS Chuck Lever III
@ 2024-04-12 21:46 ` Luis Chamberlain
  7 siblings, 0 replies; 13+ messages in thread
From: Luis Chamberlain @ 2024-04-12 21:46 UTC (permalink / raw)
  To: Scott Mayhew; +Cc: kdevops

On Fri, Apr 12, 2024 at 04:49:54PM -0400, Scott Mayhew wrote:
> These patches add the ability to run fstests on CIFS.  The playbooks are
> very similar to their NFS counterparts.  The smbd playbook sets up a
> Samba server, but could be expanded to set up ksmbd in the future.  The
> following options are available:  plain SMB3, SMB3 with signing, and
> SMB3 with encryption.
> 
> The expunge files are based on the tests that were consistently failing
> on 6.8.4-200.fc39.x86_64, plus some tests that just take way too long
> (generic/476, generic/650).

Seems like a great start:

Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>

  Luis

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 0/6] Add an option for running fstests on CIFS
  2024-04-12 20:52 ` [PATCH 0/6] Add an option for running fstests on CIFS Chuck Lever III
@ 2024-04-16 21:54   ` Scott Mayhew
  0 siblings, 0 replies; 13+ messages in thread
From: Scott Mayhew @ 2024-04-16 21:54 UTC (permalink / raw)
  To: Chuck Lever III; +Cc: kdevops@lists.linux.dev

On Fri, 12 Apr 2024, Chuck Lever III wrote:

> 
> 
> > On Apr 12, 2024, at 4:49 PM, Scott Mayhew <smayhew@redhat.com> wrote:
> > 
> > These patches add the ability to run fstests on CIFS.  The playbooks are
> > very similar to their NFS counterparts.  The smbd playbook sets up a
> > Samba server, but could be expanded to set up ksmbd in the future.  The
> > following options are available:  plain SMB3, SMB3 with signing, and
> > SMB3 with encryption.
> 
> You could also add SMB direct using siw, but maybe Samba doesn't
> support that.

I looked at it today, and it doesn't look like Samba supports SMB Direct
yet.

-Scott
> 
> 
> > The expunge files are based on the tests that were consistently failing
> > on 6.8.4-200.fc39.x86_64, plus some tests that just take way too long
> > (generic/476, generic/650).
> > 
> > -Scott
> > 
> > Scott Mayhew (6):
> >  oscheck.sh: add some special cases for cifs
> >  gendisks.sh: add special case for cifs
> >  bringup: add a playbook to bring up an SMB server
> >  playbooks: add a playbook to create smb shares
> >  fstests: add an option for testing on CIFS
> >  fstests: add expunges for cifs
> > 
> > Makefile                                      |   1 +
> > kconfigs/Kconfig.bringup.goals                |   1 +
> > kconfigs/Kconfig.smbd                         |  72 ++++++++++++
> > 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 ++++++
> > playbooks/roles/gen_hosts/defaults/main.yml   |   1 +
> > .../roles/gen_hosts/templates/fstests.j2      |   6 +
> > playbooks/roles/gen_nodes/defaults/main.yml   |   1 +
> > playbooks/roles/gen_nodes/tasks/main.yml      |  19 ++++
> > playbooks/roles/smbd/defaults/main.yml        |   5 +
> > .../smbd/tasks/install-deps/debian/main.yml   |  31 ++++++
> > .../roles/smbd/tasks/install-deps/main.yml    |  12 ++
> > .../smbd/tasks/install-deps/redhat/main.yml   |  33 ++++++
> > .../smbd/tasks/install-deps/suse/main.yml     |  29 +++++
> > playbooks/roles/smbd/tasks/main.yml           |  95 ++++++++++++++++
> > playbooks/roles/smbd/templates/smb.conf.j2    |  11 ++
> > playbooks/roles/smbd/vars/Debian.yml          |  10 ++
> > playbooks/roles/smbd/vars/RedHat.yml          |  12 ++
> > playbooks/roles/smbd/vars/Suse.yml            |  10 ++
> > playbooks/roles/smbd_add_share/README.md      |  57 ++++++++++
> > .../roles/smbd_add_share/defaults/main.yml    |   5 +
> > playbooks/roles/smbd_add_share/tasks/main.yml | 103 ++++++++++++++++++
> > .../roles/smbd_add_share/templates/share.j2   |   7 ++
> > playbooks/smbd.yml                            |   4 +
> > scripts/smbd.Makefile                         |  20 ++++
> > workflows/fstests/Kconfig                     |  20 +++-
> > workflows/fstests/Makefile                    |   4 +
> > workflows/fstests/cifs/Kconfig                |  75 +++++++++++++
> > workflows/fstests/cifs/Makefile               |  17 +++
> > .../expunges/any/cifs/unassigned/all.txt      |  60 ++++++++++
> > .../any/cifs/unassigned/cifs_smb3_sign.txt    |   2 +
> > workflows/fstests/scripts/gendisks.sh         |   2 +-
> > workflows/fstests/scripts/oscheck.sh          |   8 +-
> > 37 files changed, 818 insertions(+), 6 deletions(-)
> > create mode 100644 kconfigs/Kconfig.smbd
> > create mode 100644 playbooks/roles/fstests/templates/cifs/cifs.config
> > create mode 100644 playbooks/roles/smbd/defaults/main.yml
> > create mode 100644 playbooks/roles/smbd/tasks/install-deps/debian/main.yml
> > create mode 100644 playbooks/roles/smbd/tasks/install-deps/main.yml
> > create mode 100644 playbooks/roles/smbd/tasks/install-deps/redhat/main.yml
> > create mode 100644 playbooks/roles/smbd/tasks/install-deps/suse/main.yml
> > create mode 100644 playbooks/roles/smbd/tasks/main.yml
> > create mode 100644 playbooks/roles/smbd/templates/smb.conf.j2
> > create mode 100644 playbooks/roles/smbd/vars/Debian.yml
> > create mode 100644 playbooks/roles/smbd/vars/RedHat.yml
> > create mode 100644 playbooks/roles/smbd/vars/Suse.yml
> > create mode 100644 playbooks/roles/smbd_add_share/README.md
> > create mode 100644 playbooks/roles/smbd_add_share/defaults/main.yml
> > create mode 100644 playbooks/roles/smbd_add_share/tasks/main.yml
> > create mode 100644 playbooks/roles/smbd_add_share/templates/share.j2
> > create mode 100644 playbooks/smbd.yml
> > create mode 100644 scripts/smbd.Makefile
> > create mode 100644 workflows/fstests/cifs/Kconfig
> > create mode 100644 workflows/fstests/cifs/Makefile
> > create mode 100644 workflows/fstests/expunges/any/cifs/unassigned/all.txt
> > create mode 100644 workflows/fstests/expunges/any/cifs/unassigned/cifs_smb3_sign.txt
> > 
> > -- 
> > 2.44.0
> > 
> > 
> 
> --
> Chuck Lever
> 
> 


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 5/6] fstests: add an option for testing on CIFS
  2024-04-12 21:42   ` Luis Chamberlain
@ 2024-04-16 21:56     ` Scott Mayhew
  2024-04-17 13:50       ` Chuck Lever III
  0 siblings, 1 reply; 13+ messages in thread
From: Scott Mayhew @ 2024-04-16 21:56 UTC (permalink / raw)
  To: Luis Chamberlain; +Cc: kdevops

On Fri, 12 Apr 2024, Luis Chamberlain wrote:

> On Fri, Apr 12, 2024 at 04:49:59PM -0400, Scott Mayhew wrote:
> > Signed-off-by: Scott Mayhew <smayhew@redhat.com>
> > ---
> > diff --git a/workflows/fstests/Kconfig b/workflows/fstests/Kconfig
> > index c797b24..e6664bf 100644
> > --- a/workflows/fstests/Kconfig
> > +++ b/workflows/fstests/Kconfig
> > 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_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
> 
>                                         btrfs / CIFS
> 
> > +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
> 
> I think you're just missing here the defaults for:
> 
>   * SMB3_SEAL
>   * SMB3_SIGN
> 
> Otherwise looks good.

Thanks, I've fixed both items.  I'll wait for Chuck to push his nfstest
stuff and rebase on top of that to make sure there are no conflicts.

-Scott
> 
> Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
> 
>   Luis
> 


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 5/6] fstests: add an option for testing on CIFS
  2024-04-16 21:56     ` Scott Mayhew
@ 2024-04-17 13:50       ` Chuck Lever III
  0 siblings, 0 replies; 13+ messages in thread
From: Chuck Lever III @ 2024-04-17 13:50 UTC (permalink / raw)
  To: Scott Mayhew; +Cc: Luis Chamberlain, kdevops@lists.linux.dev



> On Apr 16, 2024, at 5:56 PM, Scott Mayhew <smayhew@redhat.com> wrote:
> 
> On Fri, 12 Apr 2024, Luis Chamberlain wrote:
> 
>> On Fri, Apr 12, 2024 at 04:49:59PM -0400, Scott Mayhew wrote:
>>> Signed-off-by: Scott Mayhew <smayhew@redhat.com>
>>> ---
>>> diff --git a/workflows/fstests/Kconfig b/workflows/fstests/Kconfig
>>> index c797b24..e6664bf 100644
>>> --- a/workflows/fstests/Kconfig
>>> +++ b/workflows/fstests/Kconfig
>>> 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_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
>> 
>>                                        btrfs / CIFS
>> 
>>> +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
>> 
>> I think you're just missing here the defaults for:
>> 
>>  * SMB3_SEAL
>>  * SMB3_SIGN
>> 
>> Otherwise looks good.
> 
> Thanks, I've fixed both items.  I'll wait for Chuck to push his nfstest
> stuff and rebase on top of that to make sure there are no conflicts.

I just tested nfstest on Debian and had to make some changes
to get the build/install step to work. I have to go back and
test on SuSE and Red Hat. So this will be a while. Go ahead
and push your work and I'll rebase when nfstest is ready.


--
Chuck Lever



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-04-17 13:50 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-12 20:49 [PATCH 0/6] Add an option for running fstests on CIFS Scott Mayhew
2024-04-12 20:49 ` [PATCH 1/6] oscheck.sh: add some special cases for cifs Scott Mayhew
2024-04-12 20:49 ` [PATCH 2/6] gendisks.sh: add special case " Scott Mayhew
2024-04-12 20:49 ` [PATCH 3/6] bringup: add a playbook to bring up an SMB server Scott Mayhew
2024-04-12 20:49 ` [PATCH 4/6] playbooks: add a playbook to create smb shares Scott Mayhew
2024-04-12 20:49 ` [PATCH 5/6] fstests: add an option for testing on CIFS Scott Mayhew
2024-04-12 21:42   ` Luis Chamberlain
2024-04-16 21:56     ` Scott Mayhew
2024-04-17 13:50       ` Chuck Lever III
2024-04-12 20:50 ` [PATCH 6/6] fstests: add expunges for cifs Scott Mayhew
2024-04-12 20:52 ` [PATCH 0/6] Add an option for running fstests on CIFS Chuck Lever III
2024-04-16 21:54   ` Scott Mayhew
2024-04-12 21:46 ` Luis Chamberlain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox