<commit_before>### This file is used by neutron component jobs
### The jobs can be found on rhos Jenkins: https://rhos-jenkins.rhev-ci-vms.eng.rdu2.redhat.com/view/component-tests

# Testers. Each tester specifies RPMs to install, RPMs to remove and a set of commands that include the invocation of the tester.
pep8:
    rpm_deps: [ python-neutron, python-hacking, pylint ]
    remove_rpm: [ python-neutron ]
    run: tox --sitepackages -v -e pep8 2>&1 | tee ../logs/testrun.log;

unittest:
    rpm_deps: [ python-neutron, python-cliff, python-requests-mock, python-webtest, python-mock ]
    remove_rpm: [ python-neutron ]
    run: tox --sitepackages -v -e py27 2>&1 | tee ../logs/testrun.log;

# FAIL_ON_MISSING_DEPS is disabled because we are not testing postgresql.
# functional has is own requirements file, which is truncated to use RPMs instead of pip.
dsvm-functional:
    rpm_deps: [ openstack-neutron, openstack-neutron-openvswitch, python-testresources,
                python-oslotest, bridge-utils, nmap-ncat, ebtables, openstack-selinux,
                mysql-server, psmisc ]
    remove_rpm: []
    run: >
        sudo setenforce 0;
        sudo modprobe bridge;
        sudo modprobe br_netfilter;
        sudo systemctl start openvswitch;
        sed -i s@OS_FAIL_ON_MISSING_DEPS=1@OS_FAIL_ON_MISSING_DEPS=0@ tox.ini;
        truncate --size 0 neutron/tests/functional/requirements.txt;
        sudo sed -i '/\[mysqld\]/a bind-address=0.0.0.0' /etc/my.cnf;
        sudo sed -i '/\[mysqld\]/a sql_mode=STRICT_ALL_TABLES' /etc/my.cnf;
        sudo sed -i '/\[mysqld\]/a default-storage-engine=InnoDB' /etc/my.cnf;
        sudo sed -i '/\[mysqld\]/a max_connections=1024' /etc/my.cnf;
        sudo sed -i '/\[mysqld\]/a query_cache_type=OFF' /etc/my.cnf;
        sudo sed -i '/\[mysqld\]/a query_cache_size=0' /etc/my.cnf;
        sudo systemctl restart mysqld;
        mysql -u root -e "CREATE USER 'openstack_citest' IDENTIFIED BY 'openstack_citest';";
        mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO 'openstack_citest'@'localhost';";
        mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO 'openstack_citest';";
        mysql -uroot -h127.0.0.1 -e "grant all privileges on openstack_citest.* to openstack_citest@localhost identified by 'openstack_citest';";
        mysql -u root -e "FLUSH PRIVILEGES;";
        tox --sitepackages -v -e dsvm-functional 2>&1 | tee ../logs/testrun.log;
        tar zcvf /home/cloud-user/logs/functional-tests.tar.gz /tmp/dsvm-functional-logs;

# Current installer doesn't configure qos, so we configure it here.
# We use neutron-sanity-check before running API tests.
api:
    rpm_deps: []
    remove_rpm: []
    run: >
        sudo sed -i "/^extension/s/$/,qos/" /etc/neutron/plugin.ini;
        sudo sed -i "/^service_plugins/s/$/,qos/" /etc/neutron/neutron.conf;
        sudo sed -i "/^extension/s/$/,qos/" /etc/neutron/plugins/ml2/ml2_conf.ini;
        sudo systemctl restart neutron-server;
        sanity_parameters=$(grep neutron.conf /usr/lib/systemd/system/neutron-server.service | sed 's/.*bin\/neutron-server//');
        sudo neutron-sanity-check --nodnsmasq_version $sanity_parameters && tox --sitepackages -v -e api 2>&1 | tee ../logs/testrun.log;

