November 2019 Archives

Paws XXXII (80+ paws)

Today's post proves that test suite, even one that uses canned data, requests and responses, is a very valuable asset to have about.

As I was charging though some 80 action calls copying the requests from my successful unit tests into my t/09_request.t test cases I ran into the odd real bug.

The first one I ran into was to do with the 'PutBucketLogging' action; My real unit test case would work with no problem but as I transferred this real world unit test into canned test cases I got a fail on some of the composed XML.

The test parameters for the request where…

Paws XXXI (Digging up more dirt)

I ending up in my last post with a test that was running but most of the tests where failing.

ok 1 - Call S3->CreateBucket from /home/scolesj/aws-sdk-perl/t/09_requests/s3-create-bucket.request
ok 2 - Got content eq from result
…
ok 11 - Got method eq PUT from result
I had a look at the request object I was getting back

 bless( {
                 'url' => 'https://s3.fake_region.amazonaws.com/oneoffpaws',
                 'method' => 'PUT',
                 'content' => '<CreateBucketConfiguration x…

Paws XXX (Three of a kind)

Goodness Paws 30 and I am at least code compete as far as running through all of the different action found on S3. Now that leads me to a very important part.

I now have to do a little bit of back peddling and come up with a test suite for all the now fixed S3 actions. 90% of the bugs and fixes I have done so far on S3 have been for requests to the server not checking responses form the server.

Following on with this it makes sense that I test how things are sent to the server as well. I had a peek about in the test suite and except for a few of the basic actions there ar…

Paws XXIX (Would you like fries with that)

Well still in clean-up mode here in the Paws Pen trying to get the full t/10_response.t test case working.

I was having all sorts of fun with the 'GetBucketPolicy' action test. By fun I mean a good hour of frustration and cursing and gnashing of teeth as my real-time test script was working fine! I just could not get the test in 's3-get-bucket-policy.response.test.yml' to pass.

Then I stumbled on it.

This is the one very odd action on the AWS S3 API where it dose not return XML but returns JSON. Now I do handle this with this code

="prettyp…

Paws XXVIII (Just one More )

Seems I lied in my last post when I said there where no longer any boto changes for my S3 fixes. There is still one call 'GetBucketLocation' that is using a new bit I added to boto
"keep_root":true

I stumbled upon this when I added in a few fixed cases from another branch and when I ran the suite I
got;

ok 10052 - Call S3->GetBucketLocation from t/10_responses/s3-get-bucket-location.response not ok 10053 - Can't test method access because something went horribly wrong in the call to …

Paws XXVII (Templated Paws)



/{Bucket}?action
/{Bucket}?action&id={Id}

where I add the id to the URI to get around a bug/problems when running this code on RestXmlCaller.pm;


$uri->query_form(%$qparams); 

would scramble the URI so the call would fail.

What I would like to do is roll back the changes I have ma…

Paws XXVI (The Big Clean)

So time to hold on a bit and go back and and see if my latest changes have broken anything or for that matter fixed something that was already broken?

So back to my tests script and and I got my first fail on

'PutBucketCors'

and surprise it was a bit of Mooso poop.


You must pass a package name and it cannot be blessed at /wwwveh/lib/x86_64-linux-thread-multi/Moose/Meta/Attribute.pm line 867
        Moose::Meta::Attribute::get_value('Moose::Meta::Class::__ANON__::SERIAL::12=HASH(0x4ad5358)', 'h…

Paws XXV (A break though)

Well today’s post marks a tuning point in Paws me thinks, at least in the S3 name-space. I have been spending quite allot of time trying to get this action to work;

PutBucketAcl

It is the most nasty bit of AWS code I have come across so far. First one needs to send this XML up to AWS;

<AccessControlPolicy xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
  <Owner>
    <ID>852b113e7a2f25102679df27bb0ae12b3f85be6BucketOwnerCanonicalUserID</ID>
    <DisplayName>OwnerDisp…

Paws XXIV (A little Buzz)

Well after the panic stations I talked about in my last post. I have calmed down a little. It seems that huge check in was for the compiled version of the code base and 99% of the changes where just auto-auto-generated stuff chugged out by boto when it re-compiles.

That being said I did find this thread while investigating the mother of all pushes; https://github.com/pplu/aws-sdk-perl/issues/244

Requirements for stabilisation?

shadowcat-mst commented on 24 May 2018
So, a number of components in Paws have something like this -
https://meta…

Paws XXIII (Bad Paws!! Bad Paws!!)

So I have been happily plugging away at the Paws 'S3' actions and my little Boto fix of


/{Bucket}?action
/{Bucket}?action&id={Id}

I was able to get all of these 'Actions' to work;

  • DeleteBucketAnalyticsConfiguration
  • DeleteBucketInventoryConfiguration
  • DeleteBucketMetricsConfiguration
  • GetBucketAnalyticsConfiguration
  • GetBucketInventoryConfiguration
  • GetBucketMetricsConfiguration
  • ListBucketInventoryConfiguration
  • ListBucketMetricsConfigurat…

Paws XXII (Plana est terra)

The next action I had a crack at was 'PutCORSConfiguration' and I was getting the usual;

<Error> <Code>MalformedXML</Code> <Message>The XML you provided was not well-formed or did not validate against our published schema </Message> </Error>

At this points in my Paws adventure I checked the API doc for URI Request Parameters of the PutCORSConfiguration;

PUT /?cors HTTP/1.1 Host: Bucket.s3.amazonaws.com Content-MD5: ContentMD5

a…

Paws XXI (The Adult Version)

We last left out PAWS hero she was just about ready to fix the S3 'PutBucketAnalyticsConfiguration' call. Having first fixed up the botocore json file to properly define the URI for the call.

She now had to find a way to get the 'xmlns' schema attribute add to the root of the XML that is sent to the API.

Turns out I was in very virgin territory there has been no Paws code to take this into account and checking the py code it was not very helpful so I have to put my thinking cap on for this one.

I was thinking I could just make it a new 'trait' like I did for the '…

Paws XX (Dos Equis)

Well the saw-buck edition of Paws proved to be a real tough one a least for me. I my last post I was just thinking of fixing all the S3 calls that do not have a test I was just going to start with all the delete calls but I decided to rater take a functional approach and tackle the calls in that order so I started out with the 'Analytics' calls

  • DeleteBucketAnalyticsConfiguration
  • GetBucketAnalyticsConfiguration
  • ListBucketAnalyticsConfigurations
  • PutBucketAnalyticsConfiguration

The first one I was going to play with was the 'PutBuc…

About byterock

user-pic Long time Perl guy, a few CPAN mods allot of work on DBD::Oracle and a few YAPC presentations