~facundo/tanuki-agent/tutorial-first-boot

« back to all changes in this revision

Viewing changes to docs/tutorial-products.md

  • Committer: Tanuki Bot
  • Author(s): Bret Barker
  • Date: 2015-12-10 21:51:01 UTC
  • mfrom: (186.2.4 auto-gm)
  • Revision ID: tanuki_bot-20151210215101-7bhk0rjs71p92mbg
Rip out manual GM advert, finish up events/results section w/real URLs, fix provkit2 handling of new snap list format. [r=Celso Providelo]

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
Title:   Getting Started with Ubuntu Product Integration
2
 
Version: 20151205
 
2
Version: 20151209
3
3
 
4
4
Ubuntu Product Integration is a system for automated integration
5
5
testing of products built upon Ubuntu Core.
74
74
 
75
75
Also install the software dependencies of the Agent:
76
76
 
77
 
    sudo apt-get install python-requests pv
 
77
    sudo apt-get install python-requests python-requests-oauthlib pv
78
78
 
79
79
Next you will install and configure the Agent. The most recent release of the Agent can always be found at [this location](https://spi.canonical.com/assets/agent.tar.gz).
80
80
 
385
385
 
386
386
At this point the system is configured for your product and tests, and will supervise the Store for new versions of the snaps listed in your Product.
387
387
 
388
 
TODO: note about not being in all-snaps land yet and how that affects os/kernel.
389
 
 
390
388
 
391
389
### First test run
392
390
 
393
 
TODO: system should trigger an initial GM test when the TestSpec is created. At that point, remove this.
394
 
 
395
 
Manually, generate a gold-master test:
396
 
 
397
 
    ./api_example.py -X POST config.ini https://spi.canonical.com/products/$PRODUCT_ID/gold-masters --data '{
398
 
        "channel": "stable", 
399
 
        "snaps": [
400
 
            {
401
 
                "name": "pi2.canonical", 
402
 
                "sequence": 3
403
 
            },
404
 
            {
405
 
                "name": "webdm.canonical", 
406
 
                "sequence": 10
407
 
            },
408
 
            {
409
 
                "name": "test-snap.'$NAMESPACE'", 
410
 
                "sequence": 1
411
 
            }
412
 
        ]
413
 
    }'
414
 
 
415
 
    HTTP 201
416
 
    {
417
 
    "ids": [
418
 
            {
419
 
            "image_unique_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
420
 
            "test_opportunity_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
421
 
            }
422
 
        ]
423
 
    }
424
 
 
425
 
 
426
391
This test will be what is called a Gold Master (GM) Candidate test. It is triggered by a change to any of the component snaps in the monitored ```base_channel``` defined in the Test Specification (stable in this case). The server will generate a Test Opportunity that instructs the provisioning kit script to compose a new GM candidate image from the Product's snaps, using the current sequences published in the base channel, provision that image, and then run tests against it. Later chapters of the tutorial will discuss additional testing scenarios.
427
392
 
428
393
When we first defined our Test Specification, the system generated a new Test Opportunity to test the initial Gold Master Candidate image, since that combination of snaps had not yet been tested.
449
414
At any time, you can check the progress of tests generated in the
450
415
system:
451
416
 
452
 
TODO: we need a way to get our test opp id now that we are not manually triggering
453
 
 
454
417
    ./api_example.py config.ini \
455
418
    https://spi.canonical.com/products/$PRODUCT_ID/tests/events
456
419
 
473
436
            "event_type": "PICKED_BY_AGENT"
474
437
            },
475
438
 
476
 
The ```event_type``` field will describe what happened, there is a timestamp, and extra information related
477
 
to the event.
 
439
The ```event_type``` field will describe what happened, there is a timestamp, and extra information related to the event.
478
440
 
479
441
It will also contain all the information relevant to the test, such as:
480
442
 
485
447
 
486
448
As well as the test itself in the ```test_opportunity``` field.
487
449
 
488
 
You can also check the results for an specific image (you can get the image
489
 
id from the response of the query when you told the system above that a
490
 
new snap revision was available): (TODO: update if/when we have auto GM on TestSpec creation)
 
450
You can also check the results for a specific image (you can get the image
 
451
id from the response of the test spec creation request):
491
452
 
492
453
    ./api_example.py config.ini \
493
454
    https://spi.canonical.com/products/$PRODUCT_ID/tests/events?image_unique_id=<unique_image_id>
494
455
 
495
456
Or you may directly poll for specific results using filters, as below:
496
457
 
497
 
    ./api_example.py config.ini https://spi.canonical.com/products/$PRODUCT_ID/results... TODO
 
458
    ./api_example.py config.ini \
 
459
    https://spi.canonical.com/products/$PRODUCT_ID/tests/results?image_unique_id=<unique_image_id>
498
460
 
499
461
The result query will return a document describing one or more test results.
500
462
Each will contain, among other things, the pass or failure status of the test