tempest:
   rpm_deps: []
   remove_rpm: []
   run: >
     sed -i -E s/,dvr,\?//g /home/stack/tempest/etc/tempest.conf;
   blacklist: [tempest.scenario.test_network_basic_ops.TestNetworkBasicOps.test_router_rescheduling]

# hostvars[inventory_hostname] is a special ansible variable to get all host's facts
# tester.component.tox_target can be one of the following: [unittest, pep8, dsvm-functional, api]

# Common rpm deps needed for all tester types
rpm_deps: [
  gcc, git, python-devel, python-tox, python-testrepository, python-pip,
  python-testscenarios, python-tempest-lib, python-hacking,
  "{{ hostvars[inventory_hostname][tester.component.tox_target]['rpm_deps'] }}"
]

# The rpms that shouldn't be installed on system, when running tests
remove_rpm: [ "{{ hostvars[inventory_hostname][tester.component.tox_target]['remove_rpm'] }}" ]

# Common pre-run steps used by all tester types
neutron_virt_run_config:
  run: >
    set -o pipefail;
    rpm -qa | sort > ../logs/installed-rpms.log;

    truncate --size 0 requirements.txt;
    truncate --size 0 test-requirements.txt;

    {{ hostvars[inventory_hostname][tester.component.tox_target]['run'] }}

  archive:
    - /home/cloud-user/logs/functional-tests.tar.gz


# NOTE: This is the main section. It must exist.
test_config:
  virt:
    RedHat-7:
      setup:
        install: "{{ rpm_deps }}"
        remove: "{{ remove_rpm }}"
      run: "{{ neutron_virt_run_config.run }}"
    default:
      setup:
        install: "{{ rpm_deps }}"
        remove: "{{ remove_rpm }}"
      run: "{{ neutron_virt_run_config.run }}"
<commit_msg>Fix neutron OSP 8 archiving<commit_after>### This file is used by neutron component jobs
### The jobs can be found on rhos Jenkins: https://rhos-jenkins.rhev-ci-vms.eng.rdu2.redhat.com/view/component-tests

# Testers. Each tester specifies RPMs to install, RPMs to remove and a set of commands that include the invocation of the tester.
pep8:
    rpm_deps: [ python-neutron, python-hacking, pylint ]
    remove_rpm: [ python-neutron ]
    run: tox --sitepackages -v -e pep8 2>&1 | tee ../logs/testrun.log;

unittest:
    rpm_deps: [ python-neutron, python-cliff, python-requests-mock, python-webtest, python-mock ]
    remove_rpm: [ python-neutron ]
    run: tox --sitepackages -v -e py27 2>&1 | tee ../logs/testrun.log;

# FAIL_ON_MISSING_DEPS is disabled because we are not testing postgresql.
# functional has is own requirements file, which is truncated to use RPMs instead of pip.
dsvm-functional:
    rpm_deps: [ openstack-neutron, openstack-neutron-openvswitch, python-testresources,
                python-oslotest, bridge-utils, nmap-ncat, ebtables, openstack-selinux,
                mysql-server, psmisc ]
    remove_rpm: []
    run: >
        sudo setenforce 0;
        sudo modprobe bridge;
        sudo modprobe br_netfilter;
        sudo systemctl start openvswitch;
        sed -i s@OS_FAIL_ON_MISSING_DEPS=1@OS_FAIL_ON_MISSING_DEPS=0@ tox.ini;
        truncate --size 0 neutron/tests/functional/requirements.txt;
        sudo sed -i '/\[mysqld\]/a bind-address=0.0.0.0' /etc/my.cnf;
        sudo sed -i '/\[mysqld\]/a sql_mode=STRICT_ALL_TABLES' /etc/my.cnf;
        sudo sed -i '/\[mysqld\]/a default-storage-engine=InnoDB' /etc/my.cnf;
        sudo sed -i '/\[mysqld\]/a max_connections=1024' /etc/my.cnf;
        sudo sed -i '/\[mysqld\]/a query_cache_type=OFF' /etc/my.cnf;
        sudo sed -i '/\[mysqld\]/a query_cache_size=0' /etc/my.cnf;
        sudo systemctl restart mysqld;
        mysql -u root -e "CREATE USER 'openstack_citest' IDENTIFIED BY 'openstack_citest';";
        mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO 'openstack_citest'@'localhost';";
        mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO 'openstack_citest';";
        mysql -uroot -h127.0.0.1 -e "grant all privileges on openstack_citest.* to openstack_citest@localhost identified by 'openstack_citest';";
        mysql -u root -e "FLUSH PRIVILEGES;";
        tox --sitepackages -v -e dsvm-functional 2>&1 | tee ../logs/testrun.log;
        tar zcvf /home/cloud-user/logs/functional-tests.tar.gz /tmp/dsvm-functional-logs;

