Browse files

test_stable: updates

- Handle an "empty" tree where we have no stable-queue patches for the version
- do a quieter 'git clone' and checkout the branch all at once
  • Loading branch information...
gregkh committed Oct 3, 2012
1 parent e1cc495 commit 9d4f7c151a58ce82e6567a3d68c98596c657bbbe
Showing with 33 additions and 26 deletions.
  1. +33 −26 scripts/test_stable
@@ -27,13 +27,13 @@ REMOTE_WORK="/home/gregkh/tmp/"
-#REMOTE_SERVER="" # not mine
-#REMOTE_SERVER="" # mine - really big
-REMOTE_SERVER="" # mine - really big
-SSH_OPTIONS="-i /home/gregkh/.ssh/stable_build.pem"
+##REMOTE_SERVER="" # not mine
+##REMOTE_SERVER="" # mine - really big
+#REMOTE_SERVER="" # mine - really big
+#SSH_OPTIONS="-i /home/gregkh/.ssh/stable_build.pem"
@@ -55,20 +55,26 @@ if [ "${KERNEL_VERSION}" == "" ] ; then
# create the local temporary directory to do the work in.
-SCRIPT_HOME=`mktemp -d ${LOCAL_WORK}/stable_test_XXXXX`
+SCRIPT_HOME=`mktemp -d ${LOCAL_WORK}/stable_test_XXXXX` || exit 1
echo "Using ${SCRIPT_HOME} for our local files"
# create the remote directory
+REMOTE_DIR=`ssh ${SSH_OPTIONS} ${REMOTE_USER}@${REMOTE_SERVER} mktemp -d ${REMOTE_WORK}/stable_test_XXXXX` || exit 1
echo "Using ${REMOTE_DIR} for the remote directory"
# figure out how many processors are on the remote machine
NUM_PROCESSORS=`ssh ${SSH_OPTIONS} ${REMOTE_USER}@${REMOTE_SERVER} grep -c "processor" /proc/cpuinfo`
echo "Remote machine has ${NUM_PROCESSORS} processors."
# tar up stable patch queue for just this kernel version
-tar -c . | gzip > ${SCRIPT_HOME}/stable_queue.tar.gz
+if [ -d ${QUEUE_DIR}/queue-${KERNEL_VERSION} ] ; then
+ cd ${QUEUE_DIR}/queue-${KERNEL_VERSION}/ || exit 1
+ tar -c . | gzip > ${SCRIPT_HOME}/stable_queue.tar.gz
+ echo "No stable queue at this point in time, are you sure you picked the right kernel version?"
# create the script to run remotely
@@ -81,26 +87,26 @@ STABLE_GIT="${REMOTE_STABLE_GIT}"
-# create the linux clone
-git clone -s ${REMOTE_STABLE_GIT} linux
-cd linux
-# checkout the branch we need
-git checkout -t -b linux-${KERNEL_VERSION}.y origin/linux-${KERNEL_VERSION}.y
+echo "Starting to test kernel version ${KERNEL_VERSION}"
+echo ""
-# remove the .git directory as we don't need that space hanging around anymore
-#rm -rf .git/
+# create the linux clone with the correct branch
+git clone -q -s --branch linux-${KERNEL_VERSION}.y ${REMOTE_STABLE_GIT} linux
+cd linux
-# create a patches/ directory for the stable patches to apply
-mkdir patches
-cd patches
-tar -zxvf ${REMOTE_DIR}/\${PATCHES}
-cd ..
+# create a patches/ directory for the stable patches to apply if we have them
+if [ -f ${REMOTE_DIR}/\${PATCHES} ] ; then
+ mkdir patches
+ cd patches
+ tar -zxvf ${REMOTE_DIR}/\${PATCHES}
+ cd ..
-# Apply the patch queue
-QUILT_PATCHES=patches QUILT_SERIES=patches/series quilt push -aq --quiltrc
+ # Apply the patch queue
+ QUILT_PATCHES=patches QUILT_SERIES=patches/series quilt push -aq --quiltrc
# get initial time
TIME=\$(date +%s)
@@ -164,6 +170,7 @@ rm -rf ${SCRIPT_HOME}
#ssh ${REMOTE_USER}@${REMOTE_SERVER} "${REMOTE_DIR}/ > ${REMOTE_DIR}/output_log"
ssh ${SSH_OPTIONS} -n -f ${REMOTE_USER}@${REMOTE_SERVER} "sh -c \"cd ${REMOTE_DIR}; nohup ./ > ${REMOTE_DIR}/output_log 2>&1 &\" "
+echo "Job successfully submitted."

0 comments on commit 9d4f7c1

Please sign in to comment.