-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Supplementary group tests #63
Conversation
29a4f47
to
4a4789c
Compare
8f845a8
to
37c6e1a
Compare
76d7f7d
to
08863bc
Compare
test-info.yml.example
Outdated
@@ -9,12 +9,16 @@ public_interfaces: | |||
exported_sharenames: | |||
- "gluster-vol" | |||
|
|||
# List of dict of exported shares | |||
# name: share_name | |||
# mntdir: If this is a premounted share, the mount directory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can rephrase it as mount directory in case of a premounted share
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
testhelper/testhelper.py
Outdated
if "shares" in test_info: | ||
return test_info["shares"] | ||
|
||
default_fs = test_info.get("test_backend", None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary to use None here as default value when a key is not present in dict is already None
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
test-info.yml.example
Outdated
@@ -9,12 +9,16 @@ public_interfaces: | |||
exported_sharenames: | |||
- "gluster-vol" | |||
|
|||
# List of dict of exported shares |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be exported_shares: list of dict of exported shares
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
test-info.yml.example
Outdated
@@ -9,12 +9,16 @@ public_interfaces: | |||
exported_sharenames: | |||
- "gluster-vol" | |||
|
|||
# List of dict of exported shares | |||
# name: share_name | |||
# mntdir: If this is a premounted share, the mount directory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mntdir: mount directory in a premounted share
would sound better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
testhelper/testhelper.py
Outdated
""" | ||
Is the share dict a premounted share | ||
|
||
Paramters: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: parameters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
testhelper/testhelper.py
Outdated
|
||
def is_premounted_share(share: dict) -> bool: | ||
""" | ||
Is the share dict a premounted share |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check if the share is premounted
would sound better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
9aa05e0
to
8026a1d
Compare
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added few comments.
Rest of the implementation looks good to me.
test-info.yml.example
Outdated
@@ -9,12 +9,16 @@ public_interfaces: | |||
exported_sharenames: | |||
- "gluster-vol" | |||
|
|||
# exported_shares: List of dict of exported shares |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using multi line comment here similar to testheper.py would be better as it would appear more readable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an example file for yaml content. Yaml doesn't allow multi line comments like in Python.
test-info.yml.example
Outdated
@@ -9,12 +9,16 @@ public_interfaces: | |||
exported_sharenames: | |||
- "gluster-vol" | |||
|
|||
# exported_shares: List of dict of exported shares | |||
# name: share_name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just curious why we would need a separate exported_sharenames and again a name exported_shares.
Let me know if they are any different or there is any special use case? If not could we just use share name from exported_shares?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They have 2 different formats in the way they are expressed in the yaml. exported_sharenames is how it is currently reported but it only lists the shares exported from that sharename which is inadequate for a complex test. This is currently used by sit-environment to report the shares but in the future we want to move to providing additional information in exported_shares which the current exported_sharename field doesn't provide.
Since we have multiple projects, we have a chicken and egg problem. We can't make changes to one which will break the testing on the other. So for now, the changes ensure that both exported_sharenames and exported_shares are supported. Once these changes go in, I will put in a PR to move sit-environment to use exported_shares instead of exported_sharenames. Once changes go into both, we can consider removing support for exported_sharenames.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since SIT environment is becoming more configurable now, and it could provide more complex configurations in the near future, I think we should also make the test-info.yml configuration more flexible.
I would nest all configuration below each share, so that different share can have different configurations.
For example:
shares:
share-cephfs-vfs:
# If present, it means share is pre-mounted
path: /mnt/share/share-cephfs-vfs
backend:
name: cephfs
variant: vfs
# If present, this provides direct access to the backend, bypassing Samba
path: /mnt/backend/share
users:
test1: x
test2: x
addresses:
- 192.168.123.10
- 192.168.123.11
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. |
deb1772
to
bbc0173
Compare
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. |
We do not use this section in any of our current tests and I don't forsee the need for this in the near future. Signed-off-by: Sachin Prabhu <[email protected]>
Avoid directly accessing the test_info dict and use helper function instead. This will allow us to modify the test_info.yml with minimal disruption. Signed-off-by: Sachin Prabhu <[email protected]>
Change the way we list shares in test-info.yml This will be used to add additional functionality to tests. eg: shares: # share name export1 export1: # If present, it means the share is pre-mounted path: /mnt/share/export1-cephfs-vfs backend: # If present backend filesystem name: cephfs.vfs # If present, username to perform the tests with on this share users: test2: x # If present, the hostname to use to connect to the test server server: hostname1 export2: This commit still supports the old format of test-info.yml. The new changes deprecates the old test-info.yml format which can be removed once the sit-environment has been updated. Signed-off-by: Sachin Prabhu <[email protected]>
Add share["backend"]["path"] to indicate where direct access to the share is available. Add helper function get_shares_with_directmnt() to locate shares with direct access to the exported path available Signed-off-by: Sachin Prabhu <[email protected]>
Signed-off-by: Sachin Prabhu <[email protected]>
Depends on #73 |
Split this PR with the changes to test-info.yml now handled in #73. Please use this PR to comment on supplementary tests. |
🎉 All dependencies have been resolved ! |
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. |
*** 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.
This allows us to describe both plain exportes smbshares plus premounted shares and the backing filesystem.
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.
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