Remove unused remote module tests

These tests verify the behavior of the restricted Ansible modules which
are being removed, and are therefore no longer necessary.

Change-Id: I5a171739b9e993af605aee981cb59f520bc1c6ba
This commit is contained in:
James E. Blair
2022-04-11 17:53:14 -07:00
parent aec4019ca7
commit a28ca2f240
132 changed files with 1 additions and 1074 deletions

View File

@@ -1,9 +0,0 @@
- name: Create a destination directory for copied files
tempfile:
state: directory
register: destdir
- name: Common copy
copy:
src: common-file
dest: "{{destdir.path}}/common-file"

View File

@@ -1,4 +0,0 @@
- hosts: all
roles:
- role: assemble-test
src_file: dir-symlink

View File

@@ -1,4 +0,0 @@
- hosts: all
roles:
- role: assemble-test
src_file: symlink

View File

@@ -1,4 +0,0 @@
- hosts: all
roles:
- role: assemble-test
src_file: /opt/assemble

View File

@@ -1,3 +0,0 @@
- hosts: all
roles:
- assemble-test-delegate

View File

@@ -1,4 +0,0 @@
- hosts: all
roles:
- role: assemble-test
src_file: dir

View File

@@ -1,11 +0,0 @@
- hosts: localhost
roles:
- assemble-test-localhost
- hosts: 127.0.0.1
roles:
- assemble-test-localhost
- hosts: "::1"
roles:
- assemble-test-localhost

View File

@@ -1,4 +0,0 @@
- hosts: all
roles:
- role: copy-test
src_file: dir-symlink

View File

@@ -1,4 +0,0 @@
- hosts: all
roles:
- role: copy-test
src_file: symlink

View File

@@ -1,4 +0,0 @@
- hosts: all
roles:
- role: copy-test
src_file: /opt/file

View File

@@ -1,3 +0,0 @@
- hosts: all
roles:
- copy-test-delegate

View File

@@ -1,5 +0,0 @@
- hosts: all
roles:
- common-copy
- role: copy-test
src_file: file

View File

@@ -1,11 +0,0 @@
- hosts: localhost
roles:
- copy-test-localhost
- hosts: 127.0.0.1
roles:
- copy-test-localhost
- hosts: "::1"
roles:
- copy-test-localhost

View File

@@ -1,4 +0,0 @@
- hosts: all
roles:
- role: includevarsdir-test
src_file: symlink

View File

@@ -1,4 +0,0 @@
- hosts: all
roles:
- role: includevarsdir-test
src_file: dir-double-symlink

View File

@@ -1,4 +0,0 @@
- hosts: all
roles:
- role: includevarsdir-test
src_file: dir-symlink

View File

@@ -1,4 +0,0 @@
- hosts: all
roles:
- role: includevarsdir-test
src_file: /opt/vars

View File

@@ -1,4 +0,0 @@
- hosts: all
roles:
- role: includevars-test
src_file: symlink.yaml

View File

@@ -1,4 +0,0 @@
- hosts: all
roles:
- role: includevars-test
src_file: /opt/vars.yaml

View File

@@ -1,4 +0,0 @@
- hosts: all
roles:
- role: includevarsdir-test
src_file: dir

View File

@@ -1,4 +0,0 @@
- hosts: all
roles:
- role: includevars-test
src_file: vars.yaml

View File

@@ -1,8 +0,0 @@
- hosts: all
tasks:
- name: Add fake known_hosts entry
delegate_to: localhost
known_hosts:
name: fake
path: /root/.ssh/known_hosts
key: fake ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOOaqWfpmnMiCYaLUq0ugyQ6OUIvtPzkOqLTG03HXxU9

View File

@@ -1,7 +0,0 @@
- hosts: all
tasks:
- name: Add fake known_hosts entry
delegate_to: localhost
known_hosts:
name: fake
key: fake ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOOaqWfpmnMiCYaLUq0ugyQ6OUIvtPzkOqLTG03HXxU9

View File

