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 ##