From 269c66fbdb83429436c3a3717d7b683cc43c15ae Mon Sep 17 00:00:00 2001 From: Baptiste Mille-Mathias Date: Sun, 18 Oct 2020 12:01:12 +0200 Subject: [PATCH] Add a test for removal of at command --- tests/integration/targets/at/aliases | 1 - tests/integration/targets/at/tasks/main.yml | 53 +++++++++++++++------ 2 files changed, 39 insertions(+), 15 deletions(-) diff --git a/tests/integration/targets/at/aliases b/tests/integration/targets/at/aliases index 85f744a..6eae8bd 100644 --- a/tests/integration/targets/at/aliases +++ b/tests/integration/targets/at/aliases @@ -1,3 +1,2 @@ shippable/posix/group1 destructive -disabled # fixme package diff --git a/tests/integration/targets/at/tasks/main.yml b/tests/integration/targets/at/tasks/main.yml index cd09e11..9538ece 100644 --- a/tests/integration/targets/at/tasks/main.yml +++ b/tests/integration/targets/at/tasks/main.yml @@ -28,16 +28,16 @@ ## at ## -- name: define distros to attempt installing at on +- name: define distros to attempt installing at on set_fact: package_distros: - - RedHat - - CentOS - - ScientificLinux - - Fedora - - Ubuntu - - Debian - - openSUSE Leap + - RedHat + - CentOS + - ScientificLinux + - Fedora + - Ubuntu + - Debian + - openSUSE Leap - name: ensure at is installed package: @@ -54,9 +54,34 @@ - debug: var=at_test0 - name: validate results assert: - that: - - 'at_test0.changed is defined' - - 'at_test0.count is defined' - - 'at_test0.script_file is defined' - - 'at_test0.state is defined' - - 'at_test0.units is defined' + that: + - 'at_test0.changed is defined' + - 'at_test0.count is defined' + - 'at_test0.script_file is defined' + - 'at_test0.state is defined' + - 'at_test0.units is defined' + +- name: add a at useless command + at: + command: /bin/logger 'AT task ran from Ansible' + count: 1 + units: minutes + unique: yes + register: at_add + +- debug var=at_add + +- name: pause, giving the time the at runs once + pause: + minutes: 1 + +- name: add a at useless command + at: + command: /bin/logger 'AT task ran from Ansible' + count: 1 + units: minutes + unique: yes + state: absent + register: at_removal + +- debug var=at_removal