Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add wardenized service ci support for warden v2

Change-Id: If24933f18847df2533ff229599deec4f791bdb29
  • Loading branch information...
commit 638c6498c82f75261bb07e877217681e328efb02 1 parent a6a12e3
@SlimYang SlimYang authored
View
8 config/blobs.yml
@@ -27,10 +27,6 @@ ruby/ruby-1.8.7-p357.tar.bz2:
object_id: eyJvaWQiOiI0ZTRlNzhiY2E1MWUxMjEyMDRlNGU4NmVlOGUyYzkwNTA1MmU1%0AY2EzNGI4NCIsInNpZyI6Im9haVBNWVJxTmxEaE1ZM3RXbWpBbkplY0xUUT0i%0AfQ==%0A
sha: ba5ec0ab663976f00fb405be6cfef546bcf0e4e9
size: 4208157
-warden_service/warden-service.tgz:
- object_id: eyJvaWQiOiI0ZTRlNzhiY2EzMWUxMjIwMDRlNGU4ZWM2NDZlMjEwNTA1MmU1%0AY2QyYjI0ZiIsInNpZyI6InM1NDRKOElmbUxNdWNOdWtZTk5NT2svL1F3az0i%0AfQ==%0A
- sha: a08307c5051aa155831d91bb09b562334677bc2a
- size: 185472587
sqlite/sqlite-autoconf-3070500.tar.gz:
object_id: eyJvaWQiOiI0ZTRlNzhiY2ExMWUxMjIyMDRlNGU5ODYzOGI3NjMwNTA1MmU1%0AZGI0NjhhYyIsInNpZyI6ImxVK3hDU2NMWE51SGhJazlmcUFtSEQ4bjQybz0i%0AfQ==%0A
sha: 4e1338497b8da50b84307191bb3418e9ec5715d7
@@ -207,3 +203,7 @@ vpostgres/vpostgres.tgz:
object_id: eyJvaWQiOiI0ZTRlNzhiY2E0MWUxMjIwMDRlNGU4ZWM2NWY2N2YwNTA1MmU2%0AMzJkZDFlMyIsInNpZyI6Im0zbGUyTnQvZ3R0ZW9zZE1zckdWaDc5T0Ivaz0i%0AfQ==%0A
sha: adfebccef8c102d145cf00284f9b19b99087e0b4
size: 16459135
+wardenized_services/wardenized_services.tar.gz:
+ object_id: eyJvaWQiOiI0ZTRlNzhiY2EzMWUxMjEyMDRlNGU4NmVlMzk2OTIwNTA5NzRl%0AZDQ4MzUyYyIsInNpZyI6IjRVOXNucmRjaVU3cXdaZzI3L1RoK29VT1U0OD0i%0AfQ==%0A
+ sha: 072cb3ffc526471d78a89c624e91dd60c9c5aa95
+ size: 477551550
View
2  jobs/jenkins/templates/config_slave
@@ -76,7 +76,7 @@
<string>VCAP_MEMCACHED</string>
<string>/var/vcap/packages/memcached</string>
<string>VCAP_WARDEN_SERVICE</string>
- <string>/var/vcap/packages/warden-service</string>
+ <string>/var/vcap/packages/wardenized_services</string>
<string>VCAP_ELASTIC</string>
<string>/var/vcap/packages/elasticsearch</string>
<string>VCAP_COUCHDB</string>
View
2  jobs/jenkins_slave/spec
@@ -38,7 +38,7 @@ packages:
- vblob
- mysql-service
- vpostgres
- - warden-service
+ - wardenized_services
- elasticsearch
- couchdb
- zabbix_agent
View
10 packages/warden-service/packaging
@@ -1,10 +0,0 @@
-# abort script on any command that exit with a non zero value
-set -e
-
-mkdir unpack_warden_service
-tar zxf warden_service/warden-service.tgz -C unpack_warden_service
-
-(
- cd unpack_warden_service
- cp -af 1.1/* $BOSH_INSTALL_TARGET
-)
View
4 packages/warden-service/spec
@@ -1,4 +0,0 @@
----
-name: warden-service
-files:
-- warden_service/warden-service.tgz
View
10 packages/wardenized_services/packaging
@@ -0,0 +1,10 @@
+# abort script on any command that exit with a non zero value
+set -e
+
+mkdir unpack_wardenized_services
+tar zxf wardenized_services/wardenized_services.tar.gz -C unpack_wardenized_services
+(
+ cd unpack_wardenized_services
+ rm -rf ${BOSH_INSTALL_TARGET}
+ cp -af 1.1 ${BOSH_INSTALL_TARGET}
+)
View
4 packages/wardenized_services/spec
@@ -0,0 +1,4 @@
+---
+name: wardenized_services
+files:
+- wardenized_services/wardenized_services.tar.gz
View
121 src/jenkins_jobs/SERVICES_Mongo_Warden/config.xml.erb
@@ -3,12 +3,12 @@
<actions/>
<description></description>
<displayName>Mongodb Warden Unit Test</displayName>
-  <logRotator>
-    <daysToKeep>30</daysToKeep>
-    <numToKeep>-1</numToKeep>
-    <artifactDaysToKeep>-1</artifactDaysToKeep>
-    <artifactNumToKeep>-1</artifactNumToKeep>
-  </logRotator>
+ <logRotator>
+ <daysToKeep>30</daysToKeep>
+ <numToKeep>-1</numToKeep>
+ <artifactDaysToKeep>-1</artifactDaysToKeep>
+ <artifactNumToKeep>-1</artifactNumToKeep>
+ </logRotator>
<keepDependencies>false</keepDependencies>
<properties>
<hudson.plugins.throttleconcurrents.ThrottleJobProperty>
@@ -23,13 +23,13 @@
<userRemoteConfigs>
<hudson.plugins.git.UserRemoteConfig>
<name></name>
- <refspec>$GERRIT_REFSPEC</refspec>
+ <refspec></refspec>
<url>ssh://<%= ENV['CF_CI_USER'] %>@<%= ENV['CF_GERRIT_ADDRESS'] %>:<%= ENV['CF_GERRIT_PORT'] %>/vcap-services.git</url>
</hudson.plugins.git.UserRemoteConfig>
</userRemoteConfigs>
<branches>
<hudson.plugins.git.BranchSpec>
- <name>$GERRIT_BRANCH</name>
+ <name>master</name>
</hudson.plugins.git.BranchSpec>
</branches>
<disableSubmodules>false</disableSubmodules>
@@ -40,9 +40,7 @@
<wipeOutWorkspace>false</wipeOutWorkspace>
<pruneBranches>false</pruneBranches>
<remotePoll>false</remotePoll>
- <buildChooser class="com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerBuildChooser">
- <separator>#</separator>
- </buildChooser>
+ <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
<gitTool>Default</gitTool>
<submoduleCfg class="list"/>
<relativeTargetDir></relativeTargetDir>
@@ -72,15 +70,18 @@ MONGODB_REALPATH=`readlink -nf $VCAP_MONGODB`
WARDEN_SRV_REALPATH=`readlink -nf $VCAP_WARDEN_SERVICE`
WARDEN_PKG=/var/vcap/packages/warden/warden
-MONGO_SVC=$PWD/mongodb
+MONGO_SVC=$PWD/ng/mongodb
+rm -rf $MONGO_SVC/spec_reports
-#
-# HACK - Base expects to be able to write to /var/vcap/sys/run/LOCK
-#
-SCRATCHPAD=$MONGO_SVC/xxx_scratchpad
-rm -rf $SCRATCHPAD
-mkdir -p $SCRATCHPAD/log/warden
-mkdir -p $SCRATCHPAD/run/warden
+echo &quot;creating the warden container for unit-test&quot;
+HANDLE=`$WARDEN_REPL_V2 -- create --bind_mounts[0].src_path &quot;$RUBY19_REALPATH&quot; --bind_mounts[0].dst_path &quot;$RUBY19_REALPATH&quot; --bind_mounts[0].mode RO \
+--bind_mounts[1].src_path &quot;$GIT_REALPATH&quot; --bind_mounts[1].dst_path &quot;$GIT_REALPATH&quot; --bind_mounts[1].mode RO \
+--bind_mounts[2].src_path &quot;$SQLITE_REALPATH&quot; --bind_mounts[2].dst_path &quot;$SQLITE_REALPATH&quot; --bind_mounts[2].mode RO \
+--bind_mounts[3].src_path &quot;$VCAP_WARDEN_SERVICE&quot; --bind_mounts[3].dst_path &quot;$WARDEN_PKG&quot; --bind_mounts[3].mode RO \
+--bind_mounts[4].src_path &quot;$WARDEN_SRV_REALPATH/root/linux/base/rootfs&quot; --bind_mounts[4].dst_path &quot;/var/vcap/data/warden/rootfs&quot; --bind_mounts[4].mode RO \
+--bind_mounts[5].src_path &quot;$WARDEN_INSTANCES&quot; --bind_mounts[5].dst_path &quot;$WARDEN_INSTANCES&quot; --bind_mounts[5].mode RW \
+--bind_mounts[6].src_path &quot;$MONGODB_REALPATH&quot; --bind_mounts[6].dst_path &quot;$MONGODB_REALPATH&quot; --bind_mounts[6].mode RW \
+| cut -d &quot; &quot; -f 3`
TEST_RUNNER=`mktemp`
cat &lt;&lt;-EOT &gt; $TEST_RUNNER
@@ -93,44 +94,74 @@ export LIBRARY_PATH=$SQLITE_REALPATH/lib:$LIBRARY_PATH
export C_INCLUDE_PATH=$SQLITE_REALPATH/include:$C_INCLUDE_PATH
export CI_ENV=&apos;jenkins&apos;
-sudo mkdir -p /var/vcap/sys/log/warden
+# nats expects to write in /var/vcap/sys/run
+sudo mkdir -p /var/vcap/sys/run
+sudo chown -R vcap:vcap /var/vcap/sys/run
-cd $WARDEN_PKG
-bundle config
-bundle --local install --deployment --without=devlopment test
+# prepare the log dir for warden and other dirs for mongodb
+mkdir -p /var/vcap/sys/log/warden
+mkdir -p /tmp/warden
+cp -a /var/vcap/data/warden/rootfs /tmp/warden
+ls /tmp/warden/rootfs/usr/share/mongodb/mongodb-1.8/mongorestore
-cd /tmp/mongo_source/mongodb
-mkdir -p /tmp/mongo_backup
-rm -rf .bundle
-rm -rf vendor/bundle
-sed -i -e &quot;s/mongodump_path: mongodump/mongodump_path: \/usr\/bin\/mongodump/g&quot; config/mongodb_backup.yml
-bundle config
-bundle install --path vendor/bundle
+# echo the address of github into the /etc/hosts in case warden cannot find it
+sudo echo &quot;207.97.227.239 github.com&quot; &gt;&gt; /etc/hosts
+
+# dynamically generate the config for the warden server
+cat &gt; /tmp/warden_server.yml &lt;&lt;-EOF
+---
+server:
+ container_klass: Warden::Container::Linux
+ container_grace_time: 300
+ unix_domain_permissions: 0777
+ container_rootfs_path: /var/vcap/data/warden/rootfs
+ container_depot_path: /var/vcap/data/warden/depot/$HANDLE
+ container_limits_conf:
+ nofile: 8192
+ nproc: 512
+ as: 4194304
+ quota:
+ disk_quota_enabled: false
+
+logging:
+ level: debug2
+network:
+ pool_start_address: 50.254.0.0
+ pool_size: 256
+
+user:
+ pool_start_uid: 10000
+ pool_size: 256
+EOF
+
+# start the warden server
cd $WARDEN_PKG
-nohup bundle exec rake warden:start[config/mongodb.yml] &gt;&gt; /var/vcap/sys/log/warden/warden.stdout.log 2&gt;&gt;/var/vcap/sys/log/warden/warden.stderr.log &amp;
+nohup bundle exec rake warden:start[/tmp/warden_server.yml] &gt;&gt; /var/vcap/sys/log/warden/warden.stdout.log 2&gt;&gt;/var/vcap/sys/log/warden/warden.stderr.log &amp;
sleep 5
+which mongodump
+
cd /tmp/mongo_source/mongodb
-bundle exec nats-server --daemonize --pid /tmp/nats.pid
+mkdir -p /tmp/mongo_backup
+rm -rf .bundle
+rm -rf vendor/bundle
+bundle install --deployment
bundle exec rake spec:ci
EOT
-echo &quot;creating the warden container for unit-test&quot;
-HANDLE=`$WARDEN_REPL -e -c &quot;create bind_mount:$RUBY19_REALPATH,$RUBY19_REALPATH,ro bind_mount:$GIT_REALPATH,$GIT_REALPATH,ro bind_mount:$SQLITE_REALPATH,$SQLITE_REALPATH,ro bind_mount:$SCRATCHPAD,/var/vcap/sys/run,rw bind_mount:$MONGODB_REALPATH,$MONGODB_REALPATH,ro bind_mount:$VCAP_WARDEN_SERVICE,/var/vcap/packages/warden/warden,rw disk_size_mb:4096 &quot;`
-
echo &quot;enable vcap could execute sudo without password within warden&quot;
-sudo ls $WARDEN_PKG/root/linux/instances/$HANDLE/ssh/ssh_config
+sudo ls $WARDEN_INSTANCES/$HANDLE/ssh/ssh_config
set +e
vcap_sudo_line=&quot;vcap ALL=(ALL) NOPASSWD:ALL&quot;
-vcap_chk_ret=`sudo ssh -T -F $WARDEN_PKG/root/linux/instances/$HANDLE/ssh/ssh_config root@container cat /etc/sudoers | grep &quot;$vcap_sudo_line&quot;`
+vcap_chk_ret=`sudo ssh -T -F $WARDEN_INSTANCES/$HANDLE/ssh/ssh_config root@container cat /etc/sudoers | grep &quot;$vcap_sudo_line&quot;`
if test -z &quot;$vcap_chk_ret&quot;
then
- sudo ssh -T -F $WARDEN_PKG/root/linux/instances/$HANDLE/ssh/ssh_config root@container chmod 740 /etc/sudoers
- sudo ssh -T -F $WARDEN_PKG/root/linux/instances/$HANDLE/ssh/ssh_config root@container &quot;echo \&quot;Defaults:vcap !requiretty\&quot; &gt;&gt; /etc/sudoers&quot;
- sudo ssh -T -F $WARDEN_PKG/root/linux/instances/$HANDLE/ssh/ssh_config root@container &quot;echo \&quot;$vcap_sudo_line\&quot; &gt;&gt; /etc/sudoers&quot;
- sudo ssh -T -F $WARDEN_PKG/root/linux/instances/$HANDLE/ssh/ssh_config root@container chmod 440 /etc/sudoers
+ sudo ssh -T -F $WARDEN_INSTANCES/$HANDLE/ssh/ssh_config root@container chmod 740 /etc/sudoers
+ sudo ssh -T -F $WARDEN_INSTANCES/$HANDLE/ssh/ssh_config root@container &quot;echo \&quot;Defaults:vcap !requiretty\&quot; &gt;&gt; /etc/sudoers&quot;
+ sudo ssh -T -F $WARDEN_INSTANCES/$HANDLE/ssh/ssh_config root@container &quot;echo \&quot;$vcap_sudo_line\&quot; &gt;&gt; /etc/sudoers&quot;
+ sudo ssh -T -F $WARDEN_INSTANCES/$HANDLE/ssh/ssh_config root@container chmod 440 /etc/sudoers
fi
set -e
@@ -150,16 +181,16 @@ rm -f $TEST_RUNNER</command>
</builders>
<publishers>
<hudson.tasks.ArtifactArchiver>
- <artifacts>mongodb/spec_reports/**</artifacts>
+ <artifacts>ng/mongodb/spec_reports/**</artifacts>
<latestOnly>false</latestOnly>
</hudson.tasks.ArtifactArchiver>
<hudson.tasks.junit.JUnitResultArchiver>
- <testResults>mongodb/spec_reports/*.xml</testResults>
+ <testResults>ng/mongodb/spec_reports/*.xml</testResults>
<keepLongStdio>false</keepLongStdio>
<testDataPublishers/>
</hudson.tasks.junit.JUnitResultArchiver>
<hudson.plugins.rubyMetrics.rcov.RcovPublisher>
- <reportDir>mongodb/spec_coverage/rcov</reportDir>
+ <reportDir>ng/mongodb/spec_coverage/rcov</reportDir>
<targets>
<hudson.plugins.rubyMetrics.rcov.model.MetricTarget>
<metric>TOTAL_COVERAGE</metric>
@@ -177,4 +208,4 @@ rm -f $TEST_RUNNER</command>
</hudson.plugins.rubyMetrics.rcov.RcovPublisher>
</publishers>
<buildWrappers/>
-</project>
+</project>
View
233 src/jenkins_jobs/SERVICES_Mysql_Warden/config.xml.erb
@@ -0,0 +1,233 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<project>
+ <actions/>
+ <description></description>
+ <displayName>Mysql Warden Unit Test</displayName>
+ <logRotator>
+ <daysToKeep>30</daysToKeep>
+ <numToKeep>-1</numToKeep>
+ <artifactDaysToKeep>-1</artifactDaysToKeep>
+ <artifactNumToKeep>-1</artifactNumToKeep>
+ </logRotator>
+ <keepDependencies>false</keepDependencies>
+ <properties>
+ <hudson.plugins.throttleconcurrents.ThrottleJobProperty>
+ <maxConcurrentPerNode>0</maxConcurrentPerNode>
+ <maxConcurrentTotal>0</maxConcurrentTotal>
+ <throttleEnabled>false</throttleEnabled>
+ <throttleOption>project</throttleOption>
+ </hudson.plugins.throttleconcurrents.ThrottleJobProperty>
+ </properties>
+ <scm class="hudson.plugins.git.GitSCM">
+ <configVersion>2</configVersion>
+ <userRemoteConfigs>
+ <hudson.plugins.git.UserRemoteConfig>
+ <name></name>
+ <refspec>refs/changes/73/10973/4</refspec>
+ <url>ssh://<%= ENV['CF_CI_USER'] %>@<%= ENV['CF_GERRIT_ADDRESS'] %>:<%= ENV['CF_GERRIT_PORT'] %>/vcap-services.git</url>
+ </hudson.plugins.git.UserRemoteConfig>
+ </userRemoteConfigs>
+ <branches>
+ <hudson.plugins.git.BranchSpec>
+ <name>master</name>
+ </hudson.plugins.git.BranchSpec>
+ </branches>
+ <disableSubmodules>false</disableSubmodules>
+ <recursiveSubmodules>false</recursiveSubmodules>
+ <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
+ <authorOrCommitter>false</authorOrCommitter>
+ <clean>false</clean>
+ <wipeOutWorkspace>false</wipeOutWorkspace>
+ <pruneBranches>false</pruneBranches>
+ <remotePoll>false</remotePoll>
+ <buildChooser class="com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerBuildChooser">
+ <separator>#</separator>
+ </buildChooser>
+ <gitTool>Default</gitTool>
+ <submoduleCfg class="list"/>
+ <relativeTargetDir></relativeTargetDir>
+ <reference></reference>
+ <excludedRegions></excludedRegions>
+ <excludedUsers></excludedUsers>
+ <gitConfigName></gitConfigName>
+ <gitConfigEmail></gitConfigEmail>
+ <skipTag>false</skipTag>
+ <includedRegions></includedRegions>
+ <scmName></scmName>
+ </scm>
+ <canRoam>true</canRoam>
+ <disabled>false</disabled>
+ <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
+ <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
+ <triggers class="vector"/>
+ <concurrentBuild>true</concurrentBuild>
+ <builders>
+ <hudson.tasks.Shell>
+ <command>export PATH=$VCAP_RUBY19/bin:$PATH
+
+RUBY19_REALPATH=`readlink -nf $VCAP_RUBY19`
+SQLITE_REALPATH=`readlink -nf $VCAP_SQLITE`
+GIT_REALPATH=`readlink -nf $VCAP_GIT`
+MYSQL_REALPATH=`readlink -nf $VCAP_MYSQLSEV`
+MYSQLCLI_REALPATH=`readlink -nf $VCAP_MYSQLCLIENT`
+WARDEN_SRV_REALPATH=`readlink -nf $VCAP_WARDEN_SERVICE`
+WARDEN_PKG=/var/vcap/packages/warden/warden
+
+MYSQL_SVC=$PWD/ng/mysql
+rm -rf MYSQL_SVC/spec_reports
+
+echo &quot;creating the warden container for unit-test&quot;
+HANDLE=`$WARDEN_REPL_V2 -- create --bind_mounts[0].src_path &quot;$RUBY19_REALPATH&quot; --bind_mounts[0].dst_path &quot;$RUBY19_REALPATH&quot; --bind_mounts[0].mode RO \
+--bind_mounts[1].src_path &quot;$GIT_REALPATH&quot; --bind_mounts[1].dst_path &quot;$GIT_REALPATH&quot; --bind_mounts[1].mode RO \
+--bind_mounts[2].src_path &quot;$SQLITE_REALPATH&quot; --bind_mounts[2].dst_path $SQLITE_REALPATH --bind_mounts[2].mode RO \
+--bind_mounts[3].src_path &quot;$VCAP_WARDEN_SERVICE&quot; --bind_mounts[3].dst_path &quot;$WARDEN_PKG&quot; --bind_mounts[3].mode RO \
+--bind_mounts[4].src_path &quot;$WARDEN_SRV_REALPATH/root/linux/base/rootfs&quot; --bind_mounts[4].dst_path &quot;/var/vcap/data/warden/rootfs&quot; --bind_mounts[4].mode RO \
+--bind_mounts[5].src_path &quot;$WARDEN_INSTANCES&quot; --bind_mounts[5].dst_path &quot;$WARDEN_INSTANCES&quot; --bind_mounts[5].mode RW \
+--bind_mounts[6].src_path &quot;$MYSQL_REALPATH&quot; --bind_mounts[6].dst_path &quot;$VCAP_MYSQL&quot; --bind_mounts[6].mode RO \
+--bind_mounts[7].src_path &quot;$MYSQLCLI_REALPATH&quot; --bind_mounts[7].dst_path &quot;$VCAP_MYSQLCLIENT&quot; --bind_mounts[7].mode RO \
+| cut -d &quot; &quot; -f 3`
+
+TEST_RUNNER=`mktemp`
+cat &lt;&lt;-EOT &gt; $TEST_RUNNER
+#!/bin/bash
+set -x
+set -o errexit
+
+export PATH=$RUBY19_REALPATH/bin:$GIT_REALPATH/bin:$VCAP_MYSQL/bin:$VCAP_MYSQLCLIENT/sbin:$PATH
+export LIBRARY_PATH=$SQLITE_REALPATH/lib:$VCAP_MYSQLCLIENT/lib/mysql:$VCAP_MYSQL/lib/mysql:$LIBRARY_PATH
+export C_INCLUDE_PATH=$SQLITE_REALPATH/include:$C_INCLUDE_PATH
+export LD_LIBRARY_PATH=$VCAP_MYSQLCLIENT/lib/mysql:$VCAP_MYSQL/lib/mysql:$LD_LIBRARY_PATH
+export CI_ENV=&apos;jenkins&apos;
+
+# nats expects to write in /var/vcap/sys/run
+sudo mkdir -p /var/vcap/sys/run
+sudo chown -R vcap:vcap /var/vcap/sys/run
+
+# start the mysql process outside the warden container
+mkdir -p /tmp/var/vcap/packages/mysql
+cp -r /var/vcap/packages/mysql/* /tmp/var/vcap/packages/mysql/
+/tmp/var/vcap/packages/mysql/libexec/mysql.server start /tmp/var/vcap/packages/mysql/my.cnf
+/tmp/var/vcap/packages/mysql/bin/mysqladmin -u root password root -S /tmp/mysql.sock
+
+# prepare the log dir for warden
+mkdir -p /var/vcap/sys/log/warden
+
+# echo the address of github into the /etc/hosts in case warden cannot find it
+sudo echo &quot;207.97.227.239 github.com&quot; &gt;&gt; /etc/hosts
+
+# dynamically generate the config for the warden server
+cat &gt; /tmp/warden_server.yml &lt;&lt;-EOF
+---
+server:
+ container_klass: Warden::Container::Linux
+ container_grace_time: 300
+ unix_domain_permissions: 0777
+ container_rootfs_path: /var/vcap/data/warden/rootfs
+ container_depot_path: /var/vcap/data/warden/depot/$HANDLE
+ container_limits_conf:
+ nofile: 8192
+ nproc: 512
+ as: 4194304
+ quota:
+ disk_quota_enabled: false
+
+logging:
+ level: debug2
+
+network:
+ pool_start_address: 60.254.0.0
+ pool_size: 256
+
+user:
+ pool_start_uid: 10000
+ pool_size: 256
+EOF
+
+# start the warden server
+cd $WARDEN_PKG
+nohup bundle exec rake warden:start[/tmp/warden_server.yml] &gt;&gt; /var/vcap/sys/log/warden/warden.stdout.log 2&gt;&gt;/var/vcap/sys/log/warden/warden.stderr.log &amp;
+sleep 5
+
+cd /tmp/mysql_source/mysql
+rm -rf .bundle
+rm -rf vendor/bundle
+
+sed -i &apos;s/use_warden: false/use_warden: true/g&apos; config/mysql_node.yml
+bundle install --deployment
+bundle exec rake spec:ci
+EOT
+
+CREATE_LOOP=`mktemp`
+cat &lt;&lt;-EOT &gt; $CREATE_LOOP
+#!/bin/bash
+loop_device_count=128
+for i in \$(seq 0 \$(expr \$loop_device_count - 1)); do
+ file=/dev/loop\${i}
+ if [ ! -b \${file} ]; then
+ mknod -m0660 \${file} b 7 \${i}
+ chown root.disk \${file}
+ fi
+done
+EOT
+
+echo &quot;enable vcap could execute sudo without password within warden&quot;
+sudo ls $WARDEN_INSTANCES/$HANDLE/ssh/ssh_config
+set +e
+vcap_sudo_line=&quot;vcap ALL=(ALL) NOPASSWD:ALL&quot;
+vcap_chk_ret=`sudo ssh -T -F $WARDEN_INSTANCES/$HANDLE/ssh/ssh_config root@container cat /etc/sudoers | grep &quot;$vcap_sudo_line&quot;`
+if test -z &quot;$vcap_chk_ret&quot;
+then
+ sudo ssh -T -F $WARDEN_INSTANCES/$HANDLE/ssh/ssh_config root@container chmod 740 /etc/sudoers
+ sudo ssh -T -F $WARDEN_INSTANCES/$HANDLE/ssh/ssh_config root@container &quot;echo \&quot;Defaults:vcap !requiretty\&quot; &gt;&gt; /etc/sudoers&quot;
+ sudo ssh -T -F $WARDEN_INSTANCES/$HANDLE/ssh/ssh_config root@container &quot;echo \&quot;$vcap_sudo_line\&quot; &gt;&gt; /etc/sudoers&quot;
+ sudo ssh -T -F $WARDEN_INSTANCES/$HANDLE/ssh/ssh_config root@container chmod 440 /etc/sudoers
+fi
+set -e
+
+echo &quot;staring the unit test&quot;
+$WARDEN_REPL -e -x -c &quot;
+copy $HANDLE in $MYSQL_SVC /tmp/mysql_source
+copy $HANDLE in $TEST_RUNNER /tmp
+run $HANDLE chmod +x $TEST_RUNNER
+copy $HANDLE in $CREATE_LOOP /tmp
+run $HANDLE chmod +x $CREATE_LOOP
+run $HANDLE sudo /bin/bash $CREATE_LOOP
+run $HANDLE sudo /bin/bash $TEST_RUNNER
+copy $HANDLE out /tmp/mysql_source/mysql/spec_reports $MYSQL_SVC vcap:vcap
+copy $HANDLE out /tmp/mysql_source/mysql/spec_coverage $MYSQL_SVC vcap:vcap
+destroy $HANDLE
+&quot;
+
+rm -f $TEST_RUNNER</command>
+ </hudson.tasks.Shell>
+ </builders>
+ <publishers>
+ <hudson.tasks.ArtifactArchiver>
+ <artifacts>ng/mysql/spec_reports/**</artifacts>
+ <latestOnly>false</latestOnly>
+ </hudson.tasks.ArtifactArchiver>
+ <hudson.tasks.junit.JUnitResultArchiver>
+ <testResults>ng/mysql/spec_reports/*.xml</testResults>
+ <keepLongStdio>false</keepLongStdio>
+ <testDataPublishers/>
+ </hudson.tasks.junit.JUnitResultArchiver>
+ <hudson.plugins.rubyMetrics.rcov.RcovPublisher>
+ <reportDir>ng/mysql/spec_coverage/rcov</reportDir>
+ <targets>
+ <hudson.plugins.rubyMetrics.rcov.model.MetricTarget>
+ <metric>TOTAL_COVERAGE</metric>
+ <healthy>80</healthy>
+ <unhealthy>0</unhealthy>
+ <unstable>0</unstable>
+ </hudson.plugins.rubyMetrics.rcov.model.MetricTarget>
+ <hudson.plugins.rubyMetrics.rcov.model.MetricTarget>
+ <metric>CODE_COVERAGE</metric>
+ <healthy>80</healthy>
+ <unhealthy>0</unhealthy>
+ <unstable>0</unstable>
+ </hudson.plugins.rubyMetrics.rcov.model.MetricTarget>
+ </targets>
+ </hudson.plugins.rubyMetrics.rcov.RcovPublisher>
+ </publishers>
+ <buildWrappers/>
+</project>
View
233 src/jenkins_jobs/SERVICES_Postgresql_Warden/config.xml.erb
@@ -0,0 +1,233 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<project>
+ <actions/>
+ <description></description>
+ <displayName>Postgres Warden Unit Test</displayName>
+ <logRotator>
+ <daysToKeep>30</daysToKeep>
+ <numToKeep>-1</numToKeep>
+ <artifactDaysToKeep>-1</artifactDaysToKeep>
+ <artifactNumToKeep>-1</artifactNumToKeep>
+ </logRotator>
+ <keepDependencies>false</keepDependencies>
+ <properties>
+ <hudson.plugins.throttleconcurrents.ThrottleJobProperty>
+ <maxConcurrentPerNode>0</maxConcurrentPerNode>
+ <maxConcurrentTotal>0</maxConcurrentTotal>
+ <throttleEnabled>false</throttleEnabled>
+ <throttleOption>project</throttleOption>
+ </hudson.plugins.throttleconcurrents.ThrottleJobProperty>
+ </properties>
+ <scm class="hudson.plugins.git.GitSCM">
+ <configVersion>2</configVersion>
+ <userRemoteConfigs>
+ <hudson.plugins.git.UserRemoteConfig>
+ <name></name>
+ <refspec>refs/changes/70/10970/5</refspec>
+ <url>ssh://<%= ENV['CF_CI_USER'] %>@<%= ENV['CF_GERRIT_ADDRESS'] %>:<%= ENV['CF_GERRIT_PORT'] %>/vcap-services.git</url>
+ </hudson.plugins.git.UserRemoteConfig>
+ </userRemoteConfigs>
+ <branches>
+ <hudson.plugins.git.BranchSpec>
+ <name>master</name>
+ </hudson.plugins.git.BranchSpec>
+ </branches>
+ <disableSubmodules>false</disableSubmodules>
+ <recursiveSubmodules>false</recursiveSubmodules>
+ <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
+ <authorOrCommitter>false</authorOrCommitter>
+ <clean>false</clean>
+ <wipeOutWorkspace>false</wipeOutWorkspace>
+ <pruneBranches>false</pruneBranches>
+ <remotePoll>false</remotePoll>
+ <buildChooser class="com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerBuildChooser">
+ <separator>#</separator>
+ </buildChooser>
+ <gitTool>Default</gitTool>
+ <submoduleCfg class="list"/>
+ <relativeTargetDir></relativeTargetDir>
+ <reference></reference>
+ <excludedRegions></excludedRegions>
+ <excludedUsers></excludedUsers>
+ <gitConfigName></gitConfigName>
+ <gitConfigEmail></gitConfigEmail>
+ <skipTag>false</skipTag>
+ <includedRegions></includedRegions>
+ <scmName></scmName>
+ </scm>
+ <canRoam>true</canRoam>
+ <disabled>false</disabled>
+ <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
+ <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
+ <triggers class="vector"/>
+ <concurrentBuild>true</concurrentBuild>
+ <builders>
+ <hudson.tasks.Shell>
+ <command>export PATH=$VCAP_RUBY19/bin:$PATH
+
+RUBY19_REALPATH=`readlink -nf $VCAP_RUBY19`
+SQLITE_REALPATH=`readlink -nf $VCAP_SQLITE`
+GIT_REALPATH=`readlink -nf $VCAP_GIT`
+POSTGRES_REALPATH=`readlink -nf $VCAP_VPOSTGRES`
+WARDEN_SRV_REALPATH=`readlink -nf $VCAP_WARDEN_SERVICE`
+WARDEN_PKG=/var/vcap/packages/warden/warden
+
+POSTGRES_SVC=$PWD/ng/postgresql
+rm -rf POSTGRES_SVC/spec_reports
+
+echo &quot;creating the warden container for unit-test&quot;
+HANDLE=`$WARDEN_REPL_V2 -- create --bind_mounts[0].src_path &quot;$RUBY19_REALPATH&quot; --bind_mounts[0].dst_path &quot;$RUBY19_REALPATH&quot; --bind_mounts[0].mode RO \
+--bind_mounts[1].src_path &quot;$GIT_REALPATH&quot; --bind_mounts[1].dst_path &quot;$GIT_REALPATH&quot; --bind_mounts[1].mode RO \
+--bind_mounts[2].src_path &quot;$SQLITE_REALPATH&quot; --bind_mounts[2].dst_path $SQLITE_REALPATH --bind_mounts[2].mode RO \
+--bind_mounts[3].src_path &quot;$VCAP_WARDEN_SERVICE&quot; --bind_mounts[3].dst_path &quot;$WARDEN_PKG&quot; --bind_mounts[3].mode RO \
+--bind_mounts[4].src_path &quot;$WARDEN_SRV_REALPATH/root/linux/base/rootfs&quot; --bind_mounts[4].dst_path &quot;/var/vcap/data/warden/rootfs&quot; --bind_mounts[4].mode RO \
+--bind_mounts[5].src_path &quot;$WARDEN_INSTANCES&quot; --bind_mounts[5].dst_path &quot;$WARDEN_INSTANCES&quot; --bind_mounts[5].mode RW \
+--bind_mounts[6].src_path &quot;$POSTGRES_REALPATH&quot; --bind_mounts[6].dst_path &quot;$VCAP_POSTGRES&quot; --bind_mounts[6].mode RO \
+| cut -d &quot; &quot; -f 3`
+
+TEST_RUNNER=`mktemp`
+cat &lt;&lt;-EOT &gt; $TEST_RUNNER
+#!/bin/bash
+set -x
+set -o errexit
+
+export PATH=$RUBY19_REALPATH/bin:$GIT_REALPATH/bin:$VCAP_POSTGRES/bin:$PATH
+export LIBRARY_PATH=$SQLITE_REALPATH/lib:$VCAP_POSTGRES/lib:$LIBRARY_PATH
+export C_INCLUDE_PATH=$SQLITE_REALPATH/include:$VCAP_POSTGRES/include:$C_INCLUDE_PATH
+export LD_LIBRARY_PATH=$VCAP_POSTGRES/lib:$LD_LIBRARY_PATH
+export CI_ENV=&apos;jenkins&apos;
+
+# nats expects to write in /var/vcap/sys/run
+mkdir -p /var/vcap/sys/run
+chown vcap:vcap -R /var/vcap/sys/run
+
+# prepare the filesystem for postgresql
+mkdir -p /tmp/var/vcap/store
+chown vcap:vcap -R /tmp/var/vcap/store
+mkdir -p /tmp/var/vcap/sys
+chown vcap:vcap -R /tmp/var/vcap/sys
+
+# start the postgres process outside the warden container
+su - vcap -c &quot;/var/vcap/packages/postgres/jobs/postgres_ctl start&quot;
+
+# prepare the log dir for warden
+mkdir -p /var/vcap/sys/log/warden
+
+# echo the address of github into the /etc/hosts in case warden cannot find it
+sudo echo &quot;207.97.227.239 github.com&quot; &gt;&gt; /etc/hosts
+
+# dynamically generate the config for the warden server
+cat &gt; /tmp/warden_server.yml &lt;&lt;-EOF
+---
+server:
+ container_klass: Warden::Container::Linux
+ container_grace_time: 300
+ unix_domain_permissions: 0777
+ container_rootfs_path: /var/vcap/data/warden/rootfs
+ container_depot_path: /var/vcap/data/warden/depot/$HANDLE
+ container_limits_conf:
+ nofile: 8192
+ nproc: 512
+ as: 4194304
+ quota:
+ disk_quota_enabled: false
+
+logging:
+ level: debug2
+
+network:
+ pool_start_address: 70.254.0.0
+ pool_size: 256
+
+user:
+ pool_start_uid: 10000
+ pool_size: 256
+EOF
+
+# start the warden server
+cd $WARDEN_PKG
+nohup bundle exec rake warden:start[/tmp/warden_server.yml] &gt;&gt; /var/vcap/sys/log/warden/warden.stdout.log 2&gt;&gt;/var/vcap/sys/log/warden/warden.stderr.log &amp;
+sleep 5
+
+cd /tmp/postgresql_source/postgresql
+rm -rf .bundle
+rm -rf vendor/bundle
+sed -i &apos;s/use_warden: false/use_warden: true/g&apos; config/postgresql_node.yml
+bundle install --deployment
+bundle exec rake spec:ci
+EOT
+
+CREATE_LOOP=`mktemp`
+cat &lt;&lt;-EOT &gt; $CREATE_LOOP
+#!/bin/bash
+loop_device_count=128
+for i in \$(seq 0 \$(expr \$loop_device_count - 1)); do
+ file=/dev/loop\${i}
+ if [ ! -b \${file} ]; then
+ mknod -m0660 \${file} b 7 \${i}
+ chown root.disk \${file}
+ fi
+done
+EOT
+
+echo &quot;enable vcap could execute sudo without password within warden&quot;
+sudo ls $WARDEN_INSTANCES/$HANDLE/ssh/ssh_config
+set +e
+vcap_sudo_line=&quot;vcap ALL=(ALL) NOPASSWD:ALL&quot;
+vcap_chk_ret=`sudo ssh -T -F $WARDEN_INSTANCES/$HANDLE/ssh/ssh_config root@container cat /etc/sudoers | grep &quot;$vcap_sudo_line&quot;`
+if test -z &quot;$vcap_chk_ret&quot;
+then
+ sudo ssh -T -F $WARDEN_INSTANCES/$HANDLE/ssh/ssh_config root@container chmod 740 /etc/sudoers
+ sudo ssh -T -F $WARDEN_INSTANCES/$HANDLE/ssh/ssh_config root@container &quot;echo \&quot;Defaults:vcap !requiretty\&quot; &gt;&gt; /etc/sudoers&quot;
+ sudo ssh -T -F $WARDEN_INSTANCES/$HANDLE/ssh/ssh_config root@container &quot;echo \&quot;$vcap_sudo_line\&quot; &gt;&gt; /etc/sudoers&quot;
+ sudo ssh -T -F $WARDEN_INSTANCES/$HANDLE/ssh/ssh_config root@container chmod 440 /etc/sudoers
+fi
+set -e
+
+echo &quot;staring the unit test&quot;
+$WARDEN_REPL -e -x -c &quot;
+copy $HANDLE in $POSTGRES_SVC /tmp/postgresql_source
+copy $HANDLE in $TEST_RUNNER /tmp
+run $HANDLE chmod +x $TEST_RUNNER
+copy $HANDLE in $CREATE_LOOP /tmp
+run $HANDLE chmod +x $CREATE_LOOP
+run $HANDLE sudo /bin/bash $CREATE_LOOP
+run $HANDLE sudo /bin/bash $TEST_RUNNER
+copy $HANDLE out /tmp/postgresql_source/postgresql/spec_reports $POSTGRES_SVC vcap:vcap
+copy $HANDLE out /tmp/postgresql_source/postgresql/spec_coverage $POSTGRES_SVC vcap:vcap
+destroy $HANDLE
+&quot;
+
+rm -f $TEST_RUNNER</command>
+ </hudson.tasks.Shell>
+ </builders>
+ <publishers>
+ <hudson.tasks.ArtifactArchiver>
+ <artifacts>ng/postgresql/spec_reports/**</artifacts>
+ <latestOnly>false</latestOnly>
+ </hudson.tasks.ArtifactArchiver>
+ <hudson.tasks.junit.JUnitResultArchiver>
+ <testResults>ng/postgresql/spec_reports/*.xml</testResults>
+ <keepLongStdio>false</keepLongStdio>
+ <testDataPublishers/>
+ </hudson.tasks.junit.JUnitResultArchiver>
+ <hudson.plugins.rubyMetrics.rcov.RcovPublisher>
+ <reportDir>ng/postgresql/spec_coverage/rcov</reportDir>
+ <targets>
+ <hudson.plugins.rubyMetrics.rcov.model.MetricTarget>
+ <metric>TOTAL_COVERAGE</metric>
+ <healthy>80</healthy>
+ <unhealthy>0</unhealthy>
+ <unstable>0</unstable>
+ </hudson.plugins.rubyMetrics.rcov.model.MetricTarget>
+ <hudson.plugins.rubyMetrics.rcov.model.MetricTarget>
+ <metric>CODE_COVERAGE</metric>
+ <healthy>80</healthy>
+ <unhealthy>0</unhealthy>
+ <unstable>0</unstable>
+ </hudson.plugins.rubyMetrics.rcov.model.MetricTarget>
+ </targets>
+ </hudson.plugins.rubyMetrics.rcov.RcovPublisher>
+ </publishers>
+ <buildWrappers/>
+</project>
View
130 src/jenkins_jobs/SERVICES_Rabbit_Warden/config.xml.erb
@@ -3,12 +3,12 @@
<actions/>
<description></description>
<displayName>Rabbit Warden Unit Test</displayName>
-  <logRotator>
-    <daysToKeep>30</daysToKeep>
-    <numToKeep>-1</numToKeep>
-    <artifactDaysToKeep>-1</artifactDaysToKeep>
-    <artifactNumToKeep>-1</artifactNumToKeep>
-  </logRotator>
+ <logRotator>
+ <daysToKeep>30</daysToKeep>
+ <numToKeep>-1</numToKeep>
+ <artifactDaysToKeep>-1</artifactDaysToKeep>
+ <artifactNumToKeep>-1</artifactNumToKeep>
+ </logRotator>
<keepDependencies>false</keepDependencies>
<properties>
<hudson.plugins.throttleconcurrents.ThrottleJobProperty>
@@ -23,13 +23,13 @@
<userRemoteConfigs>
<hudson.plugins.git.UserRemoteConfig>
<name></name>
- <refspec>$GERRIT_REFSPEC</refspec>
+ <refspec></refspec>
<url>ssh://<%= ENV['CF_CI_USER'] %>@<%= ENV['CF_GERRIT_ADDRESS'] %>:<%= ENV['CF_GERRIT_PORT'] %>/vcap-services.git</url>
</hudson.plugins.git.UserRemoteConfig>
</userRemoteConfigs>
<branches>
<hudson.plugins.git.BranchSpec>
- <name>$GERRIT_BRANCH</name>
+ <name>master</name>
</hudson.plugins.git.BranchSpec>
</branches>
<disableSubmodules>false</disableSubmodules>
@@ -40,9 +40,7 @@
<wipeOutWorkspace>false</wipeOutWorkspace>
<pruneBranches>false</pruneBranches>
<remotePoll>false</remotePoll>
- <buildChooser class="com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerBuildChooser">
- <separator>#</separator>
- </buildChooser>
+ <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
<gitTool>Default</gitTool>
<submoduleCfg class="list"/>
<relativeTargetDir></relativeTargetDir>
@@ -68,18 +66,23 @@
RUBY19_REALPATH=`readlink -nf $VCAP_RUBY19`
SQLITE_REALPATH=`readlink -nf $VCAP_SQLITE`
GIT_REALPATH=`readlink -nf $VCAP_GIT`
+GO_REALPATH=`readlink -nf $VCAP_GOLANG`
WARDEN_SRV_REALPATH=`readlink -nf $VCAP_WARDEN_SERVICE`
WARDEN_PKG=/var/vcap/packages/warden/warden
-RABBIT_SVC=$PWD/rabbit
+RABBIT_SVC=$PWD/ng/rabbit
+TOOLS=$PWD/tools
+rm -rf RABBIT_SVC/spec_reports
-#
-# HACK - Base expects to be able to write to /var/vcap/sys/run/LOCK
-#
-SCRATCHPAD=$RABBIT_SVC/xxx_scratchpad
-rm -rf $SCRATCHPAD
-mkdir -p $SCRATCHPAD/log/warden
-mkdir -p $SCRATCHPAD/run/warden
+# create the warden container for unit-test
+HANDLE=`$WARDEN_REPL_V2 -- create --bind_mounts[0].src_path &quot;$RUBY19_REALPATH&quot; --bind_mounts[0].dst_path &quot;$RUBY19_REALPATH&quot; --bind_mounts[0].mode RO \
+--bind_mounts[1].src_path &quot;$GIT_REALPATH&quot; --bind_mounts[1].dst_path &quot;$GIT_REALPATH&quot; --bind_mounts[1].mode RO \
+--bind_mounts[2].src_path &quot;$SQLITE_REALPATH&quot; --bind_mounts[2].dst_path &quot;$SQLITE_REALPATH&quot; --bind_mounts[2].mode RO \
+--bind_mounts[3].src_path &quot;$VCAP_WARDEN_SERVICE&quot; --bind_mounts[3].dst_path &quot;$WARDEN_PKG&quot; --bind_mounts[3].mode RO \
+--bind_mounts[4].src_path &quot;$GO_REALPATH&quot; --bind_mounts[4].dst_path &quot;$GO_REALPATH&quot; --bind_mounts[4].mode RO \
+--bind_mounts[5].src_path &quot;$WARDEN_SRV_REALPATH/root/linux/base/rootfs&quot; --bind_mounts[5].dst_path &quot;/var/vcap/data/warden/rootfs&quot; --bind_mounts[5].mode RO \
+--bind_mounts[6].src_path &quot;$WARDEN_INSTANCES&quot; --bind_mounts[6].dst_path &quot;$WARDEN_INSTANCES&quot; --bind_mounts[6].mode RW \
+| cut -d &quot; &quot; -f 3`
TEST_RUNNER=`mktemp`
cat &lt;&lt;-EOT &gt; $TEST_RUNNER
@@ -87,57 +90,86 @@ cat &lt;&lt;-EOT &gt; $TEST_RUNNER
set -x
set -o errexit
-export PATH=$RUBY19_REALPATH/bin:$GIT_REALPATH/bin:$PATH
+export PATH=$RUBY19_REALPATH/bin:$GIT_REALPATH/bin:$GO_REALPATH/bin:$PATH
export LIBRARY_PATH=$SQLITE_REALPATH/lib:$LIBRARY_PATH
export C_INCLUDE_PATH=$SQLITE_REALPATH/include:$C_INCLUDE_PATH
export CI_ENV=&apos;jenkins&apos;
-mkdir -p /var/vcap/sys/log/warden
-
-ls /var/vcap
-
-cd $WARDEN_PKG
-bundle --local install --deployment --without=devlopment test
-cat config/rabbit.yml
+# nats expects to write in /var/vcap/sys/run
+sudo mkdir -p /var/vcap/sys/run
+sudo chown -R vcap:vcap /var/vcap/sys/run
-cd /tmp/rabbit_source/rabbit
-rm -rf .bundle
-rm -rf vendor/bundle
-cat lib/rabbit_service/rabbit_node.rb
-sed -i -e &quot;s/rabbitmq_start_timeout: 5/rabbitmq_start_timeout: 30/g&quot; config/rabbit_node.yml
-cat config/rabbit_node.yml
-bundle install --path vendor/bundle
+# prepare the log dir for warden
+mkdir -p /var/vcap/sys/log/warden
+# echo the address of github into the /etc/hosts in case warden cannot find it
+sudo echo &quot;207.97.227.239 github.com&quot; &gt;&gt; /etc/hosts
+
+# prepare the go proxy for rabbit
+export GOROOT=$GO_REALPATH
+cd /tmp/tools/bandwidth_proxy
+export GOPATH=/tmp/tools/bandwidth_proxy
+go install bandwidth_proxy
+cp -r /tmp/tools/bandwidth_proxy /var/vcap/packages
+
+# dynamically generate the config for the warden server
+cat &gt; /tmp/warden_server.yml &lt;&lt;-EOF
+---
+server:
+ container_klass: Warden::Container::Linux
+ container_grace_time: 300
+ unix_domain_permissions: 0777
+ container_rootfs_path: /var/vcap/data/warden/rootfs
+ container_depot_path: /var/vcap/data/warden/depot/$HANDLE
+ container_limits_conf:
+ nofile: 8192
+ nproc: 512
+ as: 4194304
+ quota:
+ disk_quota_enabled: false
+
+logging:
+ level: debug2
+
+network:
+ pool_start_address: 30.254.0.0
+ pool_size: 256
+
+user:
+ pool_start_uid: 10000
+ pool_size: 256
+EOF
+
+# start the warden server
cd $WARDEN_PKG
-nohup bundle exec rake warden:start[config/rabbit.yml] &gt;&gt; /var/vcap/sys/log/warden/warden.stdout.log 2&gt;&gt;/var/vcap/sys/log/warden/warden.stderr.log &amp;
+nohup bundle exec rake warden:start[/tmp/warden_server.yml] &gt;&gt; /var/vcap/sys/log/warden/warden.stdout.log 2&gt;&gt;/var/vcap/sys/log/warden/warden.stderr.log &amp;
sleep 5
+# do the unit test
cd /tmp/rabbit_source/rabbit
-bundle exec nats-server --daemonize --pid /tmp/nats.pid
+bundle install --deployment
bundle exec rake spec:ci
EOT
-echo &quot;creating the warden container for unit-test&quot;
-HANDLE=`$WARDEN_REPL -e -c &quot;create bind_mount:$RUBY19_REALPATH,$RUBY19_REALPATH,ro bind_mount:$GIT_REALPATH,$GIT_REALPATH,ro bind_mount:$SQLITE_REALPATH,$SQLITE_REALPATH,ro bind_mount:$SCRATCHPAD,/var/vcap/sys/run,rw bind_mount:$VCAP_WARDEN_SERVICE,/var/vcap/packages/warden/warden,rw disk_size_mb:4096 &quot;`
-
echo &quot;enable vcap could execute sudo without password within warden&quot;
-sudo ls $WARDEN_PKG/root/linux/instances/$HANDLE/ssh/ssh_config
+sudo ls $WARDEN_INSTANCES/$HANDLE/ssh/ssh_config
set +e
vcap_sudo_line=&quot;vcap ALL=(ALL) NOPASSWD:ALL&quot;
-vcap_chk_ret=`sudo ssh -T -F $WARDEN_PKG/root/linux/instances/$HANDLE/ssh/ssh_config root@container cat /etc/sudoers | grep &quot;$vcap_sudo_line&quot;`
+vcap_chk_ret=`sudo ssh -T -F $WARDEN_INSTANCES/$HANDLE/ssh/ssh_config root@container cat /etc/sudoers | grep &quot;$vcap_sudo_line&quot;`
if test -z &quot;$vcap_chk_ret&quot;
then
- sudo ssh -T -F $WARDEN_PKG/root/linux/instances/$HANDLE/ssh/ssh_config root@container chmod 740 /etc/sudoers
- sudo ssh -T -F $WARDEN_PKG/root/linux/instances/$HANDLE/ssh/ssh_config root@container &quot;echo \&quot;Defaults:vcap !requiretty\&quot; &gt;&gt; /etc/sudoers&quot;
- sudo ssh -T -F $WARDEN_PKG/root/linux/instances/$HANDLE/ssh/ssh_config root@container &quot;echo \&quot;$vcap_sudo_line\&quot; &gt;&gt; /etc/sudoers&quot;
- sudo ssh -T -F $WARDEN_PKG/root/linux/instances/$HANDLE/ssh/ssh_config root@container chmod 440 /etc/sudoers
+ sudo ssh -T -F $WARDEN_INSTANCES/$HANDLE/ssh/ssh_config root@container chmod 740 /etc/sudoers
+ sudo ssh -T -F $WARDEN_INSTANCES/$HANDLE/ssh/ssh_config root@container &quot;echo \&quot;Defaults:vcap !requiretty\&quot; &gt;&gt; /etc/sudoers&quot;
+ sudo ssh -T -F $WARDEN_INSTANCES/$HANDLE/ssh/ssh_config root@container &quot;echo \&quot;$vcap_sudo_line\&quot; &gt;&gt; /etc/sudoers&quot;
+ sudo ssh -T -F $WARDEN_INSTANCES/$HANDLE/ssh/ssh_config root@container chmod 440 /etc/sudoers
fi
set -e
echo &quot;staring the unit test&quot;
$WARDEN_REPL -e -x -c &quot;
copy $HANDLE in $RABBIT_SVC /tmp/rabbit_source
+copy $HANDLE in $TOOLS /tmp
copy $HANDLE in $TEST_RUNNER /tmp
run $HANDLE chmod +x $TEST_RUNNER
run $HANDLE sudo /bin/bash $TEST_RUNNER
@@ -151,16 +183,16 @@ rm -f $TEST_RUNNER</command>
</builders>
<publishers>
<hudson.tasks.ArtifactArchiver>
- <artifacts>rabbit/spec_reports/**</artifacts>
+ <artifacts>ng/rabbit/spec_reports/**</artifacts>
<latestOnly>false</latestOnly>
</hudson.tasks.ArtifactArchiver>
<hudson.tasks.junit.JUnitResultArchiver>
- <testResults>rabbit/spec_reports/*.xml</testResults>
+ <testResults>ng/rabbit/spec_reports/*.xml</testResults>
<keepLongStdio>false</keepLongStdio>
<testDataPublishers/>
</hudson.tasks.junit.JUnitResultArchiver>
<hudson.plugins.rubyMetrics.rcov.RcovPublisher>
- <reportDir>rabbit/spec_coverage/rcov</reportDir>
+ <reportDir>ng/rabbit/spec_coverage/rcov</reportDir>
<targets>
<hudson.plugins.rubyMetrics.rcov.model.MetricTarget>
<metric>TOTAL_COVERAGE</metric>
@@ -178,4 +210,4 @@ rm -f $TEST_RUNNER</command>
</hudson.plugins.rubyMetrics.rcov.RcovPublisher>
</publishers>
<buildWrappers/>
-</project>
+</project>
View
113 src/jenkins_jobs/SERVICES_Redis_Warden/config.xml.erb
@@ -3,12 +3,12 @@
<actions/>
<description></description>
<displayName>Redis Warden Unit Test</displayName>
-  <logRotator>
-    <daysToKeep>30</daysToKeep>
-    <numToKeep>-1</numToKeep>
-    <artifactDaysToKeep>-1</artifactDaysToKeep>
-    <artifactNumToKeep>-1</artifactNumToKeep>
-  </logRotator>
+ <logRotator>
+ <daysToKeep>30</daysToKeep>
+ <numToKeep>-1</numToKeep>
+ <artifactDaysToKeep>-1</artifactDaysToKeep>
+ <artifactNumToKeep>-1</artifactNumToKeep>
+ </logRotator>
<keepDependencies>false</keepDependencies>
<properties>
<hudson.plugins.throttleconcurrents.ThrottleJobProperty>
@@ -23,13 +23,13 @@
<userRemoteConfigs>
<hudson.plugins.git.UserRemoteConfig>
<name></name>
- <refspec>$GERRIT_REFSPEC</refspec>
+ <refspec></refspec>
<url>ssh://<%= ENV['CF_CI_USER'] %>@<%= ENV['CF_GERRIT_ADDRESS'] %>:<%= ENV['CF_GERRIT_PORT'] %>/vcap-services.git</url>
</hudson.plugins.git.UserRemoteConfig>
</userRemoteConfigs>
<branches>
<hudson.plugins.git.BranchSpec>
- <name>$GERRIT_BRANCH</name>
+ <name>master</name>
</hudson.plugins.git.BranchSpec>
</branches>
<disableSubmodules>false</disableSubmodules>
@@ -40,9 +40,7 @@
<wipeOutWorkspace>false</wipeOutWorkspace>
<pruneBranches>false</pruneBranches>
<remotePoll>false</remotePoll>
- <buildChooser class="com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerBuildChooser">
- <separator>#</separator>
- </buildChooser>
+ <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
<gitTool>Default</gitTool>
<submoduleCfg class="list"/>
<relativeTargetDir></relativeTargetDir>
@@ -71,15 +69,17 @@ GIT_REALPATH=`readlink -nf $VCAP_GIT`
WARDEN_SRV_REALPATH=`readlink -nf $VCAP_WARDEN_SERVICE`
WARDEN_PKG=/var/vcap/packages/warden/warden
-REDIS_SVC=$PWD/redis
+REDIS_SVC=$PWD/ng/redis
+rm -rf REDIS_SVC/spec_reports
-#
-# HACK - Base expects to be able to write to /var/vcap/sys/run/LOCK
-#
-SCRATCHPAD=$REDIS_SVC/xxx_scratchpad
-rm -rf $SCRATCHPAD
-mkdir -p $SCRATCHPAD/log/warden
-mkdir -p $SCRATCHPAD/run/warden
+echo &quot;creating the warden container for unit-test&quot;
+HANDLE=`$WARDEN_REPL_V2 -- create --bind_mounts[0].src_path &quot;$RUBY19_REALPATH&quot; --bind_mounts[0].dst_path &quot;$RUBY19_REALPATH&quot; --bind_mounts[0].mode RO \
+--bind_mounts[1].src_path &quot;$GIT_REALPATH&quot; --bind_mounts[1].dst_path &quot;$GIT_REALPATH&quot; --bind_mounts[1].mode RO \
+--bind_mounts[2].src_path &quot;$SQLITE_REALPATH&quot; --bind_mounts[2].dst_path $SQLITE_REALPATH --bind_mounts[2].mode RO \
+--bind_mounts[3].src_path &quot;$VCAP_WARDEN_SERVICE&quot; --bind_mounts[3].dst_path &quot;$WARDEN_PKG&quot; --bind_mounts[3].mode RO \
+--bind_mounts[4].src_path &quot;$WARDEN_SRV_REALPATH/root/linux/base/rootfs&quot; --bind_mounts[4].dst_path &quot;/var/vcap/data/warden/rootfs&quot; --bind_mounts[4].mode RO \
+--bind_mounts[5].src_path &quot;$WARDEN_INSTANCES&quot; --bind_mounts[5].dst_path &quot;$WARDEN_INSTANCES&quot; --bind_mounts[5].mode RW \
+| cut -d &quot; &quot; -f 3`
TEST_RUNNER=`mktemp`
cat &lt;&lt;-EOT &gt; $TEST_RUNNER
@@ -92,43 +92,68 @@ export LIBRARY_PATH=$SQLITE_REALPATH/lib:$LIBRARY_PATH
export C_INCLUDE_PATH=$SQLITE_REALPATH/include:$C_INCLUDE_PATH
export CI_ENV=&apos;jenkins&apos;
+# nats expects to write in /var/vcap/sys/run
+sudo mkdir -p /var/vcap/sys/run
+sudo chown -R vcap:vcap /var/vcap/sys/run
+
+# prepare the log dir for warden
mkdir -p /var/vcap/sys/log/warden
+# echo the address of github into the /etc/hosts in case warden cannot find it
+sudo echo &quot;207.97.227.239 github.com&quot; &gt;&gt; /etc/hosts
+
+# dynamically generate the config for the warden server
+cat &gt; /tmp/warden_server.yml &lt;&lt;-EOF
+---
+server:
+ container_klass: Warden::Container::Linux
+ container_grace_time: 300
+ unix_domain_permissions: 0777
+ container_rootfs_path: /var/vcap/data/warden/rootfs
+ container_depot_path: /var/vcap/data/warden/depot/$HANDLE
+ container_limits_conf:
+ nofile: 8192
+ nproc: 512
+ as: 4194304
+ quota:
+ disk_quota_enabled: false
+
+logging:
+ level: debug2
+
+network:
+ pool_start_address: 40.254.0.0
+ pool_size: 256
+
+user:
+ pool_start_uid: 10000
+ pool_size: 256
+EOF
+
+# start the warden server
cd $WARDEN_PKG
-bundle --local install --deployment --without=devlopment test
-cat config/redis.yml
+nohup bundle exec rake warden:start[/tmp/warden_server.yml] &gt;&gt; /var/vcap/sys/log/warden/warden.stdout.log 2&gt;&gt;/var/vcap/sys/log/warden/warden.stderr.log &amp;
+sleep 5
cd /tmp/redis_source/redis
rm -rf .bundle
rm -rf vendor/bundle
-bundle install --path vendor/bundle
-
-cd $WARDEN_PKG
-nohup bundle exec rake warden:start[config/redis.yml] &gt;&gt; /var/vcap/sys/log/warden/warden.stdout.log 2&gt;&gt;/var/vcap/sys/log/warden/warden.stderr.log &amp;
-sleep 5
-cd /tmp/redis_source/redis
-bundle exec nats-server --daemonize --pid /tmp/nats.pid
+bundle install --deployment
bundle exec rake spec:ci
-
-cat /var/vcap/sys/log/warden/warden.log
-
EOT
-echo &quot;creating the warden container for unit-test&quot;
-HANDLE=`$WARDEN_REPL -e -c &quot;create bind_mount:$RUBY19_REALPATH,$RUBY19_REALPATH,ro bind_mount:$GIT_REALPATH,$GIT_REALPATH,ro bind_mount:$SQLITE_REALPATH,$SQLITE_REALPATH,ro bind_mount:$SCRATCHPAD,/var/vcap/sys/run,rw bind_mount:$VCAP_WARDEN_SERVICE,/var/vcap/packages/warden/warden,rw disk_size_mb:4096 &quot;`
-
echo &quot;enable vcap could execute sudo without password within warden&quot;
-sudo ls $WARDEN_PKG/root/linux/instances/$HANDLE/ssh/ssh_config
+sudo ls $WARDEN_INSTANCES/$HANDLE/ssh/ssh_config
set +e
vcap_sudo_line=&quot;vcap ALL=(ALL) NOPASSWD:ALL&quot;
-vcap_chk_ret=`sudo ssh -T -F $WARDEN_PKG/root/linux/instances/$HANDLE/ssh/ssh_config root@container cat /etc/sudoers | grep &quot;$vcap_sudo_line&quot;`
+vcap_chk_ret=`sudo ssh -T -F $WARDEN_INSTANCES/$HANDLE/ssh/ssh_config root@container cat /etc/sudoers | grep &quot;$vcap_sudo_line&quot;`
if test -z &quot;$vcap_chk_ret&quot;
then
- sudo ssh -T -F $WARDEN_PKG/root/linux/instances/$HANDLE/ssh/ssh_config root@container chmod 740 /etc/sudoers
- sudo ssh -T -F $WARDEN_PKG/root/linux/instances/$HANDLE/ssh/ssh_config root@container &quot;echo \&quot;Defaults:vcap !requiretty\&quot; &gt;&gt; /etc/sudoers&quot;
- sudo ssh -T -F $WARDEN_PKG/root/linux/instances/$HANDLE/ssh/ssh_config root@container &quot;echo \&quot;$vcap_sudo_line\&quot; &gt;&gt; /etc/sudoers&quot;
- sudo ssh -T -F $WARDEN_PKG/root/linux/instances/$HANDLE/ssh/ssh_config root@container chmod 440 /etc/sudoers
+ sudo ssh -T -F $WARDEN_INSTANCES/$HANDLE/ssh/ssh_config root@container chmod 740 /etc/sudoers
+ sudo ssh -T -F $WARDEN_INSTANCES/$HANDLE/ssh/ssh_config root@container &quot;echo \&quot;Defaults:vcap !requiretty\&quot; &gt;&gt; /etc/sudoers&quot;
+ sudo ssh -T -F $WARDEN_INSTANCES/$HANDLE/ssh/ssh_config root@container &quot;echo \&quot;$vcap_sudo_line\&quot; &gt;&gt; /etc/sudoers&quot;
+ sudo ssh -T -F $WARDEN_INSTANCES/$HANDLE/ssh/ssh_config root@container chmod 440 /etc/sudoers
fi
set -e
@@ -148,16 +173,16 @@ rm -f $TEST_RUNNER</command>
</builders>
<publishers>
<hudson.tasks.ArtifactArchiver>
- <artifacts>redis/spec_reports/**</artifacts>
+ <artifacts>ng/redis/spec_reports/**</artifacts>
<latestOnly>false</latestOnly>
</hudson.tasks.ArtifactArchiver>
<hudson.tasks.junit.JUnitResultArchiver>
- <testResults>redis/spec_reports/*.xml</testResults>
+ <testResults>ng/redis/spec_reports/*.xml</testResults>
<keepLongStdio>false</keepLongStdio>
<testDataPublishers/>
</hudson.tasks.junit.JUnitResultArchiver>
<hudson.plugins.rubyMetrics.rcov.RcovPublisher>
- <reportDir>redis/spec_coverage/rcov</reportDir>
+ <reportDir>ng/redis/spec_coverage/rcov</reportDir>
<targets>
<hudson.plugins.rubyMetrics.rcov.model.MetricTarget>
<metric>TOTAL_COVERAGE</metric>
@@ -175,4 +200,4 @@ rm -f $TEST_RUNNER</command>
</hudson.plugins.rubyMetrics.rcov.RcovPublisher>
</publishers>
<buildWrappers/>
-</project>
+</project>
View
120 src/jenkins_jobs/SERVICES_Vblob_Warden/config.xml.erb
@@ -3,12 +3,12 @@
<actions/>
<description></description>
<displayName>vBlob Warden Unit Test</displayName>
-  <logRotator>
-    <daysToKeep>30</daysToKeep>
-    <numToKeep>-1</numToKeep>
-    <artifactDaysToKeep>-1</artifactDaysToKeep>
-    <artifactNumToKeep>-1</artifactNumToKeep>
-  </logRotator>
+ <logRotator>
+ <daysToKeep>30</daysToKeep>
+ <numToKeep>-1</numToKeep>
+ <artifactDaysToKeep>-1</artifactDaysToKeep>
+ <artifactNumToKeep>-1</artifactNumToKeep>
+ </logRotator>
<keepDependencies>false</keepDependencies>
<properties>
<hudson.plugins.throttleconcurrents.ThrottleJobProperty>
@@ -23,13 +23,13 @@
<userRemoteConfigs>
<hudson.plugins.git.UserRemoteConfig>
<name></name>
- <refspec>$GERRIT_REFSPEC</refspec>
+ <refspec></refspec>
<url>ssh://<%= ENV['CF_CI_USER'] %>@<%= ENV['CF_GERRIT_ADDRESS'] %>:<%= ENV['CF_GERRIT_PORT'] %>/vcap-services.git</url>
</hudson.plugins.git.UserRemoteConfig>
</userRemoteConfigs>
<branches>
<hudson.plugins.git.BranchSpec>
- <name>$GERRIT_BRANCH</name>
+ <name>master</name>
</hudson.plugins.git.BranchSpec>
</branches>
<disableSubmodules>false</disableSubmodules>
@@ -40,9 +40,7 @@
<wipeOutWorkspace>false</wipeOutWorkspace>
<pruneBranches>false</pruneBranches>
<remotePoll>false</remotePoll>
- <buildChooser class="com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerBuildChooser">
- <separator>#</separator>
- </buildChooser>
+ <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
<gitTool>Default</gitTool>
<submoduleCfg class="list"/>
<relativeTargetDir></relativeTargetDir>
@@ -71,15 +69,17 @@ GIT_REALPATH=`readlink -nf $VCAP_GIT`
WARDEN_SRV_REALPATH=`readlink -nf $VCAP_WARDEN_SERVICE`
WARDEN_PKG=/var/vcap/packages/warden/warden
-VBLOB_SVC=$PWD/vblob
+VBLOB_SVC=$PWD/ng/vblob
+rm -rf VBLOB_SVC/spec_reports
-#
-# HACK - Base expects to be able to write to /var/vcap/sys/run/LOCK
-#
-SCRATCHPAD=$VBLOB_SVC/xxx_scratchpad
-rm -rf $SCRATCHPAD
-mkdir -p $SCRATCHPAD/log/warden
-mkdir -p $SCRATCHPAD/run/warden
+echo &quot;creating the warden container for unit-test&quot;
+HANDLE=`$WARDEN_REPL_V2 -- create --bind_mounts[0].src_path &quot;$RUBY19_REALPATH&quot; --bind_mounts[0].dst_path &quot;$RUBY19_REALPATH&quot; --bind_mounts[0].mode RO \
+--bind_mounts[1].src_path &quot;$GIT_REALPATH&quot; --bind_mounts[1].dst_path &quot;$GIT_REALPATH&quot; --bind_mounts[1].mode RO \
+--bind_mounts[2].src_path &quot;$SQLITE_REALPATH&quot; --bind_mounts[2].dst_path $SQLITE_REALPATH --bind_mounts[2].mode RO \
+--bind_mounts[3].src_path &quot;$VCAP_WARDEN_SERVICE&quot; --bind_mounts[3].dst_path &quot;$WARDEN_PKG&quot; --bind_mounts[3].mode RO \
+--bind_mounts[4].src_path &quot;$WARDEN_SRV_REALPATH/root/linux/base/rootfs&quot; --bind_mounts[4].dst_path &quot;/var/vcap/data/warden/rootfs&quot; --bind_mounts[4].mode RO \
+--bind_mounts[5].src_path &quot;$WARDEN_INSTANCES&quot; --bind_mounts[5].dst_path &quot;$WARDEN_INSTANCES&quot; --bind_mounts[5].mode RW \
+| cut -d &quot; &quot; -f 3`
TEST_RUNNER=`mktemp`
cat &lt;&lt;-EOT &gt; $TEST_RUNNER
@@ -92,50 +92,68 @@ export LIBRARY_PATH=$SQLITE_REALPATH/lib:$LIBRARY_PATH
export C_INCLUDE_PATH=$SQLITE_REALPATH/include:$C_INCLUDE_PATH
export CI_ENV=&apos;jenkins&apos;
+# nats expects to write in /var/vcap/sys/run
+sudo mkdir -p /var/vcap/sys/run
+sudo chown -R vcap:vcap /var/vcap/sys/run
+
+# prepare the log dir for warden
mkdir -p /var/vcap/sys/log/warden
+# echo the address of github into the /etc/hosts in case warden cannot find it
+sudo echo &quot;207.97.227.239 github.com&quot; &gt;&gt; /etc/hosts
+
+# dynamically generate the config for the warden server
+cat &gt; /tmp/warden_server.yml &lt;&lt;-EOF
+---
+server:
+ container_klass: Warden::Container::Linux
+ container_grace_time: 300
+ unix_domain_permissions: 0777
+ container_rootfs_path: /var/vcap/data/warden/rootfs
+ container_depot_path: /var/vcap/data/warden/depot/$HANDLE
+ container_limits_conf:
+ nofile: 8192
+ nproc: 512
+ as: 4194304
+ quota:
+ disk_quota_enabled: false
+
+logging:
+ level: debug2
+
+network:
+ pool_start_address: 20.254.0.0
+ pool_size: 256
+
+user:
+ pool_start_uid: 10000
+ pool_size: 256
+EOF
+
+# start the warden server
cd $WARDEN_PKG
-bundle --local install --deployment --without=devlopment test
-cat config/vblob.yml
+nohup bundle exec rake warden:start[/tmp/warden_server.yml] &gt;&gt; /var/vcap/sys/log/warden/warden.stdout.log 2&gt;&gt;/var/vcap/sys/log/warden/warden.stderr.log &amp;
+sleep 5
cd /tmp/vblob_source/vblob
rm -rf .bundle
rm -rf vendor/bundle
-sed -i &quot;s/local_db: sqlite3:\/var\/vcap\/services\/vblob\/vblob_node.db/local_db: sqlite3:vblob_node.db/g&quot; config/vblob_node.yml
-#sed -i &quot;s/nodejs_path: node/nodejs_path: \/var\/vcap\/packages\/dea_node04\/bin\/node/g&quot; config/vblob_node.yml
-sed -i &quot;s/vblobd_log_dir: \/var\/vcap\/sys\/service-log\/vblob/vblobd_log_dir: \/tmp\/var\/vcap\/sys\/service-log\/vblob/g&quot; config/vblob_node.yml
-sed -i &quot;s/base_dir: \/var\/vcap\/services\/vblob\/instances/base_dir: \/tmp\/var\/vcap\/services\/vblob\/instances/g&quot; config/vblob_node.yml
-sed -i &quot;s/image_dir: \/var\/vcap\/services\/vblob\/vblob_image/image_dir: \/tmp\/vblob\/vblob_image/g&quot; config/vblob_node.yml
-sed -i &quot;s/\/var\/vcap\/sys\/run\/vblob_node.pid/\/tmp\/var\/vcap\/sys\/run\/vblob_node.pid/g&quot; config/vblob_node.yml
-sed -i &quot;s/\/var\/vcap\/sys\/run\/vblob_node.pid/\/tmp\/var\/vcap\/sys\/run\/vblob_node.pid/g&quot; config/vblob_gateway.yml
-bundle install --path vendor/bundle
-
-cd $WARDEN_PKG
-nohup bundle exec rake warden:start[config/vblob.yml] &gt;&gt; /var/vcap/sys/log/warden/warden.stdout.log 2&gt;&gt;/var/vcap/sys/log/warden/warden.stderr.log &amp;
-sleep 5
-cd /tmp/vblob_source/vblob
-bundle exec nats-server --daemonize --pid /tmp/nats.pid
+bundle install --deployment
bundle exec rake spec:ci
-
-cat /var/vcap/sys/log/warden/warden.log
-
EOT
-echo &quot;creating the warden container for unit-test&quot;
-HANDLE=`$WARDEN_REPL -e -c &quot;create bind_mount:$RUBY19_REALPATH,$RUBY19_REALPATH,ro bind_mount:$GIT_REALPATH,$GIT_REALPATH,ro bind_mount:$SQLITE_REALPATH,$SQLITE_REALPATH,ro bind_mount:$SCRATCHPAD,/var/vcap/sys/run,rw bind_mount:$VCAP_WARDEN_SERVICE,/var/vcap/packages/warden/warden,rw disk_size_mb:4096 &quot;`
-
echo &quot;enable vcap could execute sudo without password within warden&quot;
-sudo ls $WARDEN_PKG/root/linux/instances/$HANDLE/ssh/ssh_config
+sudo ls $WARDEN_INSTANCES/$HANDLE/ssh/ssh_config
set +e
vcap_sudo_line=&quot;vcap ALL=(ALL) NOPASSWD:ALL&quot;
-vcap_chk_ret=`sudo ssh -T -F $WARDEN_PKG/root/linux/instances/$HANDLE/ssh/ssh_config root@container cat /etc/sudoers | grep &quot;$vcap_sudo_line&quot;`
+vcap_chk_ret=`sudo ssh -T -F $WARDEN_INSTANCES/$HANDLE/ssh/ssh_config root@container cat /etc/sudoers | grep &quot;$vcap_sudo_line&quot;`
if test -z &quot;$vcap_chk_ret&quot;
then
- sudo ssh -T -F $WARDEN_PKG/root/linux/instances/$HANDLE/ssh/ssh_config root@container chmod 740 /etc/sudoers
- sudo ssh -T -F $WARDEN_PKG/root/linux/instances/$HANDLE/ssh/ssh_config root@container &quot;echo \&quot;Defaults:vcap !requiretty\&quot; &gt;&gt; /etc/sudoers&quot;
- sudo ssh -T -F $WARDEN_PKG/root/linux/instances/$HANDLE/ssh/ssh_config root@container &quot;echo \&quot;$vcap_sudo_line\&quot; &gt;&gt; /etc/sudoers&quot;
- sudo ssh -T -F $WARDEN_PKG/root/linux/instances/$HANDLE/ssh/ssh_config root@container chmod 440 /etc/sudoers
+ sudo ssh -T -F $WARDEN_INSTANCES/$HANDLE/ssh/ssh_config root@container chmod 740 /etc/sudoers
+ sudo ssh -T -F $WARDEN_INSTANCES/$HANDLE/ssh/ssh_config root@container &quot;echo \&quot;Defaults:vcap !requiretty\&quot; &gt;&gt; /etc/sudoers&quot;
+ sudo ssh -T -F $WARDEN_INSTANCES/$HANDLE/ssh/ssh_config root@container &quot;echo \&quot;$vcap_sudo_line\&quot; &gt;&gt; /etc/sudoers&quot;
+ sudo ssh -T -F $WARDEN_INSTANCES/$HANDLE/ssh/ssh_config root@container chmod 440 /etc/sudoers
fi
set -e
@@ -155,16 +173,16 @@ rm -f $TEST_RUNNER</command>
</builders>
<publishers>
<hudson.tasks.ArtifactArchiver>
- <artifacts>vblob/spec_reports/**</artifacts>
+ <artifacts>ng/vblob/spec_reports/**</artifacts>
<latestOnly>false</latestOnly>
</hudson.tasks.ArtifactArchiver>
<hudson.tasks.junit.JUnitResultArchiver>
- <testResults>vblob/spec_reports/*.xml</testResults>
+ <testResults>ng/vblob/spec_reports/*.xml</testResults>
<keepLongStdio>false</keepLongStdio>
<testDataPublishers/>
</hudson.tasks.junit.JUnitResultArchiver>
<hudson.plugins.rubyMetrics.rcov.RcovPublisher>
- <reportDir>vblob/spec_coverage/rcov</reportDir>
+ <reportDir>ng/vblob/spec_coverage/rcov</reportDir>
<targets>
<hudson.plugins.rubyMetrics.rcov.model.MetricTarget>
<metric>TOTAL_COVERAGE</metric>
@@ -182,4 +200,4 @@ rm -f $TEST_RUNNER</command>
</hudson.plugins.rubyMetrics.rcov.RcovPublisher>
</publishers>
<buildWrappers/>
-</project>
+</project>
Please sign in to comment.
Something went wrong with that request. Please try again.