# HG changeset patch # User J. Ali Harlow # Date 1520242994 0 # Node ID 06f70d662e39a579f2fa8a4a0067ae40bd078b6a # Parent 644b648173b01fb4cb9a8cd0e9000cbfb97f4790 Add a test for relocations that are valid paths but would be invalid URIs if mis-interpreted diff -r 644b648173b0 -r 06f70d662e39 test/Makefile.am --- a/test/Makefile.am Thu Jul 14 11:43:16 2016 +0100 +++ b/test/Makefile.am Mon Mar 05 09:43:14 2018 +0000 @@ -12,7 +12,7 @@ check_SCRIPTS += curl endif endif -check_SCRIPTS += order non-ascii relative-root +check_SCRIPTS += order non-ascii relative-root non-pchar if !MSWIN_API check_PROGRAMS = tftpd @@ -46,6 +46,9 @@ relative-root: relative-root.sh base/repodata/primary.xml.gz cp $(srcdir)/relative-root.sh relative-root +non-pchar: non-pchar.sh base/repodata/primary.xml.gz + cp $(srcdir)/non-pchar.sh non-pchar + lua: lua.sh base/repodata/primary.xml.gz cp $(srcdir)/lua.sh lua @@ -108,6 +111,7 @@ details.sh \ details.ref \ named-root.sh \ + non-pchar.sh \ relocate.sh MOSTLYCLEANFILES = \ diff -r 644b648173b0 -r 06f70d662e39 test/non-pchar.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/non-pchar.sh Mon Mar 05 09:43:14 2018 +0000 @@ -0,0 +1,31 @@ +#!/bin/sh +set -x +if [ $# -gt 0 ]; then + razor="$1" +else + razor=../src/razor +fi +check_file() +{ + $razor list-files | grep -F -x "$1" > /dev/null + if [ $? -ne 0 ]; then + echo $1: Not in database >&2 + exit 1 + fi + if [ ! -e "$tmpdir$1" ]; then + echo $1: Not in filesystem >&2 + exit 1 + fi +} +tmpdir=`mktemp -dt` || exit 1 +export RAZOR_ROOT="file:$tmpdir" +$razor init || exit 1 +export YUM_URL="file:`pwd`/base" +$razor import-yum || exit 1 +$razor install zap || exit 1 +$razor install --relocate "/usr=/my files" --relocate "/etc=/my files/καὶ τὰ ἕτερα" zsh || exit 1 +check_file /etc/zsh.conf +check_file /usr/bin/zap +check_file "/my files/bin/zip" +check_file "/my files/bin/zsh" +rm -rf "$tmpdir"