forked from juju/juju
-
Notifications
You must be signed in to change notification settings - Fork 0
/
template_assess.py.tmpl
61 lines (45 loc) · 1.54 KB
/
template_assess.py.tmpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env python3
""" TODO: Single line description of this assess script purpose.
TODO: add description For:
- Juju features tested in this module
- Brief outline of what the test will do to undertake this
- Notes on any tricky details needed for the tests
- etc.
"""
from __future__ import print_function
import argparse
import logging
import sys
from deploy_stack import (
BootstrapManager,
)
from utility import (
add_basic_testing_arguments,
configure_logging,
)
__metaclass__ = type
log = logging.getLogger("assess_TEMPLATE")
def assess_TEMPLATE(client):
# Deploy charms, there are several under ./repository
client.deploy('local:trusty/my-charm')
# Wait for the deployment to finish.
client.wait_for_started()
# TODO: Add specific functional testing actions here.
def parse_args(argv):
"""Parse all arguments."""
parser = argparse.ArgumentParser(description="TODO: script info")
# TODO: Add additional positional arguments.
# NOTE: If this test does *not* support running on an existing bootstrapped
# controller, pass `existing=False` to add_basic_testing_arguments.
add_basic_testing_arguments(parser)
# TODO: Add additional optional arguments.
return parser.parse_args(argv)
def main(argv=None):
args = parse_args(argv)
configure_logging(args.verbose)
bs_manager = BootstrapManager.from_args(args)
with bs_manager.booted_context(args.upload_tools):
assess_TEMPLATE(bs_manager.client)
return 0
if __name__ == '__main__':
sys.exit(main())