@@ -1,6 +0,0 @@
- hosts: all
tasks:
- name: Add fake known_hosts entry
known_hosts:
name: fake
key: fake ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOOaqWfpmnMiCYaLUq0ugyQ6OUIvtPzkOqLTG03HXxU9

View File

@@ -1,6 +0,0 @@
- hosts: localhost
tasks:
- name: Add fake known_hosts entry
known_hosts:
name: fake
key: fake ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOOaqWfpmnMiCYaLUq0ugyQ6OUIvtPzkOqLTG03HXxU9

View File

@@ -1,4 +0,0 @@
- hosts: all
roles:
- role: patch-test
src_file: symlink

View File

@@ -1,4 +0,0 @@
- hosts: all
roles:
- role: patch-test
src_file: /opt/patch

View File

@@ -1,3 +0,0 @@
- hosts: all
roles:
- patch-test-delegate

View File

@@ -1,4 +0,0 @@
- hosts: all
roles:
- role: patch-test
src_file: patch

View File

@@ -1,11 +0,0 @@
- hosts: localhost
roles:
- patch-test-localhost
- hosts: 127.0.0.1
roles:
- patch-test-localhost
- hosts: "::1"
roles:
- patch-test-localhost

View File

@@ -1,3 +0,0 @@
- hosts: all
roles:
- raw-test-delegate

View File

@@ -1,4 +0,0 @@
- hosts: all
tasks:
- name: Some raw command
raw: echo 123

View File

@@ -1,11 +0,0 @@
- hosts: localhost
roles:
- raw-test-localhost
- hosts: 127.0.0.1
roles:
- raw-test-localhost
- hosts: "::1"
roles:
- raw-test-localhost

View File

@@ -1,14 +0,0 @@
- name: Assemble
assemble:
src: dir
dest: /opt/assemble-dest
remote_src: no
delegate_to: "{{ item }}"
ignore_errors: true
register: result
- assert:
that:
- "result.failed == true"
- "'Accessing files from outside the working dir' in result.msg"
msg: Assemble must fail due to accessing files outside the working dir

View File

@@ -1,22 +0,0 @@
- include: assemble-delegate.yaml
with_items:
- ::1
- 127.0.0.1
- localhost
- name: Define target dir
set_fact:
targetdir: "{{ zuul.executor.work_root }}/assemble-target"
- name: Create target dir
file:
state: directory
path: "{{ targetdir }}"
delegate_to: localhost
- name: Assemble to safe local path
assemble:
src: dir
dest: "{{ targetdir }}/assemble-dest.conf"
remote_src: no
delegate_to: localhost

View File

@@ -1,13 +0,0 @@
- name: Assemble
assemble:
src: dir
dest: /opt/assemble-dest
remote_src: no
ignore_errors: true
register: result
- assert:
that:
- "result.failed == true"
- "'Accessing files from outside the working dir' in result.msg"
msg: Assemble must fail due to accessing files outside the working dir

View File

@@ -1,10 +0,0 @@
- name: Create a destination directory for copied files
tempfile:
state: directory
register: destdir
- name: Assemble
assemble:
src: "{{src_file}}"
dest: "{{destdir.path}}/copy"
remote_src: no

View File

@@ -1,13 +0,0 @@
- name: Copy
copy:
src: file
dest: /opt/copy-dest
delegate_to: "{{ item }}"
register: result
ignore_errors: true
- assert:
that:
- "result.failed == true"
- "'Accessing files from outside the working dir' in result.msg"
msg: Copy must fail due to accessing files outside the working dir

View File

@@ -1,27 +0,0 @@
- include: copy-delegate.yaml
with_items:
- ::1
- 127.0.0.1
- localhost
- name: Define target dir
set_fact:
targetdir: "{{ zuul.executor.work_root }}/copy-target"
- name: Create target dir
file:
state: directory
path: "{{ targetdir }}"
delegate_to: localhost
- name: Copy file into safe path
copy:
src: file
dest: "{{ targetdir }}/dest-file"
delegate_to: localhost
- name: Copy file into safe directory
copy:
src: file
dest: "{{ targetdir }}/dest-dir/"
delegate_to: localhost

