<commit_before>[tox]
envlist = {dev,luminous,mimic,rhcs}-{xenial_cluster,centos7_cluster,cluster,docker_cluster,update_cluster,update_docker_cluster,switch_to_containers,ooo_collocation,bluestore_lvm_osds,bluestore_lvm_osds_container,lvm_osds,purge_lvm_osds,purge_lvm_osds_container,shrink_mon,shrink_osd,shrink_mon_container,shrink_osd_container,docker_cluster_collocation,lvm_batch,lvm_osds_container,lvm_batch_container,infra_lv_create,add_osds,add_osds_container,rgw_multisite,rgw_multisite_container,container_podman}
  infra_lv_create

skipsdist = True

# a test scenario for the lv-create.yml and lv-teardown playbooks
[testenv:infra_lv_create]
whitelist_externals =
    vagrant
    bash
    cp
    mkdir
    cat
passenv=*
setenv=
  ANSIBLE_SSH_ARGS = -F {changedir}/vagrant_ssh_config
  ANSIBLE_CONFIG = -F {toxinidir}/ansible.cfg
  ANSIBLE_ACTION_PLUGINS = {toxinidir}/plugins/actions
  ANSIBLE_CALLBACK_PLUGINS = {toxinidir}/plugins/callback
  ANSIBLE_CALLBACK_WHITELIST = profile_tasks
  # only available for ansible >= 2.2
  ANSIBLE_STDOUT_CALLBACK = debug
deps= -r{toxinidir}/tests/requirements.txt
changedir={toxinidir}/tests/functional/centos/7/infra_lv_create
commands=
  vagrant up --no-provision {posargs:--provider=virtualbox}
  bash {toxinidir}/tests/scripts/generate_ssh_config.sh {changedir}

  cp {toxinidir}/infrastructure-playbooks/lv-create.yml {toxinidir}/lv-create.yml
  ansible-playbook -vv -i {changedir}/hosts {toxinidir}/lv-create.yml

  cp {toxinidir}/infrastructure-playbooks/lv-teardown.yml {toxinidir}/lv-teardown.yml
  ansible-playbook -vv -i {changedir}/hosts {toxinidir}/lv-teardown.yml --extra-vars "ireallymeanit=yes"

  cat {toxinidir}/lv-create.log

  vagrant destroy --force

