summaryrefslogtreecommitdiff
path: root/tests/unit/test_service.py
Commit message (Collapse)AuthorAgeFilesLines
...
* | Merge "SwiftClient object upload beginning with / or "./""Jenkins2015-07-071-4/+41
|\ \ | |/ |/|
| * SwiftClient object upload beginning with / or "./"Pradeep Kumar Singh2015-06-171-4/+41
| | | | | | | | | | | | | | | | | | Currently SwiftClient populate response dictionary before removing "./" or "/" at begining of object name. This patch fixes that by changing that order. Closes-bug: #1412425 Change-Id: I80222754caba5d42a468f4677ac539e46682dd31
* | Compare each chunk of large objects when downloadingTim Burke2015-05-271-0/+365
| | | | | | | | | | | | | | | | This allows the use of --skip-identical when downloading SLOs and DLOs, while still only requiring one request for normal objects. Change-Id: I237ec5a8cc4d1119b6d3f166db81a977a50a4e4e Related-Bug: #1379252
* | Remove simplejson dependencyTim Burke2015-05-201-2/+2
|/ | | | | | | In addition to removing an unnecessary dependency, this closes another hole that was allowing raw bytes to appear in user-facing messages. Change-Id: Ia0b76426a38e5a5c368c4c7e7ba2aef286758aca
* Merge "Compare each chunk of large objects when uploading"Jenkins2015-04-301-0/+128
|\
| * Compare each chunk of large objects when uploadingTim Burke2015-03-231-0/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, we compared the ETag from Swift against the MD5 of the entire large object. However, the ETag for large objects is generally the MD5 of the concatenation of the ETags for each segment, unless the object is a DLO whose segments span more than one page of a container listing. Rather than worry about ETags, just compare each chunk of the segmented file. This allows the use of --skip-identical when uploading SLOs and DLOs. Additionally, there are several test-related improvements: * The default arguments for OutputManager are now evaluated on construction, rather than on definition, so that TestOutputManager.test_instantiation will succeed when using nosetest as a test runner. (See also: bug 1251507) * An account_username option is now available in the functional tests config file for auth systems that do not follow the account:username format. * CaptureOutput no longer writes to the captured stream, and MockHttpTest now captures output. These were polluting test output unnecessarily. (See also: bug 1201376) Change-Id: Ic484e9a0c186c9283c4012c6a2fa77b96b8edf8a Closes-Bug: #1201376 Closes-Bug: #1379252 Related-Bug: #1251507
* | Add improvements to MD5 validation.Daniel Wakefield2015-03-041-17/+60
|/ | | | | | | | | | | | | | | With MD5Sum checking being added, a concern was brought up that It was a change with no possibility of reverting to the old behaviour. This change adds the flag '--ignore-checksum' to the upload subcommand allowing the checks to be turned off. Changed occurrences of the magic string for a null md5 to use a descriptive constant instead. Updated Error messages generated when validation fails. They should now be more descriptive and not output a literal newline sequence. Change-Id: Id1756cbb6700bb7e38f0ee0e75bc535e37f777ed
* Verify MD5 of uploaded objects.Daniel Wakefield2015-02-191-1/+270
| | | | | | | | | | | Changed existing code to calculate the MD5 of the object during the upload stream. Checks this MD5 against the etag returned in the response. An exception is raised if they do not match. Closes-Bug: 1379263 Change-Id: I6c8bc1366dfb591a26d934a30cd21c9e6b9a04ce
* Merge "This patch fixes downloading files to stdout."Jenkins2015-02-031-23/+18
|\
| * This patch fixes downloading files to stdout.Joel Wright2015-01-231-23/+18
| | | | | | | | | | | | | | | | | | | | | | | | This patch fixes downloading files to stdout and modifies _SwiftReader to operate as an iterator that performs file checks at the end of iteration as well as a context manager. File verification checks have been removed from __exit__ and added to __iter__. Change-Id: I3250bdeeef8484a9122c4b5b854756a7c8f8731e Closes-Bug: 1395922 Closes-Bug: 1387376
* | Fix environment sanitization for TestServiceUtilsClay Gerrard2015-01-211-1/+3
|/ | | | | | | | | | | | I'm not sure how test_process_options_defaults ever passed for anyone that had all the ST_(AUTH|USER|KEY) set in their environment when they ran it. Despite our efforts to patch os.environ swiftclient.servce was acctually importing environ from os and then sticking the results into some global state. The tests seemed to work fine on infra, but for me locally until I `unset ST_AUTH` the test would always fail. Seems to work now and looks fairly reasonable on the surface. Change-Id: Id68590d6af16040a2877e719bc38d1e126603e42
* Fix misplaced check for None in SwiftUploadObject.Daniel Wakefield2014-12-161-3/+191
| | | | | | | | | | | | Check for None was being done after a method call which caused an attribute error if the value was None. The Method call was also a mistake and has been corrected to the hasattr function like intended. Added Tests. Closes-Bug: 1392651 Change-Id: Ifb1c84e26533bccbaddcce5738f434f36feca74e
* Fix misnamed dictionary key.Daniel Wakefield2014-12-081-3/+225
| | | | | | | | | | | | | The response dictionary in _delete_segment attach's any error it encounters to the dict key 'exception', all other response dict's use 'error' to store the exception. Changed to make it consistent and added tests Also added a third branch in st_delete as messages created in _delete_container where being silently dropped. Change-Id: Ifbc3b1fae78910fbc6acf4a86cfb0f60bb1aa336
* Fix misnamed variable in SwiftReader.Daniel Wakefield2014-11-071-0/+111
| | | | | | | | | | | | | actual_md5 was being used instead of _actual_md5 only when assigning the md5 object. This resulted in all checks and updates of the md5 to be skipped. When fixed it revealed another bug that the md5 of the read content is always checked even if there is no _expected_etag. Added tests Change-Id: Iaf1e21324ce592049d02cd5be123604b99833e86
* Adds user friendly message when --segment-size is a non-integerMahati Chamarthy2014-10-281-0/+32
Change-Id: Ic2c062110b2fe2e725b0f4a4517a300cfbf663a8