View File

@@ -1,12 +0,0 @@
- name: Copy
copy:
src: file
dest: /opt/copy-dest
register: result
ignore_errors: true
- assert:
that:
- "result.failed == true"
- "'Accessing files from outside the working dir' in result.msg"
msg: Copy must fail due to accessing files outside the working dir

View File

@@ -1,9 +0,0 @@
- name: Create a destination directory for copied files
tempfile:
state: directory
register: destdir
- name: Copy
copy:
src: "{{src_file}}"
dest: "{{destdir.path}}/copy"

View File

@@ -1,2 +0,0 @@
- name: Include vars
include_vars: "{{src_file}}"

View File

@@ -1,3 +0,0 @@
- name: Include vars
include_vars:
dir: "{{src_file}}"

View File

@@ -1,7 +0,0 @@
diff --git a/readme.txt b/readme.txt
index 24308cb..b07f0ed 100644
--- a/readme.txt
+++ b/readme.txt
@@ -1 +1 @@
-This is a readme
+This is a README

View File

@@ -1,41 +0,0 @@
- include: patch-delegate.yaml
with_items:
- ::1
- 127.0.0.1
- localhost
- name: Define target dir
set_fact:
targetdir: "{{ zuul.executor.work_root }}/patch-target"
- name: Create target dir
file:
state: directory
path: "{{ targetdir }}"
delegate_to: localhost
- name: Copy readme
copy:
src: readme.txt
dest: "{{ targetdir }}/readme.txt"
delegate_to: localhost
- name: Patch in safe path using basedir
patch:
src: "patch"
basedir: "{{ targetdir }}"
strip: 1
delegate_to: localhost
- name: Copy readme again
copy:
src: readme.txt
dest: "{{ targetdir }}/readme.txt"
delegate_to: localhost
- name: Patch in safe path using dest
patch:
src: "patch"
dest: "{{ targetdir }}/readme.txt"
strip: 1
delegate_to: localhost

View File

@@ -1,29 +0,0 @@
- name: Patch with basedir
patch:
src: patch
basedir: "/opt/patch-dest"
strip: 1
delegate_to: "{{ item }}"
register: result
ignore_errors: true
- assert:
that:
- "result.failed == true"
- "'Accessing files from outside the working dir' in result.msg"
msg: Patch must fail due to accessing files outside the working dir
- name: Patch with dest
patch:
src: patch
dest: "/opt/patch-dest/readme"
strip: 1
delegate_to: "{{ item }}"
register: result
ignore_errors: true
- assert:
that:
- "result.failed == true"
- "'Accessing files from outside the working dir' in result.msg"
msg: Patch must fail due to accessing files outside the working dir

View File

@@ -1,7 +0,0 @@
diff --git a/readme.txt b/readme.txt
index 24308cb..b07f0ed 100644
--- a/readme.txt
+++ b/readme.txt
@@ -1 +1 @@
-This is a readme
+This is a README

View File

@@ -1,27 +0,0 @@
- name: Patch with basedir
patch:
src: patch
basedir: "/opt/patch-dest"
strip: 1
register: result
ignore_errors: true
- assert:
that:
- "result.failed == true"
- "'Accessing files from outside the working dir' in result.msg"
msg: Patch must fail due to accessing files outside the working dir
- name: Patch with dest
patch:
src: patch
dest: "/opt/patch-dest/readme"
strip: 1
register: result
ignore_errors: true
- assert:
that:
- "result.failed == true"
- "'Accessing files from outside the working dir' in result.msg"
msg: Patch must fail due to accessing files outside the working dir

View File

@@ -1,7 +0,0 @@
diff --git a/readme.txt b/readme.txt
index 24308cb..b07f0ed 100644
--- a/readme.txt
+++ b/readme.txt
@@ -1 +1 @@
-This is a readme
+This is a README

View File

