Skip to content
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

testhelper/smbclient.py: use smbprotocol python module #84

Merged
merged 2 commits into from
Jun 28, 2024

Conversation

spuiuk
Copy link
Collaborator

@spuiuk spuiuk commented Jun 18, 2024

pysmb only support SMB2.0 version. The samba-container defaults to using SMB2.1 protocol and we are unable to use pysmb to connect to the samba server. This is a major issue.

The smbprotocol python module avoids this problem.

@spuiuk spuiuk force-pushed the smbprotocol branch 7 times, most recently from 1c792b7 to c9012f1 Compare June 26, 2024 15:08
@spuiuk spuiuk force-pushed the smbprotocol branch 2 times, most recently from 7e52991 to b8d9e95 Compare June 26, 2024 16:26
testhelper/smbclient.py Outdated Show resolved Hide resolved
testhelper/smbclient.py Show resolved Hide resolved
@spuiuk spuiuk force-pushed the smbprotocol branch 2 times, most recently from 3b4217b to 38c286e Compare June 27, 2024 14:07
Copy link
Collaborator

@synarete synarete left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks better. See nit comment.

testhelper/smbclient.py Outdated Show resolved Hide resolved
testhelper/smbclient.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@Shwetha-Acharya Shwetha-Acharya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

except for the line 11 change, commented about already, rest of the things look good to me

spuiuk added 2 commits June 28, 2024 12:51
pysmb only support SMB2.0 version. The samba-container defaults to using
SMB2.1 protocol and we are unable to use pysmb to connect to the samba
server. This is a major issue.

The smbprotocol python module avoids this problem.

Signed-off-by: Sachin Prabhu <[email protected]>
The smbclient high level calls make use of a global configuration which
ends up reusing the client guid. This doesn't work for us in our multi
client testing.

Make use of some low level calls at the point of setting up the
connection so that we use different client guids for each connection.

This particular workaround requires setting the connection cache
bypassing the methods available in the smbclient module. Setting this as
a separate commit to highlight the part which may break if the
underlying implementation is changed in the future.

Signed-off-by: Sachin Prabhu <[email protected]>
@spuiuk spuiuk merged commit bd02302 into samba-in-kubernetes:main Jun 28, 2024
7 of 10 checks passed
@spuiuk spuiuk deleted the smbprotocol branch June 28, 2024 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants