From 638de22b350c7323c88d2af481bdf1b23bdb16b3 Mon Sep 17 00:00:00 2001
From: Toshio Kuratomi <a.badger@gmail.com>
Date: Tue, 3 Oct 2017 07:17:12 -0700
Subject: [PATCH] Update tests for required_if changes

These tests are doing string matches on the error condition.  Update
them to match the new strings.  This is probably okay to push out to old
releases even though it's technically backwards incompatible because
production playbooks won't be checking that a parameter was missing.
Param missing is something detected and fixed while writing the playbook.
---
 test/integration/targets/aws_lambda/tasks/main.yml            | 2 +-
 test/integration/targets/cs_account/tasks/main.yml            | 2 +-
 test/integration/targets/cs_firewall/tasks/main.yml           | 4 ++--
 test/integration/targets/cs_host/tasks/main.yml               | 2 +-
 test/integration/targets/cs_user/tasks/main.yml               | 2 +-
 test/integration/targets/cs_vpc/tasks/main.yml                | 2 +-
 test/integration/targets/docker_secret/tasks/test_secrets.yml | 2 +-
 test/integration/targets/ec2_ami/tasks/main.yml               | 2 +-
 test/integration/targets/ec2_group/tasks/main.yml             | 4 ++--
 9 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/test/integration/targets/aws_lambda/tasks/main.yml b/test/integration/targets/aws_lambda/tasks/main.yml
index 2fab6e9c383..26cea372686 100644
--- a/test/integration/targets/aws_lambda/tasks/main.yml
+++ b/test/integration/targets/aws_lambda/tasks/main.yml
@@ -42,7 +42,7 @@
       assert:
         that:
            - 'result.failed'
-           - 'result.msg.startswith("state is present but the following are missing: handler")'
+           - 'result.msg.startswith("state is present but all of the following are missing: handler")'
 
     # ============================================================
     - name: test with all module required variables but no region
diff --git a/test/integration/targets/cs_account/tasks/main.yml b/test/integration/targets/cs_account/tasks/main.yml
index b28c61397d5..ee4cb80320e 100644
--- a/test/integration/targets/cs_account/tasks/main.yml
+++ b/test/integration/targets/cs_account/tasks/main.yml
@@ -26,7 +26,7 @@
   assert:
     that:
     - acc|failed
-    - 'acc.msg == "missing required arguments: email,username,password,first_name,last_name"'
+    - 'acc.msg == "missing required arguments: email, username, password, first_name, last_name"'
 
 - name: test create user account in check mode
   cs_account:
diff --git a/test/integration/targets/cs_firewall/tasks/main.yml b/test/integration/targets/cs_firewall/tasks/main.yml
index 7da22a0d6e5..1638587011f 100644
--- a/test/integration/targets/cs_firewall/tasks/main.yml
+++ b/test/integration/targets/cs_firewall/tasks/main.yml
@@ -73,7 +73,7 @@
   assert:
     that:
     - fw|failed
-    - "fw.msg == 'one of the following is required: ip_address,network'"
+    - "fw.msg == 'one of the following is required: ip_address, network'"
 
 - name: test fail if missing params
   cs_firewall:
@@ -97,7 +97,7 @@
   assert:
     that:
     - fw|failed
-    - "fw.msg == 'one of the following is required: ip_address,network'"
+    - "fw.msg == 'one of the following is required: ip_address, network'"
 
 - name: test present firewall rule ingress 80 in check mode
   cs_firewall:
diff --git a/test/integration/targets/cs_host/tasks/main.yml b/test/integration/targets/cs_host/tasks/main.yml
index 2e301f60198..0c29e4b618a 100644
--- a/test/integration/targets/cs_host/tasks/main.yml
+++ b/test/integration/targets/cs_host/tasks/main.yml
@@ -18,7 +18,7 @@
   assert:
     that:
       - host|failed
-      - 'host.msg == "missing required arguments: password,username,hypervisor,pod"'
+      - 'host.msg == "missing required arguments: password, username, hypervisor, pod"'
 
 - name: test create a host in check mode
   cs_host:
diff --git a/test/integration/targets/cs_user/tasks/main.yml b/test/integration/targets/cs_user/tasks/main.yml
index 16cae4519df..ef9a1a7f1c4 100644
--- a/test/integration/targets/cs_user/tasks/main.yml
+++ b/test/integration/targets/cs_user/tasks/main.yml
@@ -26,7 +26,7 @@
   assert:
     that:
     - user|failed
-    - 'user.msg == "missing required arguments: account,email,password,first_name,last_name"'
+    - 'user.msg == "missing required arguments: account, email, password, first_name, last_name"'
 
 - name: test create user in check mode
   cs_user:
diff --git a/test/integration/targets/cs_vpc/tasks/main.yml b/test/integration/targets/cs_vpc/tasks/main.yml
index 560c93b6615..cfc65a3e2eb 100644
--- a/test/integration/targets/cs_vpc/tasks/main.yml
+++ b/test/integration/targets/cs_vpc/tasks/main.yml
@@ -31,7 +31,7 @@
   assert:
     that:
     - vpc|failed
-    - 'vpc.msg == "state is present but the following are missing: cidr"'
+    - 'vpc.msg == "state is present but all of the following are missing: cidr"'
 
 - name: test create vpc in check mode
   cs_vpc:
diff --git a/test/integration/targets/docker_secret/tasks/test_secrets.yml b/test/integration/targets/docker_secret/tasks/test_secrets.yml
index c49dafca108..603eeae87e5 100644
--- a/test/integration/targets/docker_secret/tasks/test_secrets.yml
+++ b/test/integration/targets/docker_secret/tasks/test_secrets.yml
@@ -38,7 +38,7 @@
   assert:
     that:
        - 'output.failed'
-       - 'output.msg == "state is present but the following are missing: data"'
+       - 'output.msg == "state is present but all of the following are missing: data"'
 
 - name: Create secret
   docker_secret:
diff --git a/test/integration/targets/ec2_ami/tasks/main.yml b/test/integration/targets/ec2_ami/tasks/main.yml
index 68b8e2b3bd5..b29750a7176 100644
--- a/test/integration/targets/ec2_ami/tasks/main.yml
+++ b/test/integration/targets/ec2_ami/tasks/main.yml
@@ -158,7 +158,7 @@
       assert:
         that:
           - "result.failed"
-          - "result.msg == 'state is absent but the following are missing: image_id'"
+          - "result.msg == 'state is absent but all of the following are missing: image_id'"
 
     # ============================================================
 
diff --git a/test/integration/targets/ec2_group/tasks/main.yml b/test/integration/targets/ec2_group/tasks/main.yml
index 1a94cba5a3d..6ec69601a4b 100644
--- a/test/integration/targets/ec2_group/tasks/main.yml
+++ b/test/integration/targets/ec2_group/tasks/main.yml
@@ -20,7 +20,7 @@
       assert:
         that:
            - 'result.failed'
-           - 'result.msg == "one of the following is required: name,group_id"'
+           - 'result.msg == "one of the following is required: name, group_id"'
 
     # ============================================================
     - name: test failure with only name
@@ -46,7 +46,7 @@
       assert:
         that:
            - 'result.failed'
-           - 'result.msg == "one of the following is required: name,group_id"'
+           - 'result.msg == "one of the following is required: name, group_id"'
 
     # ============================================================
     - name: test failure with empty description (AWS API requires non-empty string desc)