<commit_before>#!/bin/bash
#
# This script is a quick and dirty implementation
# that is able to run integration tests for coi
# on jenkins
#
set -e
set -u

ret=0
datestamp=`date "+%Y%m%d%H%M%S"`

# install librarian-puppet-simple
mkdir -p vendor
export GEM_HOME=`pwd`/vendor
gem install thor --no-ri --no-rdoc
if [ -d vendor/librarian-puppet-simple ]; then
  cd vendor/librarian-puppet-simple
  git pull
  cd ../..
else
  git clone git://github.com/bodepd/librarian-puppet-simple vendor/librarian-puppet-simple
fi
export PATH=`pwd`/vendor/librarian-puppet-simple/bin/:$PATH

# puppet_repos_to_use
if [ -n "${puppet_modules_to_use:-}" ]; then
  # this only supports upstream and downstream at the moment
  export repos_to_use=$puppet_modules_to_use
fi

if [ -n "${openstack_version}" ]; then
  export  openstack_version=$openstack_version
fi

# install modules
export module_install_method=librarian
if [ $module_install_method = 'librarian' ]; then
  #librarian-puppet install --clean --verbose
  librarian-puppet install --verbose
else
  # eventually, this could do something like install packages
  echo 'librarian is the only supported install method'
  exit 1
fi

# check out a specific branch that we want to test
if [ -n "${project_name:-}" ]; then
  if [ ! "${project_name:-}" = 'openstack-installer' ]; then
    pushd "modules/$project_name"
  fi
  if [ -n "${checkout_branch_command:-}" ]; then
    eval "${checkout_branch_command}"
  fi
  if [ ! "${project_name:-}" = 'openstack-installer' ]; then
    popd
  fi
fi

if [ $operatingsystem = 'redhat' ]; then
  echo 'operatingsystem: redhat' >> config.yaml
elif [ $operatingsystem = 'ubuntu' ]; then
  echo 'operatingsystem: ubuntu' >> config.yaml
else
  echo "Unsupported operatingsystem ${operatingsystem}"
  exit 1
fi

# set up jenkins specific data overrides
if [ -n "${openstack_package_repo:-}" ]; then
  if [ $openstack_package_repo = 'cisco_repo' ]; then
    echo 'package_repo: cisco_repo' >> hiera_data/jenkins.yaml
    echo 'openstack_repo_location: http://openstack-repo.cisco.com/openstack/cisco' >> hiera_data/jenkins.yaml
    #echo 'openstack_repo_location: ftp://ftpeng.cisco.com/openstack/cisco' >> hiera_data/jenkins.yaml
    echo 'openstack_release: grizzly-proposed' >> hiera_data/jenkins.yaml
  elif [ $openstack_package_repo = 'cloud_archive' ]; then
    echo 'package_repo: cloud_archive' >> hiera_data/jenkins.yaml
    echo "openstack_release: precise-updates/${openstack_version}" >> hiera_data/jenkins.yaml
  else
    echo "Unsupported repo type: ${openstack_package_repo}"
  fi
fi

if [ "${test_type:-}" = 'swift' ]; then

  source tests/swift.sh

  echo 'node_group: swift' >> config.yaml
  destroy_swift
  deploy_swift_multi

  if [ "${test_mode}" = 'basic_tests' ]; then
    vagrant ssh swift_proxy -c 'ruby /tmp/swift_test_file.rb;exit $?'
  elif [ "${test_mode}" = 'none' ]; then
    echo 'building an environment without running tests'
  else
    echo "Unsupported swift test type ${test_mode}"
  fi

elif [ "${test_type:-}" = 'openstack_multi' ]; then<commit_msg>set network_service for havana<commit_after>#!/bin/bash
#
# This script is a quick and dirty implementation
# that is able to run integration tests for coi
# on jenkins
#
set -e
set -u

ret=0
datestamp=`date "+%Y%m%d%H%M%S"`

# install librarian-puppet-simple
mkdir -p vendor
export GEM_HOME=`pwd`/vendor
gem install thor --no-ri --no-rdoc
if [ -d vendor/librarian-puppet-simple ]; then
  cd vendor/librarian-puppet-simple
  git pull
  cd ../..
else
  git clone git://github.com/bodepd/librarian-puppet-simple vendor/librarian-puppet-simple
fi
export PATH=`pwd`/vendor/librarian-puppet-simple/bin/:$PATH

# puppet_repos_to_use
if [ -n "${puppet_modules_to_use:-}" ]; then
  # this only supports upstream and downstream at the moment
  export repos_to_use=$puppet_modules_to_use
fi

if [ -n "${openstack_version}" ]; then
  export  openstack_version=$openstack_version
fi

# install modules
export module_install_method=librarian
if [ $module_install_method = 'librarian' ]; then
  #librarian-puppet install --clean --verbose
  librarian-puppet install --verbose
else
  # eventually, this could do something like install packages
  echo 'librarian is the only supported install method'
  exit 1
fi

# check out a specific branch that we want to test
if [ -n "${project_name:-}" ]; then
  if [ ! "${project_name:-}" = 'openstack-installer' ]; then
    pushd "modules/$project_name"
  fi
  if [ -n "${checkout_branch_command:-}" ]; then
    eval "${checkout_branch_command}"
  fi
  if [ ! "${project_name:-}" = 'openstack-installer' ]; then
    popd
  fi
fi

if [ $operatingsystem = 'redhat' ]; then
  echo 'operatingsystem: redhat' >> config.yaml
elif [ $operatingsystem = 'ubuntu' ]; then
  echo 'operatingsystem: ubuntu' >> config.yaml
else
  echo "Unsupported operatingsystem ${operatingsystem}"
  exit 1
fi

# set up jenkins specific data overrides
if [ -n "${openstack_package_repo:-}" ]; then
  if [ $openstack_package_repo = 'cisco_repo' ]; then
    echo 'package_repo: cisco_repo' >> hiera_data/jenkins.yaml
    echo 'openstack_repo_location: http://openstack-repo.cisco.com/openstack/cisco' >> hiera_data/jenkins.yaml
    #echo 'openstack_repo_location: ftp://ftpeng.cisco.com/openstack/cisco' >> hiera_data/jenkins.yaml
    echo 'openstack_release: grizzly-proposed' >> hiera_data/jenkins.yaml
  elif [ $openstack_package_repo = 'cloud_archive' ]; then
    echo 'package_repo: cloud_archive' >> hiera_data/jenkins.yaml
    echo "openstack_release: precise-updates/${openstack_version}" >> hiera_data/jenkins.yaml
  else
    echo "Unsupported repo type: ${openstack_package_repo}"
  fi
fi

if [ $openstack_version = 'havana' ];then
  echo 'network_service: neutron' >> hiera_data/jenkins.yaml
fi

if [ "${test_type:-}" = 'swift' ]; then

  source tests/swift.sh

  echo 'node_group: swift' >> config.yaml
  destroy_swift
  deploy_swift_multi

  if [ "${test_mode}" = 'basic_tests' ]; then
    vagrant ssh swift_proxy -c 'ruby /tmp/swift_test_file.rb;exit $?'
  elif [ "${test_mode}" = 'none' ]; then
    echo 'building an environment without running tests'
  else
    echo "Unsupported swift test type ${test_mode}"
  fi

elif [ "${test_type:-}" = 'openstack_multi' ]; then
{'fraction_non_alphanumeric': 0.12636305323925592, 'fraction_numerical': 0.0009621552277100705, 'mean_word_length': 4.326216908625106, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 41, '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': '3351480', 'n_tokens_mistral': 2192, 'n_tokens_neox': 2136, 'n_words': 549}