github.com/juju/juju@v0.0.0-20240327075706-a90865de2538/acceptancetests/template_assess.py.tmpl (about)

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