summaryrefslogtreecommitdiff
path: root/tests/unit/test_shell.py
Commit message (Collapse)AuthorAgeFilesLines
* prefix-based tempurls supportChristopher Bartz2017-01-191-2/+31
| | | | | | | | | Implements client-side functionality for prefix-based tempurls. Please see: https://review.openstack.org/#/c/274048/ Change-Id: I8d7701daee888ed1120271a96c0660b01543ca2d
* Merge "modify 'swift <sub_command> —help' display"Jenkins2016-12-131-2/+5
|\
| * modify 'swift <sub_command> —help' displayShashirekha Gundur2016-12-131-2/+5
| | | | | | | | | | | | | | | | | | In python swiftclient: swift <sub_command> —help will now display st_<sub_command>_options + st_<sub_command>_help texts e.g. http://paste.openstack.org/show/589752/ Change-Id: I34e4b2ac29ef395f8ca474ce7a82f59a1fd8c7f4 Closes-Bug: #1621415
* | Merge "Add additional headers for HEAD/GET/DELETE requests."Jenkins2016-11-081-27/+170
|\ \ | |/ |/|
| * Add additional headers for HEAD/GET/DELETE requests.Charles Hsu2016-11-071-27/+170
| | | | | | | | | | Change-Id: I69276ba711057c122f97deac412e492e313c34dd Closes-Bug: 1615830
* | Replace assertTrue(a in b) with assertIn(a, b)Anh Tran2016-10-031-4/+4
|/ | | | Change-Id: I9726c9c051eea9264200ab27b3e556c68d5c927f
* Merge "Fix intermittent test failure"Jenkins2016-09-141-3/+7
|\
| * Fix intermittent test failureTim Burke2016-09-011-3/+7
| | | | | | | | | | | | | | The mock needs to be initialized before calling main, or we get a race to create it between all the uu_threads Change-Id: If7649da13ed9276d7f0e005e999770e09c022a3f
* | Make tempurl command check for valid object pathAlistair Coles2016-09-141-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If the supplied path is not of the form /v1/a/c/o then swift tempurl subcommand will now return an error message. Also removes redundant check for seconds parameter being an int from shell.py because the same check is made when calling utils.generate_temp_url. Drive-by fix for missing param definition for generate_temp_url. Change-Id: I41f4389948b01fadaa5fc4939ea12e0ed2167345 Related-Change: I0fb2ce125fe12d660e4deb778265016bdd5ff31b
* | Make options arguments truely optionalChristian Schwede2016-09-061-0/+16
|/ | | | | | | | | | | | | | Currently the options help, info and debug must exist in the options dictionary; however it might be that this is not the case if a method is imported externally. This patch fixes this. Also support using a storage URL or path as an argument for tempurl, and adding a test to verify correct output in both cases. Related-Bug: 1607519 Related-Bug: 1607523 Closes-Bug: 1607521 Change-Id: I0fb2ce125fe12d660e4deb778265016bdd5ff31b
* Merge "Add copy object method"Jenkins2016-08-241-0/+133
|\
| * Add copy object methodMarek Kaleta2016-08-231-0/+133
| | | | | | | | | | | | | | | | | | | | | | Implement copy object method in swiftclient Connection, Service and CLI. Although COPY functionality can be accomplished with 'X-Copy-From' header in PUT request, using copy is more convenient especially when using copy for updating object metadata non-destructively. Closes-Bug: 1474939 Change-Id: I1338ac411f418f4adb3d06753d044a484a7f32a4
* | Add --json option to `swift capabilities` / `swift info`Tim Burke2016-08-021-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This lets us do things like: $ swift info --json | jq '[.swift.policies[].name]' [ "Standard-Replica", "EC" ] Also, escape more dashes in the man page, so they won't be misinterpreted as hyphens. Change-Id: Ic7690bdbcfc55f55e5dde9bc11bb0644085973ce
* | Merge "Add an option: disable etag check on downloads"Jenkins2016-06-061-0/+18
|\ \
| * | Add an option: disable etag check on downloadsCheng Li2016-06-021-0/+18
| |/ | | | | | | | | | | | | | | This patch is to add an option of disable etag check on downloads. Change-Id: I9ad389dd691942dea6db470ca3f0543eb6e9703e Closes-bug: #1581147
* | Suppress InsecureRequestWarning when using --insecureTim Burke2016-06-011-10/+18
|/ | | | | | | | | The user already knows this is insecure, there's no point in bringing it up again and again. See also: https://github.com/kennethreitz/requests/issues/2214 Change-Id: I7991b2e568407269f84138bc03711147ed080c9c
* Merge "Support client certificate/key"Jenkins2016-05-191-1/+3
|\
| * Support client certificate/keyCedric Brandily2016-04-101-1/+3
| | | | | | | | | | | | | | | | | | This change enables to specify a client certificate/key with: * usual CLI options (--os-cert/--os-key) * usual environment variables ($OS_CERT/$OS_KEY) Closes-Bug: #1565112 Change-Id: I12e151adcb6084d801c6dfed21d82232a3259aea
* | Merge "Tighten up testing for sloppy auth version"Jenkins2016-05-081-4/+10
|\ \
| * | Tighten up testing for sloppy auth versionAlistair Coles2016-05-051-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The existing test that os-identity-api-version=2 would result in the correct auth_version=2.0 (note 2 -> 2.0) does not verify the sloppy version handling code path. When auth, key and user options are all missing the auth version is always set to 2.0 so the test will always pass. Adding auth, key and user options to the test command will cause the test to verify that the os-identity-api-version option was used and mapped to 2.0. Change-Id: Ifa10cd2b8bf81c082d5e3fa846f993871194fea0
* | | Default to v3 auth if we find a (user|project)-domain-(name|id) optionTim Burke2016-05-031-0/+29
|/ / | | | | | | Change-Id: I4616492752b620de0bf90672142f1071ec9bac83
* | Pull option processing out to service.pyTim Burke2016-05-031-0/+37
| | | | | | | | | | | | | | ...because it seems silly that we do nearly the same thing in two different places Change-Id: Iafafe3c553d00652adb91ceefd0de1479cbcb5da
* | Parse options to dictTim Burke2016-05-031-6/+6
| | | | | | | | | | | | | | This is a first step toward unifying the options parsing magic between shell.py and service.py Change-Id: If001e07978c0bae729ac0cd9b2c2934092c98447
* | Merge "Add tests for thread option validation"Jenkins2016-05-021-0/+95
|\ \ | |/ |/|
| * Add tests for thread option validationTim Burke2016-03-171-0/+95
| | | | | | | | Change-Id: If84714c7ea6be1c95c5898a82db2d4b6c9637242
* | Merge "Port from optparse to argparse"Jenkins2016-04-081-15/+18
|\ \
| * | Port from optparse to argparseTim Burke2016-04-061-15/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why now? * argparse was introduced in Python 3.2 and back-ported to Python 2.7. Until we dropped Python 2.6 support, we were stuck on optparse. * keystoneauth.loading.cli provides register_argparse_arguments and load_from_argparse_arguments helper methods. Now that we're moving toward Keystone Session support, argparse seems required. Closes-Bug: 1553030 Change-Id: I5139fb64a8631a3010680090fd04345f95c55c7b
* | | Merge "Initialize delete_object mock *before* creating all the threads"Jenkins2016-03-181-0/+1
|\ \ \
| * | | Initialize delete_object mock *before* creating all the threadsTim Burke2016-03-171-0/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, we'd occasionally get spurious failures like FAIL: test_delete_account (tests.unit.test_shell.TestShell) ---------------------------------------------------------------------- Traceback (most recent call last): File ".../mock/mock.py", line 1721, in _inner return f(*args, **kw) File ".../mock/mock.py", line 1305, in patched return func(*args, **keywargs) File ".../tests/unit/test_shell.py", line 788, in test_delete_account response_dict={})], any_order=True) File ".../mock/mock.py", line 983, in assert_has_calls ), cause) File ".../six.py", line 718, in raise_from raise value AssertionError: (call(u'container', u'object', query_string=None, response_dict={}),) not all found in call list Related-Bug: #1539536 Related-Bug: #1480223 Change-Id: I810894545ca74d3b2f2dbde2d0388eb69c2ba710
* | | Merge "Include response headers in ClientExceptions"Jenkins2016-03-171-2/+31
|\ \ \ | |/ / |/| |
| * | Include response headers in ClientExceptionsTim Burke2016-03-031-2/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now, client applications can get to things like transaction IDs for failures without needing to turn on all of logging. While we're at it, add a from_response factory method for ClientException. Co-Authored-By: Alexander Corwin <ancorwin@gmail.com> Change-Id: Ib46d5f8fc7f36f651f5908bb9d900316fdaebce3
* | | Initialise delete_object mock before it's calledMin Min Ren2016-03-051-1/+1
|/ / | | | | | | | | | | | | | | | | Fix the linked bug. delete_object mock should be before it's called by swiftclient.shell.main function. Related: https://review.openstack.org/221219 Change-Id: I52143a93c129764c02bba05267f3563c824e82cb Partial-Bug: #1480223
* | Merge "Drop testtools from test-requirements.txt"Jenkins2016-03-011-19/+18
|\ \ | |/ |/|
| * Drop testtools from test-requirements.txtTim Burke2016-02-121-19/+18
| | | | | | | | | | | | | | | | | | | | | | My understanding is that it was mainly being used so we could have sane testing on py26. With py26 support being dropped, we no longer need it. Also drop discover from test-requirements.txt, as we don't seem to actually use it. Change-Id: Iee04c42890596d3b483c1473169480a3ae19aac8 Related-Change: I37116731db11449d0c374a6a83a3a43789a19d5f
* | Merge "Display proper name when failing to create segments container"Jenkins2016-02-171-0/+48
|\ \ | |/ |/|
| * Display proper name when failing to create segments containerTim Burke2016-02-101-0/+48
| | | | | | | | | | | | Previously, we displayed the base container's name. Change-Id: I70f1949a44ba61158e31178e4536f229c37aab47
* | Merge "Add test for --debug taking precedence over --info"Jenkins2016-02-111-1/+19
|\ \
| * | Add test for --debug taking precedence over --infoAlistair Coles2016-02-111-1/+19
| | | | | | | | | | | | Change-Id: Ibf0903817852edb36389028383a35e0d65f88a26
* | | Merge "Fix debug and info option parsing"Jenkins2016-02-111-0/+15
|\ \ \ | |/ /
| * | Fix debug and info option parsingChristian Schwede2015-12-301-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The debug and info options need to be set before a subcommand method is called, otherwise they are simply ignored. This is kind of irritating - other options (for example -U, -A, -K) are usable after a positional command. This patch fixes this, and commands like these are no longer ignoring --debug or --info: swift stat --debug swift list container --info Co-Authored-By: Alistair Coles <alistair.coles@hpe.com> Change-Id: Ib19b05deef7a015881f1eed4a3946025e16bf922
* | | Merge "Support --os-identity-api-version option"Jenkins2016-02-111-9/+95
|\ \ \ | |_|/ |/| |
| * | Support --os-identity-api-version optionAlistair Coles2016-02-051-9/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for the auth-version to be specified using --os-identity-api-version or OS_IDENTITY_API_VERSION for compatibility with other openstack client command line options. The auth version used will be selected as follows: - if either --auth-version or --os-identity-api-version is set, use that value - otherwise use the value of ST_AUTH_VERSION, if set - otherwise use the value of OS_AUTH_VERSION, if set - otherwise (new behaviour) use the value of OS_IDENTITY_API_VERSION, if set - otherwise default to 1.0 Note that before this change the auth version might have defaulted to 1.0 despite OS_IDENTITY_API_VERSION being set, but with this change OS_IDENTITY_API_VERSION is preferred. Change-Id: Ifba4c4e43560ede3013337b8cdbc77dc2de6e8ff Closes-Bug: #1541273
* | | Merge "Fix segmented upload to pseudo-dir via <container>"Jenkins2016-02-101-2/+29
|\ \ \
| * | | Fix segmented upload to pseudo-dir via <container>James Nzomo2016-02-041-2/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fix ensures creation and use of the correct default segment container when pseudo-folder paths are passed via <container> arg. Change-Id: I90356b041dc9dfbd55eb341271975621759476b9 Closes-Bug: 1532981 Related-Bug: 1478210
* | | | Merge "Fix intermittent fail of test_delete_bulk_account"Jenkins2016-02-041-16/+25
|\ \ \ \ | |_|/ / |/| | |
| * | | Fix intermittent fail of test_delete_bulk_accountAlistair Coles2016-02-011-16/+25
| |/ / | | | | | | | | | | | | | | | | | | | | | The test asserts calls made in specific order, but they are made from threads so may be in different order. Change-Id: I857ad3b909c3b635927fb1a39682d66d20c6fd59
* | | Merge "Fix intermittent fail of test_delete_account"Jenkins2016-02-011-8/+10
|\ \ \
| * | | Fix intermittent fail of test_delete_accountAlistair Coles2016-02-011-8/+10
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | The test asserts calls made in specific order, but they are made from threads so may be in different order. Change-Id: I1b6e7303fe0e6fb2afc7da3462b891feab90bc17 Closes-Bug: #1539536
* | | Merge "Prevent test runs from cluttering current directory"Jenkins2016-01-291-35/+52
|\ \ \ | |/ / |/| |
| * | Prevent test runs from cluttering current directoryTim Burke2016-01-191-35/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the following empty directories would be created: * container * container/pseudo * pseudo Change-Id: I002e2da8d28a873728e0b5c2d33f94f21132d058