From 4342f983d105f14d28dba2cd9c0d8c365fe762e0 Mon Sep 17 00:00:00 2001
From: Andreas Jaeger <aj@suse.com>
Date: Mon, 26 Feb 2018 20:07:23 +0100
Subject: [PATCH] Add simple run-test-command job

Add a simple run-test-command that can be used to run a simple
command or shell-script.

Change-Id: I00bade475b5b224768acde3ef232ca0704d3600e
Needed-By: https://review.openstack.org/548080
Needed-By: https://review.openstack.org/545712
---
 playbooks/run-test-command/run.yaml |  7 +++++++
 zuul.yaml                           | 11 +++++++++++
 2 files changed, 18 insertions(+)
 create mode 100644 playbooks/run-test-command/run.yaml

diff --git a/playbooks/run-test-command/run.yaml b/playbooks/run-test-command/run.yaml
new file mode 100644
index 000000000..aa87128c0
--- /dev/null
+++ b/playbooks/run-test-command/run.yaml
@@ -0,0 +1,7 @@
+- hosts: all
+
+  tasks:
+    - name: Run test_command
+      command: '{{ test_command }}'
+      args:
+        chdir: '{{ zuul.project.src_dir }}'
diff --git a/zuul.yaml b/zuul.yaml
index f1d2922e4..edc895e49 100644
--- a/zuul.yaml
+++ b/zuul.yaml
@@ -457,3 +457,14 @@
     success-url: html/
     vars:
       npm_command: docs
+
+- job:
+    name: run-test-command
+    parent: unittests
+    description: |
+      Run simple command as test.
+
+      To use this, set the ``test_command`` variable.
+    run: playbooks/run-test-command/run.yaml
+    vars:
+      test_command: "exit 1"