# Current installer doesn't configure qos, so we configure it here.
# We use neutron-sanity-check before running API tests.
api:
    rpm_deps: []
    remove_rpm: []
    run: >
        sudo sed -i "/^extension/s/$/,qos/" /etc/neutron/plugin.ini;
        sudo sed -i "/^service_plugins/s/$/,qos/" /etc/neutron/neutron.conf;
        sudo sed -i "/^extension/s/$/,qos/" /etc/neutron/plugins/ml2/ml2_conf.ini;
        sudo systemctl restart neutron-server;
        sanity_parameters=$(grep neutron.conf /usr/lib/systemd/system/neutron-server.service | sed 's/.*bin\/neutron-server//');
        sudo neutron-sanity-check --nodnsmasq_version $sanity_parameters && tox --sitepackages -v -e api 2>&1 | tee ../logs/testrun.log;

tempest:
   rpm_deps: []
   remove_rpm: []
   run: >
     sed -i -E s/,dvr,\?//g /home/stack/tempest/etc/tempest.conf;
   blacklist: [tempest.scenario.test_network_basic_ops.TestNetworkBasicOps.test_router_rescheduling]

# hostvars[inventory_hostname] is a special ansible variable to get all host's facts
# tester.component.tox_target can be one of the following: [unittest, pep8, dsvm-functional, api]

# Common rpm deps needed for all tester types
rpm_deps: [
  gcc, git, python-devel, python-tox, python-testrepository, python-pip,
  python-testscenarios, python-tempest-lib, python-hacking,
  "{{ hostvars[inventory_hostname][tester.component.tox_target]['rpm_deps'] }}"
]

# The rpms that shouldn't be installed on system, when running tests
remove_rpm: [ "{{ hostvars[inventory_hostname][tester.component.tox_target]['remove_rpm'] }}" ]

# Common pre-run steps used by all tester types
neutron_virt_run_config:
  run: >
    set -o pipefail;
    rpm -qa | sort > ../logs/installed-rpms.log;

    truncate --size 0 requirements.txt;
    truncate --size 0 test-requirements.txt;

    {{ hostvars[inventory_hostname][tester.component.tox_target]['run'] }}

  archive:
    - /home/cloud-user/logs/functional-tests.tar.gz


# NOTE: This is the main section. It must exist.
test_config:
  virt:
    RedHat-7:
      setup:
        install: "{{ rpm_deps }}"
        remove: "{{ remove_rpm }}"
      run: "{{ neutron_virt_run_config.run }}"
      archive: "{{ neutron_virt_run_config.archive }}"
    default:
      setup:
        install: "{{ rpm_deps }}"
        remove: "{{ remove_rpm }}"
      run: "{{ neutron_virt_run_config.run }}"
      archive: "{{ neutron_virt_run_config.archive }}"

{'fraction_non_alphanumeric': 0.131870385561936, 'fraction_numerical': 0.007895816242821985, 'mean_word_length': 3.089308176100629, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, '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': '1998791', 'n_tokens_mistral': 3581, 'n_tokens_neox': 3362, 'n_words': 832}