Merge lp:~adam-collard/charms/trusty/swift-storage/add-pause-resume-actions into lp:~openstack-charmers-archive/charms/trusty/swift-storage/next
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Merged at revision: | 74 | ||||
| Proposed branch: | lp:~adam-collard/charms/trusty/swift-storage/add-pause-resume-actions | ||||
| Merge into: | lp:~openstack-charmers-archive/charms/trusty/swift-storage/next | ||||
| Prerequisite: | lp:~adam-collard/charms/trusty/swift-storage/fix-service-status | ||||
| Diff against target: |
605 lines (+425/-42) 9 files modified
.coveragerc (+1/-0) Makefile (+2/-0) actions.yaml (+5/-0) actions/actions.py (+93/-0) lib/swift_storage_utils.py (+1/-15) setup.cfg (+1/-1) tests/00-setup (+1/-0) tests/basic_deployment.py (+82/-26) unit_tests/test_actions.py (+239/-0) |
||||
| To merge this branch: | bzr merge lp:~adam-collard/charms/trusty/swift-storage/add-pause-resume-actions | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Liam Young | 2015-08-17 | Approve on 2015-08-18 | |
| Geoff Teale | 2015-08-17 | Pending | |
|
Review via email:
|
|||
This proposal supersedes a proposal from 2015-08-11.
Description of the Change
This branch adds actions for pausing and resuming services on swift-storage units.
In addition to just stopping the services, the actions also set the status of the unit to be "maintenance" with a message on how to resume - I'm not attached to the message, bikesheds welcome :).
Further refinements to the charm to support pause mode will be coming in follow-up branches, notably guarding calls to service_start and service_restart to prevent config-changed, *-relation-changed and other hooks from (re)-starting a unit which should be paused.
charm_unit_test #7290 swift-storage-next for adam-collard mp267681
UNIT OK: passed
charm_lint_check #7871 swift-storage-next for adam-collard mp267681
LINT OK: passed
charm_unit_test #7292 swift-storage-next for adam-collard mp267681
UNIT OK: passed
charm_amulet_test #5759 swift-storage-next for adam-collard mp267681
AMULET FAIL: amulet-test failed
AMULET Results (max last 2 lines):
make: *** [test] Error 1
ERROR:root:Make target returned non-zero.
Full amulet test output: http://
Build: http://
charm_lint_check #7922 swift-storage-next for adam-collard mp267681
LINT OK: passed
charm_unit_test #7340 swift-storage-next for adam-collard mp267681
UNIT OK: passed
charm_amulet_test #5763 swift-storage-next for adam-collard mp267681
AMULET OK: passed
Build: http://
| Ryan Beisner (1chb1n) wrote : | # |
RE: Amulet tests
Thank for your contribution and clean-up here. Backgrounder: I've not gotten down the list to swift-* charm amulet test updates, but intend to complete the vivid enablement in 15.08 and wily in 15.09. There are also a number of refactors and helper optimizations, which we're making across all of the os-charm amulet tests, so I'll be shifting these around a bit when I get down the list to the swift-*s.
1 easy change that I'd request: Please chmod -x tests/basic_
Take note that juju test (and bundletester) will juju bootstrap then execute anything in the tests/ dir which is +x, and that any yamls in the tests/ dir will be assumed by bundletester to be a test definition. While we are prepping to switch completely to bundletester, our first priority with the amulet tests is in updating the horizon of u:os test coverage to catch up with charm development efforts. Then we will resume the bundletester effort.
Thanks again, holler with any ?s.
charm_lint_check #7926 swift-storage-next for adam-collard mp267681
LINT OK: passed
charm_unit_test #7344 swift-storage-next for adam-collard mp267681
UNIT OK: passed
charm_amulet_test #5767 swift-storage-next for adam-collard mp267681
AMULET OK: passed
Build: http://
charm_lint_check #7927 swift-storage-next for adam-collard mp267681
LINT OK: passed
charm_unit_test #7345 swift-storage-next for adam-collard mp267681
UNIT OK: passed
charm_amulet_test #5768 swift-storage-next for adam-collard mp267681
AMULET OK: passed
Build: http://
charm_lint_check #7929 swift-storage-next for adam-collard mp267681
LINT OK: passed
charm_unit_test #7347 swift-storage-next for adam-collard mp267681
UNIT OK: passed
charm_amulet_test #5770 swift-storage-next for adam-collard mp267681
AMULET FAIL: amulet-test failed
AMULET Results (max last 2 lines):
make: *** [test] Error 1
ERROR:root:Make target returned non-zero.
Full amulet test output: http://
Build: http://
charm_lint_check #7983 swift-storage-next for adam-collard mp267681
LINT OK: passed
charm_unit_test #7397 swift-storage-next for adam-collard mp267681
UNIT OK: passed
charm_amulet_test #5775 swift-storage-next for adam-collard mp267681
AMULET FAIL: amulet-test failed
AMULET Results (max last 2 lines):
make: *** [test] Error 124
ERROR:root:Make target returned non-zero.
Full amulet test output: http://
Build: http://
charm_lint_check #7985 swift-storage-next for adam-collard mp267681
LINT OK: passed
charm_unit_test #7399 swift-storage-next for adam-collard mp267681
UNIT OK: passed
charm_amulet_test #5777 swift-storage-next for adam-collard mp267681
AMULET FAIL: amulet-test failed
AMULET Results (max last 2 lines):
make: *** [test] Error 1
ERROR:root:Make target returned non-zero.
Full amulet test output: http://
Build: http://
charm_lint_check #7987 swift-storage-next for adam-collard mp267681
LINT OK: passed
charm_unit_test #7401 swift-storage-next for adam-collard mp267681
UNIT OK: passed
charm_amulet_test #5779 swift-storage-next for adam-collard mp267681
AMULET FAIL: amulet-test failed
AMULET Results (max last 2 lines):
make: *** [test] Error 1
ERROR:root:Make target returned non-zero.
Full amulet test output: http://
Build: http://
| Ryan Beisner (1chb1n) wrote : | # |
Hi. Kicking in with some hopefully helpful hints. I see the proposed test is failing when trying to confirm a system service that doesn't appear to be present at a particular release combo.
Since the basic_deployment.py set of tests is expected to pass for all supported release combos, each test_ method may need to use release detection logic as needed. In some cases, openstack components have shifted options, sections, etc., in conf files. In other cases, some system services may or may not be present across that entire timeline. There was particularly a lot of upstream shifting-around introduced at >= Kilo ... and < Icehouse.
As a usage example, the heat amulet test detects and checks things slightly differently here:
http://
Which ultimately uses this for comparison:
http://
charm_lint_check #8042 swift-storage-next for adam-collard mp267681
LINT OK: passed
charm_unit_test #7453 swift-storage-next for adam-collard mp267681
UNIT OK: passed
| Adam Collard (adam-collard) wrote : | # |
> Hi. Kicking in with some hopefully helpful hints. I see the proposed test is
> failing when trying to confirm a system service that doesn't appear to be
> present at a particular release combo.
That was my first guess too, fortunately (or unfortunately?) it wasn't that issue. The problem was the utils code for looking at what processes are running uses "pidof $name" but when $name is the name of a script it fails (using the -x option works as expected). Instead of yet another round of fixing charm-helpers, I opted to just roll my own for this test - there are comments in the test to further explain why.
In the absence of access to a testing environment that could satisfy the requirements, I was using UOSCI bot to run my tests for me. Now that's been resolved I have (hopefully!) got some green tests :)
charm_amulet_test #5786 swift-storage-next for adam-collard mp267681
AMULET FAIL: amulet-test failed
AMULET Results (max last 2 lines):
make: *** [test] Error 1
ERROR:root:Make target returned non-zero.
Full amulet test output: http://
Build: http://
charm_lint_check #8044 swift-storage-next for adam-collard mp267681
LINT OK: passed
charm_unit_test #7455 swift-storage-next for adam-collard mp267681
UNIT OK: passed
charm_amulet_test #5788 swift-storage-next for adam-collard mp267681
AMULET OK: passed
Build: http://
charm_lint_check #8045 swift-storage-next for adam-collard mp267681
LINT OK: passed
charm_unit_test #7456 swift-storage-next for adam-collard mp267681
UNIT OK: passed
charm_amulet_test #5789 swift-storage-next for adam-collard mp267681
AMULET FAIL: amulet-test failed
AMULET Results (max last 2 lines):
make: *** [test] Error 124
ERROR:root:Make target returned non-zero.
Full amulet test output: http://
Build: http://
| Ryan Beisner (1chb1n) wrote : | # |
RE: amulet tests
Thank you for this work!
Just a couple of things that will make future life easier:
_run_action and _wait_on_action:
Please consider landing these in charmhelpers/
_assert_services:
Please consider enhancing the existing validate_
| Adam Collard (adam-collard) wrote : | # |
Hi Ryan,
Thanks for taking a look at this.
On Fri, 14 Aug 2015 at 17:10 Ryan Beisner <email address hidden>
wrote:
> RE: amulet tests
>
> Thank you for this work!
>
> Just a couple of things that will make future life easier:
>
> _run_action and _wait_on_action:
> Please consider landing these in charmhelpers/
> they will be increasingly-common needs.
>
Done. See charm-helpers r428
>
> _assert_services:
> Please consider enhancing the existing validate_
> helper to fit the needs here. I think it would be a fairly easy mod. We
> could do -x on pidof in all cases (or add a bool with default False to
> "check scripts too" if you want to be safer about it). Then add a boolean
> postive/negative switch to be able to invert its expectations (like you've
> done with should_run). fwiw, expect_success (default True) is such a bool
> name that I've used elsewhere for the same purpose in a different context
> (rmq wip).
>
I modified get_process_id_list and get_unit_
using validate_
me in the previous two methods. See comment in the test itself.
I've split the branch up so that the new code is cleanly separated from the
fixes I made to existing code (see pre-req branch).
--
>
> https:/
> You are the owner of
> lp:~adam-collard/charms/trusty/swift-storage/add-pause-resume-actions.
>
> Launchpad-
> Launchpad-
> Launchpad-Branch:
> ~adam-collard/
>
charm_lint_check #8196 swift-storage-next for adam-collard mp268233
LINT OK: passed
charm_unit_test #7598 swift-storage-next for adam-collard mp268233
UNIT OK: passed
charm_amulet_test #5842 swift-storage-next for adam-collard mp268233
AMULET OK: passed
Build: http://

charm_lint_check #7869 swift-storage-next for adam-collard mp267681
LINT OK: passed
Build: http:// 10.245. 162.77: 8080/job/ charm_lint_ check/7869/