# extra commands for purging clusters
# that purge the cluster and then set it up again to
# ensure that a purge can clear nodes well enough that they
# can be redployed to.
[purge]
commands=
  cp {toxinidir}/infrastructure-playbooks/{env:PURGE_PLAYBOOK:purge-cluster.yml} {toxinidir}/{env:PURGE_PLAYBOOK:purge-cluster.yml}
  ansible-playbook -vv -i {changedir}/hosts {toxinidir}/{env:PURGE_PLAYBOOK:purge-cluster.yml} --extra-vars "\
      ireallymeanit=yes \
      remove_packages=yes \
      ceph_stable_release={env:CEPH_STABLE_RELEASE:luminous} \
      fetch_directory={env:FETCH_DIRECTORY:{changedir}/fetch} \
      ceph_docker_registry={env:CEPH_DOCKER_REGISTRY:docker.io} \
      ceph_docker_image={env:CEPH_DOCKER_IMAGE:ceph/daemon} \
      ceph_docker_image_tag={env:CEPH_DOCKER_IMAGE_TAG:latest-master} \
  "

  # set up the cluster again
  ansible-playbook -vv -i {changedir}/hosts {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars "\
      ceph_stable_release={env:CEPH_STABLE_RELEASE:luminous} \
      fetch_directory={env:FETCH_DIRECTORY:{changedir}/fetch} \
      ceph_docker_registry={env:CEPH_DOCKER_REGISTRY:docker.io} \
      ceph_docker_image={env:CEPH_DOCKER_IMAGE:ceph/daemon} \
      ceph_docker_image_tag={env:CEPH_DOCKER_IMAGE_TAG:latest-master} \
      ceph_dev_branch={env:CEPH_DEV_BRANCH:master} \
      ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} \
  "
  # test that the cluster can be redeployed in a healthy state
  testinfra -n 4 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts {toxinidir}/tests/functional/tests

[purge-lvm]
commands=
  cp {toxinidir}/infrastructure-playbooks/{env:PURGE_PLAYBOOK:purge-cluster.yml} {toxinidir}/{env:PURGE_PLAYBOOK:purge-cluster.yml}
  ansible-playbook -vv -i {changedir}/hosts {toxinidir}/{env:PURGE_PLAYBOOK:purge-cluster.yml} --extra-vars "\
      ireallymeanit=yes \
      remove_packages=yes \
      ceph_stable_release={env:CEPH_STABLE_RELEASE:luminous} \
      fetch_directory={env:FETCH_DIRECTORY:{changedir}/fetch} \
      ceph_docker_registry={env:CEPH_DOCKER_REGISTRY:docker.io} \
      ceph_docker_image={env:CEPH_DOCKER_IMAGE:ceph/daemon} \
      ceph_docker_image_tag={env:CEPH_DOCKER_IMAGE_TAG:latest-master} \<commit_msg>purge: tox add lvm-setup<commit_after>[tox]
envlist = {dev,luminous,mimic,rhcs}-{xenial_cluster,centos7_cluster,cluster,docker_cluster,update_cluster,update_docker_cluster,switch_to_containers,ooo_collocation,bluestore_lvm_osds,bluestore_lvm_osds_container,lvm_osds,purge_lvm_osds,purge_lvm_osds_container,shrink_mon,shrink_osd,shrink_mon_container,shrink_osd_container,docker_cluster_collocation,lvm_batch,lvm_osds_container,lvm_batch_container,infra_lv_create,add_osds,add_osds_container,rgw_multisite,rgw_multisite_container,container_podman}
  infra_lv_create

skipsdist = True

# a test scenario for the lv-create.yml and lv-teardown playbooks
[testenv:infra_lv_create]
whitelist_externals =
    vagrant
    bash
    cp
    mkdir
    cat
passenv=*
setenv=
  ANSIBLE_SSH_ARGS = -F {changedir}/vagrant_ssh_config
  ANSIBLE_CONFIG = -F {toxinidir}/ansible.cfg
  ANSIBLE_ACTION_PLUGINS = {toxinidir}/plugins/actions
  ANSIBLE_CALLBACK_PLUGINS = {toxinidir}/plugins/callback
  ANSIBLE_CALLBACK_WHITELIST = profile_tasks
  # only available for ansible >= 2.2
  ANSIBLE_STDOUT_CALLBACK = debug
deps= -r{toxinidir}/tests/requirements.txt
changedir={toxinidir}/tests/functional/centos/7/infra_lv_create
commands=
  vagrant up --no-provision {posargs:--provider=virtualbox}
  bash {toxinidir}/tests/scripts/generate_ssh_config.sh {changedir}

  cp {toxinidir}/infrastructure-playbooks/lv-create.yml {toxinidir}/lv-create.yml
  ansible-playbook -vv -i {changedir}/hosts {toxinidir}/lv-create.yml

  cp {toxinidir}/infrastructure-playbooks/lv-teardown.yml {toxinidir}/lv-teardown.yml
  ansible-playbook -vv -i {changedir}/hosts {toxinidir}/lv-teardown.yml --extra-vars "ireallymeanit=yes"

  cat {toxinidir}/lv-create.log

  vagrant destroy --force

# extra commands for purging clusters
# that purge the cluster and then set it up again to
# ensure that a purge can clear nodes well enough that they
# can be redployed to.
[purge]
commands=
  cp {toxinidir}/infrastructure-playbooks/{env:PURGE_PLAYBOOK:purge-cluster.yml} {toxinidir}/{env:PURGE_PLAYBOOK:purge-cluster.yml}
  ansible-playbook -vv -i {changedir}/hosts {toxinidir}/{env:PURGE_PLAYBOOK:purge-cluster.yml} --extra-vars "\
      ireallymeanit=yes \
      remove_packages=yes \
      ceph_stable_release={env:CEPH_STABLE_RELEASE:luminous} \
      fetch_directory={env:FETCH_DIRECTORY:{changedir}/fetch} \
      ceph_docker_registry={env:CEPH_DOCKER_REGISTRY:docker.io} \
      ceph_docker_image={env:CEPH_DOCKER_IMAGE:ceph/daemon} \
      ceph_docker_image_tag={env:CEPH_DOCKER_IMAGE_TAG:latest-master} \
  "

  # re-setup lvm
  ansible-playbook -vv -i {changedir}/hosts {toxinidir}/tests/functional/lvm_setup.yml

  # set up the cluster again
  ansible-playbook -vv -i {changedir}/hosts {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars "\
      ceph_stable_release={env:CEPH_STABLE_RELEASE:luminous} \
      fetch_directory={env:FETCH_DIRECTORY:{changedir}/fetch} \
      ceph_docker_registry={env:CEPH_DOCKER_REGISTRY:docker.io} \
      ceph_docker_image={env:CEPH_DOCKER_IMAGE:ceph/daemon} \
      ceph_docker_image_tag={env:CEPH_DOCKER_IMAGE_TAG:latest-master} \
      ceph_dev_branch={env:CEPH_DEV_BRANCH:master} \
      ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} \
  "
  # test that the cluster can be redeployed in a healthy state
  testinfra -n 4 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts {toxinidir}/tests/functional/tests

[purge-lvm]
commands=
  cp {toxinidir}/infrastructure-playbooks/{env:PURGE_PLAYBOOK:purge-cluster.yml} {toxinidir}/{env:PURGE_PLAYBOOK:purge-cluster.yml}
  ansible-playbook -vv -i {changedir}/hosts {toxinidir}/{env:PURGE_PLAYBOOK:purge-cluster.yml} --extra-vars "\
      ireallymeanit=yes \
      remove_packages=yes \
      ceph_stable_release={env:CEPH_STABLE_RELEASE:luminous} \
      fetch_directory={env:FETCH_DIRECTORY:{changedir}/fetch} \
      ceph_docker_registry={env:CEPH_DOCKER_REGISTRY:docker.io} \
      ceph_docker_image={env:CEPH_DOCKER_IMAGE:ceph/daemon} \
      ceph_docker_image_tag={env:CEPH_DOCKER_IMAGE_TAG:latest-master} \
{'fraction_non_alphanumeric': 0.11033449825262107, 'fraction_numerical': 0.001747378931602596, 'mean_word_length': 5.551921504497138, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2285109', 'n_tokens_mistral': 3251, 'n_tokens_neox': 3021, 'n_words': 372}