Browse Source

Merge pull request #1001 from appropriate/override-cmd-test

Add override-cmd test
Tianon Gravi 10 years ago
parent
commit
5e820d83d6
2 changed files with 16 additions and 1 deletions
  1. 6 1
      test/config.sh
  2. 10 0
      test/tests/override-cmd/run.sh

+ 6 - 1
test/config.sh

@@ -5,6 +5,7 @@ globalTests=(
 	utc
 	cve-2014--shellshock
 	no-hard-coded-passwords
+	override-cmd
 )
 
 declare -A testAlias=(
@@ -122,11 +123,15 @@ declare -A globalExcludeTests=(
 	[hello-world_utc]=1
 	[swarm_utc]=1
 	[nats_utc]=1
-	
+
 	[hello-world_no-hard-coded-passwords]=1
 	[swarm_no-hard-coded-passwords]=1
 	[nats_no-hard-coded-passwords]=1
 
+	[hello-world_override-cmd]=1
+	[swarm_no-override-cmd]=1
+	[nats_no-override-cmd]=1
+
 	# no "native" dependencies
 	[ruby:slim_ruby-bundler]=1
 	[ruby:slim_ruby-gems]=1

+ 10 - 0
test/tests/override-cmd/run.sh

@@ -0,0 +1,10 @@
+#!/bin/bash
+
+set -eo pipefail
+
+image="$1"
+
+# Test that we can override the CMD with echo
+hello="world-$RANDOM-$RANDOM"
+output="$(docker run --rm "$image" echo "Hello $hello")"
+[ "$output" = "Hello $hello" ]