samba-in-kubernetes / sit-test-cases

SIT (Samba Integration Tests) Automated Test Cases
0 stars 4 forks source link

Add Supplementary group tests #63

Closed spuiuk closed 2 months ago

spuiuk commented 5 months ago

EDIT - Step 1 is now handled in PR #73. Please use this PR only for the supplementary group tests Step 1: Change the way we describe exports in the test-info.yml file.

1) Introduce exported_shares option.

exported_shares:
  - {"name": "export2"}
  - {"name": "export3", "mntdir": "/mnt-cephfs", "fs": "cephfs"}

This allows us to describe both plain exportes smbshares plus premounted shares and the backing filesystem.

2) remove section premounted_shares. These aren't used in the automated testing yet and can be described through exported_shares section.

Step 2: Add supplementary group test.

The motivation for making this changes is to cater to a new type of tests which require access to the underlying filesystem outside of SMB/samba. Changes to test-info.yml allow an easy way to describe an exported share where I also give the location of the direct mount so that we can perform these filesystem operations.

The new test added is a Supplementary group test where the following requirements are needed. 1) user defined in test-info.yml should be part of the sg supplementary group. 2) Access to the backend fs outside of SMB is needed - We need to setup a directory to which the supplementary group has write access. We test if the user who is part of the supplementary group has write access. In this case, we cannot write to the backend using vfs_cephfs module but the write on a filesystem mounted using the ceph-fuse module works fine.

Depends on #73

spuiuk commented 4 months ago

May be you can describe this change in more detail in the commit message (misc: Add test for supplementary groups for some of us to know better about the need of test for supplementary groups

Instead of the commit message, I've added it to the python file directly. This allows users to get the information directly from the test files.

spuiuk commented 4 months ago

Thanks, As discussed on chat, we will also add options to add default options which will make it easier to write the test-info.yml files manually.

spuiuk commented 3 months ago

I have uploaded the latest changes. The supplementary tests will not be automatically run in the sit-environment since we have not setup backend filesystems and the sit-environment will have to be modified to use the new format for test-info.yml before we can run the supplementary tests.

However the changes introduced here changes the way we layout the environment in test-info.yml.

spuiuk commented 3 months ago

Depends on #73

spuiuk commented 3 months ago

Split this PR with the changes to test-info.yml now handled in #73. Please use this PR to comment on supplementary tests.

dpulls[bot] commented 3 months ago

:tada: All dependencies have been resolved !

spuiuk commented 2 months ago

Closing this issue in favour of PR #79.

There are several changes made to the underlying code which necessitates re-writing a large part of the testing infrastructure. This includes the changes to the way test-info.yaml is specified as well as using the pysmb module to connect to the remote smb server.