From a42697c808961070a9a198f62651404f5b644736 Mon Sep 17 00:00:00 2001 From: Xiaoli Feng Date: Tue, 21 May 2024 13:59:25 +0800 Subject: [PATCH] Add simple tests for gating tests As before, cifs-utils gating tests don't do anything tests. Now add some simple tests. Such as mount/umount cifs. Signed-off-by: Xiaoli Feng --- gating.yaml | 4 ++-- tests/sanity/runtest.sh | 24 ++++++++++++++++++++++++ tests/tests.yml | 16 ++++++++++++++++ 3 files changed, 42 insertions(+), 2 deletions(-) create mode 100755 tests/sanity/runtest.sh create mode 100644 tests/tests.yml diff --git a/gating.yaml b/gating.yaml index a5b2e45..648918d 100644 --- a/gating.yaml +++ b/gating.yaml @@ -1,6 +1,6 @@ --- !Policy product_versions: - - rhel-10 + - rhel-9 decision_context: osci_compose_gate rules: - - !PassingTestCaseRule {test_case_name: manual.sst_filesystems.cifs-utils.buildbot} + - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} diff --git a/tests/sanity/runtest.sh b/tests/sanity/runtest.sh new file mode 100755 index 0000000..68a4be5 --- /dev/null +++ b/tests/sanity/runtest.sh @@ -0,0 +1,24 @@ +#!/usr/bin/bash +set -x +CIFS_SHARE=$PWD/cifs-share +CIFS_MNT=$PWD/cifs-mnt +mount.cifs -V +cp /etc/samba/smb.conf /etc/samba/smb.conf.bark +cat << __EOF__ >/etc/samba/smb.conf +[cifs] +path=$CIFS_SHARE +writeable=yes +__EOF__ + +testparm -s +mkdir -p $CIFS_SHARE $CIFS_MNT +chcon -t samba_share_t $CIFS_SHARE +setsebool -P samba_export_all_rw on +echo -e "redhat\nredhat" | smbpasswd -a root -s +systemctl start smb +sleep 5 +mount //localhost/cifs $CIFS_MNT -o user=root,password=redhat +ls -l $CIFS_MNT +umount $CIFS_MNT +cp /etc/samba/smb.conf.bark /etc/samba/smb.conf +rm -rf $CIFS_SHARE $CIFS_MNT diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..039084f --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,16 @@ +- hosts: localhost + roles: + - role: standard-test-basic + tags: + - classic + tests: + - simple: + dir: sanity + run: ./runtest.sh + required_packages: + - which + - samba + - samba-client + - coreutils + - policycoreutils + - systemd