From 9326e4237f4d161f297dc4493ab4928ea6e2bf0f Mon Sep 17 00:00:00 2001 From: Feng Pan Date: Mon, 7 Nov 2016 19:22:21 -0500 Subject: Initial Commit. Change-Id: I212ec4be42357edddd931e9e479e33131ccd4bac Signed-off-by: Feng Pan --- scripts/allow-local-ssh-root.sh | 27 +++++++++++++++++++++++++++ scripts/ci-beaker.sh | 19 +++++++++++++++++++ scripts/ci-unit-tests.sh | 19 +++++++++++++++++++ scripts/prepare-node.sh | 8 ++++++++ 4 files changed, 73 insertions(+) create mode 100755 scripts/allow-local-ssh-root.sh create mode 100755 scripts/ci-beaker.sh create mode 100755 scripts/ci-unit-tests.sh create mode 100755 scripts/prepare-node.sh (limited to 'scripts') diff --git a/scripts/allow-local-ssh-root.sh b/scripts/allow-local-ssh-root.sh new file mode 100755 index 0000000..a3ba4ed --- /dev/null +++ b/scripts/allow-local-ssh-root.sh @@ -0,0 +1,27 @@ +#!/bin/bash -xe + +echo "" | sudo tee -a /etc/ssh/sshd_config +echo "Match address 127.0.0.1" | sudo tee -a /etc/ssh/sshd_config +echo " PermitRootLogin without-password" | sudo tee -a /etc/ssh/sshd_config +echo "" | sudo tee -a /etc/ssh/sshd_config +echo "Match address ::1" | sudo tee -a /etc/ssh/sshd_config +echo " PermitRootLogin without-password" | sudo tee -a /etc/ssh/sshd_config +if [ ! -f ~/.ssh/id_rsa.pub ]; then +if [ -f ~/.ssh/id_rsa ]; then + ssh-keygen -y -f ~/.ssh/id_rsa -b 2048 -P "" > ~/.ssh/id_rsa.pub +else + ssh-keygen -f ~/.ssh/id_rsa -b 2048 -P "" +fi +fi +sudo mkdir -p /root/.ssh +sudo chmod 700 /root/.ssh +sudo rm -f /root/.ssh/authorized_keys +cat ~/.ssh/id_rsa.pub | sudo tee -a /root/.ssh/authorized_keys +sudo chmod 600 /root/.ssh/authorized_keys +sudo restorecon /root/.ssh/authorized_keys +if [ -f /usr/bin/yum ]; then + sudo systemctl restart sshd +elif [ -f /usr/bin/apt-get ]; then + sudo service ssh restart +fi +sudo cat /root/.ssh/authorized_keys diff --git a/scripts/ci-beaker.sh b/scripts/ci-beaker.sh new file mode 100755 index 0000000..ae6f58b --- /dev/null +++ b/scripts/ci-beaker.sh @@ -0,0 +1,19 @@ +#!/bin/bash -xe + +if [ "$#" -ne 1 ]; then + echo "Usage: $0 (centos7, xenial)" + exit 1 +fi + +os=$1 + +sudo sysctl -w vm.nr_hugepages=1024 +cat /proc/meminfo | grep Huge +mkdir .bundled_gems +export GEM_HOME=`pwd`/.bundled_gems +gem install bundler --no-rdoc --no-ri --verbose +$GEM_HOME/bin/bundle install --retry 3 +export BEAKER_set=nodepool-$os +export BEAKER_debug=yes +export BEAKER_color=no +$GEM_HOME/bin/bundle exec rspec spec/acceptance diff --git a/scripts/ci-unit-tests.sh b/scripts/ci-unit-tests.sh new file mode 100755 index 0000000..a8d57ff --- /dev/null +++ b/scripts/ci-unit-tests.sh @@ -0,0 +1,19 @@ +#!/bin/bash -xe + +if [ "$#" -ne 1 ]; then + echo "Usage: $0 " + exit 1 +fi + +puppet_version=$1 +if [ "$puppet_version" != "latest" ]; then + export PUPPET_GEM_VERSION="~> $puppet_version.0" +fi + +mkdir .bundled_gems +export GEM_HOME=`pwd`/.bundled_gems +gem install bundler --no-rdoc --no-ri --verbose +$GEM_HOME/bin/bundle install --retry 3 +$GEM_HOME/bin/bundle exec rake syntax +$GEM_HOME/bin/bundle exec rake lint +$GEM_HOME/bin/bundle exec rake spec SPEC_OPTS='--format documentation' diff --git a/scripts/prepare-node.sh b/scripts/prepare-node.sh new file mode 100755 index 0000000..7f6ad10 --- /dev/null +++ b/scripts/prepare-node.sh @@ -0,0 +1,8 @@ +#!/bin/bash -xe + +if [ -f /usr/bin/yum ]; then +sudo yum -y install libxml2-devel libxslt-devel ruby-devel zlib-devel +elif [ -f /usr/bin/apt-get ]; then +sudo apt-get update +sudo apt-get install -y libxml2-dev libxslt-dev zlib1g-dev +fi -- cgit 1.2.3-korg