Add a test for relocations that are valid paths but would be invalid URIs if mis-interpreted
9 if [ ! -e "$tmpdir$1" ]; then
10 echo $1: Not in filesystem >&2
15 fs_check_file_contents()
18 if [ `cat "$tmpdir$1"` != "$2" ]; then
19 echo $1: Unexpected contents >&2
26 if [ -e "$tmpdir$1" ]; then
27 echo $1: Still in filesystem >&2
33 $razor list-files | grep -F -x "$1" > /dev/null
35 echo $1: Not in database >&2
39 $razor list-files "$1" | grep -F -x "$1" > /dev/null
41 echo $1: Not seen by patterned list >&2
42 $razor list-files "$1" >&2
45 pkgs=`$razor list-file-packages "$1"`
46 if [ -z "$pkgs" ]; then
47 echo $1: Not owned by any package >&2
48 $razor list-file-packages "$1"
51 for nevra in "$pkgs"; do
52 name=`echo $nevra | sed 's/\-.*$//'`
53 $razor list-package-files "$name" | grep -F -x "$1" > /dev/null
55 echo $1: Not in database for package $name >&2
56 $razor list-package-files "$name"
64 $razor list-files | grep -F -x "$1" > /dev/null
66 echo $1: Still in database >&2
73 count=`$razor list "$1" | wc -l`
74 if [ "$count" != "$2" ]; then
75 echo $1: Install count $count, should be $2 >&2
79 tmpdir=`mktemp -dt` || exit 1
80 export RAZOR_ROOT="file:$tmpdir"
82 export YUM_URL="file:`pwd`/base"
83 $razor import-yum || exit 1
84 $razor install --relocate /usr=/opt zip || exit 1
85 fs_check_file_contents /opt/bin/zip zip-1-1
86 fs_check_file /opt/var/lib/zip/data.zap
87 $razor install --relocate /usr=/opt zip || exit 1
88 check_install_count zip 2
89 $razor install --relocate /usr=/opt zip || exit 1
90 check_install_count zip 3