bf42015a1c50a44b20a4c965d11c43f0ff31196b
[libguestfs.git] / regressions / rhbz727178.sh
1 #!/bin/bash -
2 # libguestfs
3 # Copyright (C) 2011 Red Hat Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18
19 # https://bugzilla.redhat.com/show_bug.cgi?id=727178
20 # Check that all binaries that we ship in the appliance contain
21 # corresponding libraries.
22
23 set -e
24 export LANG=C
25
26 guestfish=../fish/guestfish
27 output=rhbz727178.output
28
29 rm -f binaries.tmp $output
30
31 eval `$guestfish -a /dev/null --listen`
32
33 $guestfish --remote -- run
34 $guestfish --remote -- debug binaries "" |
35     grep -E '^/(bin|sbin|usr/bin|usr/sbin|usr/libexec)/' > binaries.tmp
36
37 while read ex; do
38     echo ldd $ex
39     $guestfish --remote -- -debug ldd $ex
40 done < binaries.tmp > $output
41
42 if grep -E '\bnot found\b|undefined symbol' $output; then
43     echo "Error: some libraries are missing from the appliance."
44     echo "See" $(pwd)/$output
45     echo "for the complete output."
46     exit 1
47 fi
48
49 rm binaries.tmp $output