@@ -1,15 +0,0 @@
- name: Create a destination directory for copied files
tempfile:
state: directory
register: destdir
- name: Copy readme
copy:
src: readme.txt
dest: "{{destdir.path}}/readme.txt"
- name: Patch
patch:
src: "{{src_file}}"
basedir: "{{destdir.path}}"
strip: 1

View File

@@ -1,5 +0,0 @@
- include: script-delegate.yaml
with_items:
- ::1
- 127.0.0.1
- localhost

View File

@@ -1,11 +0,0 @@
- name: Raw
raw: echo 123
delegate_to: "{{ item }}"
register: result
ignore_errors: true
- assert:
that:
- "result.failed == true"
- "'Executing local code is prohibited' in result.msg"
msg: Raw must fail due to local code execution restriction

View File

@@ -1,10 +0,0 @@
- name: Raw
raw: echo 123
register: result
ignore_errors: true
- assert:
that:
- "result.failed == true"
- "'Executing local code is prohibited' in result.msg"
msg: Script must fail due to local code execution restriction

View File

@@ -1,5 +0,0 @@
- include: script-delegate.yaml
with_items:
- ::1
- 127.0.0.1
- localhost

View File

@@ -1,11 +0,0 @@
- name: Script
script: script.sh
delegate_to: "{{ item }}"
register: result
ignore_errors: true
- assert:
that:
- "result.failed == true"
- "'Executing local code is prohibited' in result.msg"
msg: Script must fail due to local code execution restriction

View File

@@ -1,10 +0,0 @@
- name: Script
script: script.sh
register: result
ignore_errors: true
- assert:
that:
- "result.failed == true"
- "'Executing local code is prohibited' in result.msg"
msg: Script must fail due to local code execution restriction

View File

@@ -1,2 +0,0 @@
- name: Script
script: "{{src_file}}"

View File

@@ -1,21 +0,0 @@
- include: template-delegate.yaml
with_items:
- ::1
- 127.0.0.1
- localhost
- name: Define target dir
set_fact:
targetdir: "{{ zuul.executor.work_root }}/template-target"
- name: Create target dir
file:
state: directory
path: "{{ targetdir }}"
delegate_to: localhost
- name: Template into safe path
template:
src: template
dest: "{{ targetdir }}/dest-file"
delegate_to: localhost

View File

@@ -1,13 +0,0 @@
- name: Template
copy:
src: template
dest: /opt/copy-dest
delegate_to: "{{ item }}"
register: result
ignore_errors: true
- assert:
that:
- "result.failed == true"
- "'Accessing files from outside the working dir' in result.msg"
msg: Template must fail due to accessing files outside the working dir

View File

@@ -1,12 +0,0 @@
- name: Template
copy:
src: template
dest: /opt/copy-dest
register: result
ignore_errors: true
- assert:
that:
- "result.failed == true"
- "'Accessing files from outside the working dir' in result.msg"
msg: Template must fail due to accessing files outside the working dir

View File

@@ -1,9 +0,0 @@
- name: Create a destination directory for copied files
tempfile:
state: directory
register: destdir
- name: Copy
template:
src: "{{src_file}}"
dest: "{{destdir.path}}/template"

View File

@@ -1,21 +0,0 @@
- include: unarchive-delegate.yaml
with_items:
- ::1
- 127.0.0.1
- localhost
- name: Define target dir
set_fact:
targetdir: "{{ zuul.executor.work_root }}/unarchive-target"
- name: Create target dir
file:
state: directory
path: "{{ targetdir }}"
delegate_to: localhost
- name: Unarchive
copy:
src: archive.tar
dest: "{{ targetdir }}"
delegate_to: localhost

View File

@@ -1,13 +0,0 @@
- name: Unarchive
copy:
src: archive.tar
dest: /opt/unarchive-dest
delegate_to: "{{ item }}"
register: result
ignore_errors: true
- assert:
that:
- "result.failed == true"
- "'Accessing files from outside the working dir' in result.msg"
msg: Unarchive must fail due to accessing files outside the working dir

Some files were not shown because too many files have changed in this diff Show More