summaryrefslogtreecommitdiffstats
path: root/src/ceph/qa/tasks/create_verify_lfn_objects.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/ceph/qa/tasks/create_verify_lfn_objects.py')
-rw-r--r--src/ceph/qa/tasks/create_verify_lfn_objects.py83
1 files changed, 0 insertions, 83 deletions
diff --git a/src/ceph/qa/tasks/create_verify_lfn_objects.py b/src/ceph/qa/tasks/create_verify_lfn_objects.py
deleted file mode 100644
index 01ab1a3..0000000
--- a/src/ceph/qa/tasks/create_verify_lfn_objects.py
+++ /dev/null
@@ -1,83 +0,0 @@
-"""
-Rados modle-based integration tests
-"""
-import contextlib
-import logging
-
-log = logging.getLogger(__name__)
-
-@contextlib.contextmanager
-def task(ctx, config):
- """
- For each combination of namespace and name_length, create
- <num_objects> objects with name length <name_length>
- on entry. On exit, verify that the objects still exist, can
- be deleted, and then don't exist.
-
- Usage::
-
- create_verify_lfn_objects.py:
- pool: <pool_name> default: 'data'
- prefix: <prefix> default: ''
- namespace: [<namespace>] default: ['']
- num_objects: [<num_objects>] default: 10
- name_length: [<name_length>] default: [400]
- """
- pool = config.get('pool', 'data')
- num_objects = config.get('num_objects', 10)
- name_length = config.get('name_length', [400])
- namespace = config.get('namespace', [None])
- prefix = config.get('prefix', None)
- manager = ctx.managers['ceph']
-
- objects = []
- for l in name_length:
- for ns in namespace:
- def object_name(i):
- nslength = 0
- if namespace is not '':
- nslength = len(namespace)
- numstr = str(i)
- fillerlen = l - nslength - len(prefix) - len(numstr)
- assert fillerlen >= 0
- return prefix + ('a'*fillerlen) + numstr
- objects += [(ns, object_name(i)) for i in range(num_objects)]
-
- for ns, name in objects:
- err = manager.do_put(
- pool,
- name,
- '/etc/resolv.conf',
- namespace=ns)
- log.info("err is " + str(err))
- assert err == 0
-
- try:
- yield
- finally:
- log.info('ceph_verify_lfn_objects verifying...')
- for ns, name in objects:
- err = manager.do_get(
- pool,
- name,
- namespace=ns)
- log.info("err is " + str(err))
- assert err == 0
-
- log.info('ceph_verify_lfn_objects deleting...')
- for ns, name in objects:
- err = manager.do_rm(
- pool,
- name,
- namespace=ns)
- log.info("err is " + str(err))
- assert err == 0
-
- log.info('ceph_verify_lfn_objects verifying absent...')
- for ns, name in objects:
- err = manager.do_get(
- pool,
- name,
- namespace=ns)
- log.info("err is " + str(err))
- assert err != 0
Long */ } @media (prefers-color-scheme: light) { .highlight .hll { background-color: #ffffcc } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
heat_template_version: ocata
parameters:
  image:
    type: string
    default: unused
  flavor:
    type: string
    default: unused
  key_name:
    type: string
    default: unused
  security_groups:
    type: json
    default: []
  # Require this so we can validate the parent passes the
  # correct value
  user_data_format:
    type: string
  user_data:
    type: string
    default: ''
  name:
    type: string
    default: 'deployed-server'
  image_update_policy:
    type: string
    default: ''
  networks:
    type: comma_delimited_list
    default: ''
  metadata:
    type: json
    default: {}
  software_config_transport:
    default: POLL_SERVER_CFN
    type: string
  scheduler_hints:
    type: json
    description: Optional scheduler hints to pass to nova
    default: {}
  UpgradeInitCommand:
    type: string
    description: |
      Command or script snippet to run on all overcloud nodes to
      initialize the upgrade process. E.g. a repository switch.
    default: ''

resources:
  deployed-server:
    type: OS::Heat::DeployedServer
    properties:
      name: {get_param: name}
      software_config_transport: {get_param: software_config_transport}

  UpgradeInitConfig:
    type: OS::Heat::SoftwareConfig
    properties:
      group: script
      config:
        list_join:
        - ''
        - - "#!/bin/bash\n\n"
          - "if [[ -f /etc/resolv.conf.save ]] ; then rm /etc/resolv.conf.save; fi\n\n"
          - get_param: UpgradeInitCommand

  UpgradeInitDeployment:
    type: OS::Heat::SoftwareDeployment
    properties:
      name: UpgradeInitDeployment
      server: {get_resource: deployed-server}
      config: {get_resource: UpgradeInitConfig}


  InstanceIdConfig:
    type: OS::Heat::StructuredConfig
    properties:
      group: apply-config
      config:
        instance-id: {get_resource: deployed-server}

  InstanceIdDeployment:
    type: OS::Heat::StructuredDeployment
    properties:
      config: {get_resource: InstanceIdConfig}
      server: {get_resource: deployed-server}
    depends_on: UpgradeInitDeployment

  HostsEntryConfig:
    type: OS::Heat::SoftwareConfig
    properties:
      group: script
      config: |
          #!/bin/bash
          set -eux
          mkdir -p $heat_outputs_path
          host=$(hostname -s)
          echo -n $host > $heat_outputs_path.hostname
          cat $heat_outputs_path.hostname
      outputs:
        - name: hostname
          description: hostname

  HostsEntryDeployment:
    type: OS::Heat::SoftwareDeployment
    properties:
      config: {get_resource: HostsEntryConfig}
      server: {get_resource: deployed-server}

  DeployedServerBootstrapConfig:
    type: OS::TripleO::DeployedServer::Bootstrap
    properties:
      server: {get_resource: deployed-server}

  ControlPlanePort:
    type: OS::TripleO::DeployedServer::ControlPlanePort
    properties:
      network: ctlplane
      name:
        list_join:
          - '-'
          - - {get_attr: [HostsEntryDeployment, hostname]}
            - ctlplane
      replacement_policy: AUTO

outputs:
  OS::stack_id:
    value: {get_resource: deployed-server}
  networks:
    value:
      ctlplane:
        - {get_attr: [ControlPlanePort, fixed_ips, 0, ip_address]}
  name:
    value: {get_attr: [HostsEntryDeployment, hostname]}