From 4f18ef5ba652b7bc526ccea5368208bda6df6c42 Mon Sep 17 00:00:00 2001 From: Ross Williams Date: Mon, 11 Oct 2021 19:53:18 +0000 Subject: [PATCH] pkgng: add test for autoremove=yes Install package with known dependencies, then remove it and ask autoremove to run. --- .../targets/pkgng/tasks/freebsd.yml | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/tests/integration/targets/pkgng/tasks/freebsd.yml b/tests/integration/targets/pkgng/tasks/freebsd.yml index be0ca79a93..9a0f9df020 100644 --- a/tests/integration/targets/pkgng/tasks/freebsd.yml +++ b/tests/integration/targets/pkgng/tasks/freebsd.yml @@ -253,6 +253,40 @@ - "(pkgng_example6.stdout | regex_findall('will be affected', multiline=True) | count) == 2" - pkgng_example6_cleanup.changed +## +## pkgng - example - autoremove=yes +## +- name: Install GNU autotools + pkgng: + name: autotools + state: latest + register: pkgng_example7_prepare_install + +- name: Remove GNU autotools and run pkg autoremove + pkgng: + name: autotools + state: absent + autoremove: yes + register: pkgng_example7 + +- name: Check if autoremove uninstalled known autotools dependencies + pkgng: + name: + - autoconf + - automake + - libtool + - m4 + state: absent + check_mode: yes + register: pkgng_example7_cleanup + +- name: Ensure pkgng autoremove works correctly + assert: + that: + - pkgng_example7_prepare_install.changed + - "'autoremoved' is in(pkgng_example7.msg)" + - not pkgng_example7_cleanup.changed + ## ## pkgng - example - Install single package in jail ##