summaryrefslogtreecommitdiff
path: root/test/integration/targets/apt
diff options
context:
space:
mode:
authorMartin Krizek <martin.krizek@gmail.com>2018-03-15 17:32:25 +0100
committerGitHub <noreply@github.com>2018-03-15 17:32:25 +0100
commita6d31b6fb13af1f3697c4517b088592bb850787a (patch)
treecb6de8084eb0f2f9ae183adf6e13a619f1b1465c /test/integration/targets/apt
parent6292fe1116dd31da075fb9dc99ca3f36db1c9880 (diff)
downloadansible-a6d31b6fb13af1f3697c4517b088592bb850787a.tar.gz
apt: better error msg when update_cache fails (#37410)
Diffstat (limited to 'test/integration/targets/apt')
-rw-r--r--test/integration/targets/apt/tasks/apt.yml23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/integration/targets/apt/tasks/apt.yml b/test/integration/targets/apt/tasks/apt.yml
index 531eac8761..22ecd608b9 100644
--- a/test/integration/targets/apt/tasks/apt.yml
+++ b/test/integration/targets/apt/tasks/apt.yml
@@ -162,6 +162,29 @@
- "not apt_result.changed"
- "apt_result.failed"
+# https://github.com/ansible/ansible/issues/23155
+- name: create a repo file
+ copy:
+ dest: /etc/apt/sources.list.d/non-existing.list
+ content: deb http://ppa.launchpad.net/non-existing trusty main
+
+- name: test for sane error message
+ apt:
+ update_cache: yes
+ register: apt_result
+ ignore_errors: yes
+
+- name: verify sane error message
+ assert:
+ that:
+ - "'E:Failed to fetch' in apt_result['msg']"
+ - "'403' in apt_result['msg']"
+
+- name: Clean up
+ file:
+ name: /etc/apt/sources.list.d/non-existing.list
+ state: absent
+
- name: autoclean during install
apt: pkg=hello state=present autoclean=yes