aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorFeng Pan <fpan@redhat.com>2016-11-07 19:22:21 -0500
committerFeng Pan <fpan@redhat.com>2016-11-21 21:27:09 -0500
commit9326e4237f4d161f297dc4493ab4928ea6e2bf0f (patch)
tree25372fa964fe84b160c5bfc58304285902edbefc /scripts
parentc70bea9fb9cd5dfb29d7ab8f7aaae7324c31f1e3 (diff)
Initial Commit.
Change-Id: I212ec4be42357edddd931e9e479e33131ccd4bac Signed-off-by: Feng Pan <fpan@redhat.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/allow-local-ssh-root.sh27
-rwxr-xr-xscripts/ci-beaker.sh19
-rwxr-xr-xscripts/ci-unit-tests.sh19
-rwxr-xr-xscripts/prepare-node.sh8
4 files changed, 73 insertions, 0 deletions
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 <os> (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 <puppet_version>"
+ 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