Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
aos
GitHub Repository: aos/ansible
Path: blob/devel/test/integration/targets/apt/tasks/apt-builddep.yml
4751 views
1
# test installing build-deps using netcat and quilt as test victims.
2
#
3
# Deps can be discovered like so (taken from ubuntu 12.04)
4
# ====
5
# root@localhost:~ # apt-rdepends --build-depends --follow=DEPENDS netcat
6
# Reading package lists... Done
7
# Building dependency tree
8
# Reading state information... Done
9
# netcat
10
# Build-Depends: debhelper (>= 8.0.0)
11
# Build-Depends: quilt
12
# root@localhost:~ #
13
# ====
14
# Since many things depend on debhelper, let's just uninstall quilt, then
15
# install build-dep for netcat to get it back. build-dep doesn't have an
16
# uninstall, so we don't need to test for reverse actions (eg, uninstall
17
# build-dep and ensure things are clean)
18
19
# uninstall quilt
20
- name: check quilt with dpkg
21
shell: dpkg -s quilt
22
register: dpkg_result
23
ignore_errors: true
24
tags: ['test_apt_builddep']
25
26
- name: uninstall quilt with apt
27
apt: pkg=quilt state=absent purge=yes
28
register: apt_result
29
when: dpkg_result is successful
30
tags: ['test_apt_builddep']
31
32
# install build-dep for netcat
33
- name: install netcat build-dep with apt
34
apt: pkg=netcat state=build-dep
35
register: apt_result
36
tags: ['test_apt_builddep']
37
38
- name: verify build_dep of netcat
39
assert:
40
that:
41
- "'changed' in apt_result"
42
tags: ['test_apt_builddep']
43
44
# ensure debhelper and qilt are installed
45
- name: check build_deps with dpkg
46
shell: dpkg --get-selections | egrep '(debhelper|quilt)'
47
failed_when: False
48
register: dpkg_result
49
tags: ['test_apt_builddep']
50
51
- name: verify build_deps are really there
52
assert:
53
that:
54
- "dpkg_result.rc == 0"
55
tags: ['test_apt_builddep']
56
57