summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/apt/tasks/apt-builddep.yml
blob: 24ee1dc2ba7ea6cb0a8cee06b3223b1b2fe9120e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# test installing build-deps using netcat and quilt as test victims.
#
# Deps can be discovered like so (taken from ubuntu 12.04)
# ====
# root@localhost:~ # apt-rdepends --build-depends --follow=DEPENDS netcat
# Reading package lists... Done
# Building dependency tree
# Reading state information... Done
# netcat
#   Build-Depends: debhelper (>= 8.0.0)
#   Build-Depends: quilt
# root@localhost:~ #
# ====
# Since many things depend on debhelper, let's just uninstall quilt, then
# install build-dep for netcat to get it back.  build-dep doesn't have an
# uninstall, so we don't need to test for reverse actions (eg, uninstall
# build-dep and ensure things are clean)

# uninstall quilt
- name: check quilt with dpkg
  shell: dpkg -s quilt
  register: dpkg_result
  ignore_errors: true
  tags: ['test_apt_builddep']

- name: uninstall quilt with apt
  apt: pkg=quilt state=absent purge=yes
  register: apt_result
  when: dpkg_result is successful
  tags: ['test_apt_builddep']

# install build-dep for rolldice
- name: install rolldice build-dep with apt
  apt: pkg=rolldice state=build-dep
  register: apt_result
  tags: ['test_apt_builddep']

- name: verify build_dep of netcat
  assert:
    that:
        - "'changed' in apt_result"
  tags: ['test_apt_builddep']

# ensure debhelper and qilt are installed
- name: check build_deps with dpkg
  shell: dpkg --get-selections | egrep '(debhelper|quilt)'
  failed_when: False
  register: dpkg_result
  tags: ['test_apt_builddep']

- name: verify build_deps are really there
  assert:
    that:
        - "dpkg_result.rc == 0"
  tags: ['test_apt_builddep']