Create CI resources directory

Add a new directory "ci", to easily add new tests with setup/run phases
that don't require direct setup in .travis.yml. This also avoids
polution of scripts/.

Signed-off-by: Fabio Utzig <utzig@apache.org>
diff --git a/.travis.yml b/.travis.yml
index 87ba9f2..3e2e839 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -9,28 +9,28 @@
     # Runs each value defined in $SINGLE_FEATURES by itself in the order
     # the were defined.
     - os: linux
-      env: SINGLE_FEATURES="sig-ecdsa enc-kw bootstrap"
+      env: SINGLE_FEATURES="sig-ecdsa enc-kw bootstrap" TEST=sim
     - os: linux
-      env: SINGLE_FEATURES="none sig-rsa overwrite-only validate-slot0"
+      env: SINGLE_FEATURES="none sig-rsa overwrite-only validate-slot0" TEST=sim
     - os: linux
-      env: SINGLE_FEATURES="enc-rsa"
+      env: SINGLE_FEATURES="enc-rsa" TEST=sim
 
     # Values defined in $MULTI_FEATURES consist of any number of features
     # to be enabled at the same time. The list of multi-values should be
     # separated by ',' and each list of values is run sequentially in the
     # defined order.
     - os: linux
-      env: MULTI_FEATURES="sig-rsa overwrite-only,sig-ecdsa overwrite-only"
+      env: MULTI_FEATURES="sig-rsa overwrite-only,sig-ecdsa overwrite-only" TEST=sim
     - os: linux
-      env: MULTI_FEATURES="sig-rsa validate-slot0,sig-ecdsa validate-slot0"
+      env: MULTI_FEATURES="sig-rsa validate-slot0,sig-ecdsa validate-slot0" TEST=sim
     - os: linux
-      env: MULTI_FEATURES="enc-kw overwrite-only,enc-rsa overwrite-only"
+      env: MULTI_FEATURES="enc-kw overwrite-only,enc-rsa overwrite-only" TEST=sim
     - os: linux
-      env: MULTI_FEATURES="sig-rsa enc-rsa validate-slot0"
+      env: MULTI_FEATURES="sig-rsa enc-rsa validate-slot0" TEST=sim
     - os: linux
-      env: MULTI_FEATURES="sig-rsa enc-kw validate-slot0 bootstrap"
+      env: MULTI_FEATURES="sig-rsa enc-kw validate-slot0 bootstrap" TEST=sim
     - os: linux
-      env: MULTI_FEATURES="sig-ecdsa enc-kw validate-slot0"
+      env: MULTI_FEATURES="sig-ecdsa enc-kw validate-slot0" TEST=sim
 
     # FIXME: this test actually fails and must be fixed
     #- os: linux
@@ -39,19 +39,17 @@
 before_install:
   - |
     if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
-      ./scripts/check-signed-off-by.sh
+      ./ci/check-signed-off-by.sh
       if [ $? -ne 0 ]; then
         exit 1
       fi
     fi
 
 install:
-  - pushd sim
-  - cargo fetch
-  - popd
+  - ./ci/${TEST}_install.sh
 
 script:
-  - ./scripts/run_tests.sh
+  - ./ci/${TEST}_run.sh
 
 notifications:
   slack:
diff --git a/scripts/check-signed-off-by.sh b/ci/check-signed-off-by.sh
similarity index 100%
rename from scripts/check-signed-off-by.sh
rename to ci/check-signed-off-by.sh
diff --git a/ci/sim_install.sh b/ci/sim_install.sh
new file mode 100755
index 0000000..b9a4cae
--- /dev/null
+++ b/ci/sim_install.sh
@@ -0,0 +1,17 @@
+#!/bin/bash -x
+
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+pushd sim && cargo fetch
+[[ $? -ne 0 ]] && exit 1
+popd
diff --git a/scripts/run_tests.sh b/ci/sim_run.sh
similarity index 98%
rename from scripts/run_tests.sh
rename to ci/sim_run.sh
index 2f63166..0492cff 100755
--- a/scripts/run_tests.sh
+++ b/ci/sim_run.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash -x
 
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.