From 4e4da023c4ebea57432d10dea4cded3e1de3aa9b Mon Sep 17 00:00:00 2001
From: Clark Boylan <clark.boylan@gmail.com>
Date: Wed, 7 May 2014 20:00:18 -0700
Subject: [PATCH] Fix zero tests ran unittest check.

The unittests attempt to check that more than 0 tests run; however, in
some cases 0 tests will be run and testr last won't list the number of
tests as a number. This causes the sed filter to fail to match resulting
in a rancount of "". If we get a rancount of "" or "0" fail the test.

Change-Id: I1f7ca358c73c071e60ba4b651cf75db18b8fd487
---
 modules/jenkins/files/slave_scripts/run-unittests.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/jenkins/files/slave_scripts/run-unittests.sh b/modules/jenkins/files/slave_scripts/run-unittests.sh
index 0c0d3ec34f..36287d4520 100755
--- a/modules/jenkins/files/slave_scripts/run-unittests.sh
+++ b/modules/jenkins/files/slave_scripts/run-unittests.sh
@@ -62,7 +62,7 @@ if [ -d ".testrepository" ] ; then
     fi
 
     rancount=$(.tox/$venv/bin/testr last | sed -ne 's/Ran \([0-9]\+\).*tests in.*/\1/p')
-    if [ "$rancount" -eq "0" ] ; then
+    if [ -z "$rancount" ] || [ "$rancount" -eq "0" ] ; then
         echo
         echo "Zero tests were run. At least one test should have been run."
         echo "Failing this test as a result"