summaryrefslogtreecommitdiff
path: root/python/samba/tests/smbconf.py
AgeCommit message (Collapse)AuthorFilesLines
2023-12-21python:tests: Don’t needlessly create single‐element tupleJoseph Sutton1-1/+1
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-08-30python:tests: Rename test method so as not to mask previously-defined methodJoseph Sutton1-1/+1
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2022-06-08lib/smbconf: expose smbconf error codes to python wrapperJohn Mulligan1-0/+21
The smbconf library defines an enum of error codes that can be returned from the C calls. The error codes were getting stored in the python SMBConfError type but it was not easy to access or obvious what the integer code represented. This change makes it easier to get the returned error code: via a `error_code` attribute on the exception value. It also exposes the integer constants to the module. Simple tests for a few of the more obvious error codes check that this new error handling correctly exposes the error code values. Signed-off-by: John Mulligan <jmulligan@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Wed Jun 8 13:13:10 UTC 2022 on sn-devel-184
2022-05-06lib/smbconf: add python wrapper functions for transaction managementJohn Mulligan1-0/+65
The smbconf API supports transactions. This changes adds wrapper functions transaction_start, transaction_commit, and transaction_cancel. It also adds tests for the functions, one of which demonstrates a semi-pythonic way to use said functions. Signed-off-by: John Mulligan <jmulligan@redhat.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri May 6 18:14:30 UTC 2022 on sn-devel-184
2022-05-06lib/smbconf: add delete_global_parameter method to SMBConfJohn Mulligan1-0/+25
Add a delete_global_parameter method wrapping smbconf_delete_global_parameter. Signed-off-by: John Mulligan <jmulligan@redhat.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2022-05-06lib/smbconf: add delete_parameter method to SMBConfJohn Mulligan1-0/+24
Add a delete_parameter method wrapping smbconf_delete_parameter. Signed-off-by: John Mulligan <jmulligan@redhat.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2022-05-06lib/smbconf: add create_set_share method to SMBConfJohn Mulligan1-0/+26
Add the create_set_share method wrapping smbconf_create_set_share. This method is one of the most complex as it must "unpack" the list of key-value pairs from python and convert that to a `struct smbconf_service` for the smbconfig C API. Signed-off-by: John Mulligan <jmulligan@redhat.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2022-05-06lib/smbconf: add delete_share method to SMBConfJohn Mulligan1-0/+13
Add a delete_share method wrapping smbconf_delete_share. Signed-off-by: John Mulligan <jmulligan@redhat.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2022-05-06lib/smbconf: add set_global_parameter method to SMBConfJohn Mulligan1-0/+11
Add a set_global_parameter method wrapping smbconf_set_global_parameter. Signed-off-by: John Mulligan <jmulligan@redhat.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2022-05-06lib/smbconf: add set_parameter method to SMBConfJohn Mulligan1-0/+12
Add a set_parameter method wrapping smbconf_set_parameter. Signed-off-by: John Mulligan <jmulligan@redhat.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2022-05-06lib/smbconf: add drop method to SMBConfJohn Mulligan1-0/+9
Add a drop method wrapping smbconf_drop. Signed-off-by: John Mulligan <jmulligan@redhat.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2022-05-06lib/smbconf: add create_share method to SMBConfJohn Mulligan1-0/+10
Add a create_share method wrapping smbconf_create_share. Signed-off-by: John Mulligan <jmulligan@redhat.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2022-05-06python/samba/tests: add test cases for s3/registry init funcsJohn Mulligan1-0/+34
A previous change added smbconf initialization functions that allow access to the registry back-end. Add some simple tests cases that exercise these new functions. Signed-off-by: John Mulligan <jmulligan@redhat.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2022-04-21python/samba/tests: add SMBConfTests suiteJohn Mulligan1-0/+102
Add an initial suite of tests for the smbconf python bindings. Currently only simple read-only methods are available. Signed-off-by: John Mulligan <jmulligan@redhat.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz Reviewed-by: David Mulder <dmulder@suse.com> Reviewed-by: Guenther Deschner <gd@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Thu Apr 21 15:33:38 UTC 2022 on sn-devel-184