summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Allow tempurl to be used to sign /info requestsTim Burke2022-08-291-0/+26
| | | | Change-Id: I1f9d26541e9c8f5aec7a6790c87df397d178efe6
* Merge "Allow tempurl times to have units"4.1.0Zuul2022-08-252-0/+47
|\
| * Allow tempurl times to have unitsTim Burke2022-08-192-0/+47
| | | | | | | | | | | | | | Specifically, let users add a suffix for seconds, minutes, hours, or days. Change-Id: Ibbe7e5aa8aa8e54935da76109c2ea13fb83bc7ab
* | Merge "Add option to skip container PUT during upload"Zuul2022-08-231-0/+42
|\ \
| * | Add option to skip container PUT during uploadTim Burke2022-01-111-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, a user with read/write access to a container (but without access to creat new containers) recieves a warning every time they upload. Now, allow them to avoid the extra request and warning by specifying --skip-container-put on the command line. This is also useful when testing: developers can HEAD a container to ensure it's in memcache, shut down all container servers, then upload and creaate a bunch of async pendings. Previously, the 503 on container PUT would prevent the object upload from even being attempted. Closes-Bug: 1317956 Related-Bug: 1204558 Change-Id: I3d9129a0b6b65c6c6187ae6af003b221afceef47 Related-Change: If1f8a02ee7459ea2158ffa6e958f67d299ec529e
* | | Merge "Fix misuse of assertTrue"Zuul2022-08-191-3/+3
|\ \ \
| * | | Fix misuse of assertTrueTakashi Natsume2022-08-181-3/+3
| | |/ | |/| | | | | | | | | | | | | | | | | | | Replace assertTrue with assertEqual. Change-Id: Ia3524bc5b3b01c0039bede6bb172535eb85bac08 Closes-Bug: 1986948 Signed-off-by: Takashi Natsume <takanattie@gmail.com>
* | | Merge "Expand retry handling on ratelimit response"Zuul2022-08-191-24/+30
|\ \ \
| * | | Expand retry handling on ratelimit responseClay Gerrard2022-08-181-24/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have seen middlewares that return ratelimit responses as 498 or 429, so tolerate either. Closes-Bug: #1879572 Change-Id: I027222157f6c2ad7882a0508302c9de097baae4c
* | | | Merge "Enable retry_on_ratelimit by default"Zuul2022-08-191-1/+2
|\ \ \ \ | |/ / / | | / / | |/ / |/| |
| * | Enable retry_on_ratelimit by defaultTim Burke2022-08-181-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | UpgradeImpact ============= The Connection class now enables retry_on_ratelimit by default. If you need to return to the old behavior, explicitly pass retry_on_ratelimit=False as a keyword arg. The SwiftService class will now enables the retry_on_ratelimit option by default. If you need to return to the old behavior, explicitly set it to false in your options dict. Change-Id: I3221fda84f0b8031c50128aa600e2c19deb5b102
* | | Merge "More cleanup following py2 removal"Zuul2022-08-182-4/+3
|\ \ \ | |/ / |/| |
| * | More cleanup following py2 removalTim Burke2022-05-242-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Drop py2-only hacking pin from test-requirements. * Remove quote() helper; urllib.parse.quote() works fine. * Remove some useless code. Change-Id: I9ffc923f58f1d11538f83ff26f7beb53cdf134c3
* | | tempurl: Support sha256 and sha512 signatures4.0.1Tim Burke2022-06-082-44/+122
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Up the default to sha256 since * the proxy has supported (and defaulted to allowing) it for four years now, and * Rackspace has supported it for even longer. Include a note in the --help about older clusters likely requiring sha1. Change-Id: Ibac2bb7e2e4c9946c7384f0aab8e43d0d79ba645 Related-Change: Ia9dd1a91cc3c9c946f5f029cdefc9e66bcf01046 Related-Bug: #1733634 Closes-Bug: #1977867
* | Remove use of mockSteve Kowalik2022-05-247-40/+39
| | | | | | | | | | | | | | Since Python 3.4, the unittest module has provided mock, negating the need for the external dependancy. Switch to using unittest.mock. Change-Id: Idec3aaed2fddd1ece3ed86ee0bcc48f7616d56fa
* | Remove unnecessary unicode prefixesStephen Finucane2022-03-216-115/+115
| | | | | | | | | | | | | | | | All strings are unicode by default in Python 3. No need to mark them as such. Signed-off-by: Stephen Finucane <stephenfin@redhat.com> Change-Id: I68fb60ef271abfddebcc9d2137424f5db2a17e92
* | Remove unnecessary object subclassingStephen Finucane2022-03-213-9/+9
| | | | | | | | | | | | | | All classes subclass from object by default in Python 3. Signed-off-by: Stephen Finucane <stephenfin@redhat.com> Change-Id: I5a1ad57bcc092861ce969759b06a07c880ad3d35
* | Remove sixStephen Finucane2022-03-219-87/+63
| | | | | | | | | | | | | | This mostly affects tests. Nothing too complicated Signed-off-by: Stephen Finucane <stephenfin@redhat.com> Change-Id: Iabc78f651e1d48db35638280722f8019798eccd6
* | Remove coding commentsStephen Finucane2022-03-211-1/+0
| | | | | | | | | | | | | | Everything is unicode in Python 3. Signed-off-by: Stephen Finucane <stephenfin@redhat.com> Change-Id: I6a076dc67c461f265ed99878e3959e1992a88189
* | Remove __future__ importsStephen Finucane2022-03-212-2/+1
| | | | | | | | | | | | | | These aren't needed in modern Python 3 versions. Signed-off-by: Stephen Finucane <stephenfin@redhat.com> Change-Id: I5e81d6fb2e2cb8e4bfae4ed746da002f44e871c4
* | Don't patch Requests globally on importAarni Koskela2022-03-211-18/+2
| | | | | | | | | | | | | | | | | | | | This also upgrades the Requests dependency to 2.4+ (released in 2014) to avoid having to do version comparisons altogether. Refs https://bugs.launchpad.net/python-swiftclient/+bug/1904551 Signed-off-by: Aarni Koskela <akx@iki.fi> Change-Id: I58399f6c526b0b78462f31739c43076314ba9e76
* | Drop support for Python 2Stephen Finucane2022-03-161-27/+1
|/ | | | | | | There's a lot of cleanup possible, but this is a start. Signed-off-by: Stephen Finucane <stephenfin@redhat.com> Change-Id: Ia1176b7fd5434d52070d482a37abfbb98800cdb3
* Merge "Include storage policy when listing account with --long"3.13.0Zuul2021-10-131-8/+12
|\
| * Include storage policy when listing account with --longTim Burke2021-09-211-8/+12
| | | | | | | | Change-Id: Ibc2f9445b5a8e80cfb73d0706e20a7e4c62eec4a
* | Merge "Allow functional tests to pass with etag_quoter enabled by default"Zuul2021-09-241-7/+7
|\ \
| * | Allow functional tests to pass with etag_quoter enabled by defaultTim Burke2021-05-111-7/+7
| | | | | | | | | | | | Change-Id: I861b5e0a172f0ea0a5b1fe8389cd70da8d4b5d5d
* | | Merge "Allow unit tests to be run via pytest"Zuul2021-09-231-22/+30
|\ \ \ | |/ /
| * | Allow unit tests to be run via pytestTim Burke2021-05-111-22/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | You can run all tests by just running $ pytest Or just unit tests with $ pytest test/unit/ Or one specific test with $ pytest test/unit/test_swiftclient.py::TestConnection::test_reauth Change-Id: I1dfa239f9ee9ea85663b5c1f22631a97f87b4dfc
* | | Correctly aggregate totals for >10k itemsTim Burke2021-09-211-4/+9
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, we would write out totals for every page of listings, like $ swift list sync --prefix=09-21 --total -l 80000000000 80000000000 80000000000 58096000000 Now, roll those all into a single total: $ swift list sync --prefix=09-21 --total -l 298096000000 Change-Id: Icc265636815220e33e8c9eec0a3ab80e9f899038
* | Improve formatting for billions of objectsTim Burke2021-09-201-7/+9
|/ | | | Change-Id: If8aa08c4c8c8ad6ca2c861602baf1eefa8642a8a
* Have `delete --all` imply `--versions` for the CLITim Burke2020-10-161-3/+2
| | | | Change-Id: Id5a6d4cef3d4ed76c897a099a62a4ba3ed8f8dab
* Merge "Close connections created when calling module-level functions"Zuul2020-10-152-2/+5
|\
| * Close connections created when calling module-level functionsTim Burke2020-10-132-2/+5
| | | | | | | | | | | | | | | | Co-Authored-By: Clay Gerrard <clay.gerrard@gmail.com> Change-Id: Id62e63afc6f2ffa32eb8640787c78559481050f9 Related-Change: I200ad0cdc8b7999c3f5521b9a822122bd18714bf Related-Bug: #1873435 Closes-Bug: #1838775
* | Merge "tests: Make test_delete_container_versions less flakey"Zuul2020-10-141-1/+1
|\ \
| * | tests: Make test_delete_container_versions less flakeyTim Burke2020-09-211-1/+1
| |/ | | | | | | | | | | | | Hammering that test in a tight loop, I'd often see failures due to ordering issues. Make the delete single-threaded to avoid that. Change-Id: Iff45be32a7c3f258214cce78001fd33ad0a39b8c
* | Merge "Add cacert test config option"Zuul2020-09-234-2/+15
|\ \
| * | Add cacert test config optionTim Burke2020-04-134-2/+15
| | | | | | | | | | | | Change-Id: I3936f862e0fef176cad34f277598b136a40de1eb
* | | Include transaction ID in ClientException.__str__Tim Burke2020-09-091-0/+17
| |/ |/| | | | | | | | | | | | | | | | | It's fairly annoying getting a traceback in swift's probe tests then only having a URL and status code to go searching for in logs. Leave the shell.py output untouched, though, since we output the transaction ID on a new line anyway. Change-Id: Idb849848ec08b6c04812b088467c9a687c2a7e27
* | Speed up test_lazy_connectionsTim Burke2020-07-281-1/+1
| | | | | | | | | | | | It doesn't really need to sleep a full second. Change-Id: Ida80f0c5a983edb33a93662badb6aa1a25f9a27c
* | Clean up some warningsTim Burke2020-06-171-26/+26
| | | | | | | | Change-Id: Iae149533d04c7b173c4ef88fb775f5fe13c16466
* | Application credential support follow-upTim Burke2020-05-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Following the recent v3applicationcredentials patch, if you have your environment variables set up to work with python-openstackclient using swiftclient's v1password plugin, swiftclient won't work: $ env | egrep '^(OS|ST)_' ST_KEY=testing ST_USER=test:tester OS_AUTH_URL=http://saio/auth/v1.0 ST_AUTH=http://saio/auth/v1.0 OS_USERNAME=test:tester OS_AUTH_TYPE=v1password OS_PASSWORD=testing $ openstack object store account show +------------+----------------------------+ | Field | Value | +------------+----------------------------+ | Account | AUTH_test | | Bytes | 0 | | Containers | 11 | | Objects | 0 | +------------+----------------------------+ $ swift stat Only "v3applicationcredential" is supported for --os-auth-type We don't really want to allow (and mostly ignore) arbitrary OS_AUTH_TYPE values, though -- there are a whole bunch of plugins we don't remotely support. But it seems OK to allow any of the password plugins; while we won't actually use them (currently), we provide roughly equivalent functionality. Handful of other drive-bys: * Use a None sentinel to determine whether keystoneauth1 is installed instead of trying to catch a NameError. * Clarify error state when keystoneauth1 is not installed. * Fix a typo: "sses" -> "sess". Change-Id: Id7ea9c3ea8278ae86a04d057a472a8f8a87b8eae Related-Change: I9190e5e7e24b6a741970fa0d0ac792deccf73d25
* | Merge "Support v3 application credentials auth."Zuul2020-05-132-0/+103
|\ \
| * | Support v3 application credentials auth.Charles Hsu2020-04-162-0/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use keystoneauth1 application credential plugin and session to fetch a token and endpoint catalog url. $ swift --os-auth-url http://172.16.1.2:5000/v3 --auth-version 3\ --os-application-credential-id THE_ID \ --os-application-credential-secret THE_SECRET \ --os-auth-type v3applicationcredential auth Change-Id: I9190e5e7e24b6a741970fa0d0ac792deccf73d25 Closes-Bug: 1843901 Closes-Bug: 1856635
* | | Fixed capability discovery endpoint hardcodeIvan Kolodyazhny2020-04-241-0/+32
|/ / | | | | | | | | | | | | | | | | | | It fixes get_capabilities() method to process correctly endpoints like: 'https://<ip>:<port>/v1', 'https://<ip>:<port>/swift/v1'. Co-Authored-By: Daniel Cech <dcech@mirantis.com> Change-Id: Ib4037d0b49da1bce959947100629370805f510d5 Closes-bug: #1712358
* | Change recommended test config to use auth_uriTim Burke2020-04-131-8/+2
|/ | | | | | | ...instead of piecing it together from auth_host, auth_port, auth_ssl, auth_prefix, and (sort of, sometimes) auth_version. Change-Id: Ie9c36e778d6a03f905899074d7136b767812ea11
* Improve `list --versions` outputTim Burke2020-04-101-5/+48
| | | | | | | | | | Have `--versions` imply `--long` and add a new column for version_id. Also, have version-aware listings show all versions as "null" on old Swifts that don't support object versioning (or when object versioning is not enabled). Change-Id: I0e009bce2471d1c140ac9b83700591cb355fee3f
* object versioning featuresClay Gerrard2020-04-082-31/+448
| | | | | | | | | | * add --versions to list * add --versions to delete * add --version-id to stat * add --version-id to delete * add --version-id to download Change-Id: I89802064921778fee7efe57c7d60c976cdde3a27
* Add test for bulk-delete-attempt-counter fixTim Burke2019-11-151-1/+21
| | | | | | Change-Id: Ifdeefeb4a5a3fc6895bd6cda695684de02f8c602 Related-Change: If4af9141fe4f3436a4e9e0e2dfc24c6ec7292996 Related-Bug: #1852808
* v1auth: support endpoint_data_for() apiTim Burke2019-11-063-62/+208
| | | | | | | | ...so we can be used with openstacksdk. Also, add a few functests that use openstacksdk. Change-Id: Ie6987f5de48914ec8932254cde79a973a0264877
* Rename "tests" directory to be "test" like in the swift repoTim Burke2019-11-0613-0/+12224
In addition to being less confusing for devs, this lets us actually run tempauth tests in swiftclient dsvm jobs. The job definition (over in the swift repo) specifies test/sample.conf, which does not exist in this repo. As a result, those tests would skip with SKIPPING FUNCTIONAL TESTS DUE TO NO CONFIG Change-Id: I558dbf9a657d442e6e19468e543bbec855129eeb