Commit e01d7f80 authored by Vitaly Lipatov's avatar Vitaly Lipatov

add test for get_etersoft_srpm_path

parent 15c6a127
#!/bin/sh #!/bin/sh
. `dirname $0`/../share/eterbuild/functions/common . `dirname $0`/../share/eterbuild/functions/common
load_mod spec load_mod spec etersoft
SPEC=get_ver.spec SPEC=get_ver.spec
gen_spec()
check_get_version()
{ {
RES=$1
cat <<EOF >$SPEC cat <<EOF >$SPEC
Name: get_version_test Name: get_version_test
Release: alt1 Release: alt1
Version: $TESTVER Version: $TESTVER
Source: %name-%version.tar.bz2 Source: $SOURCEPATH%name-%version.tar.bz2
Summary: Test Summary: Test
Group: Other Group: Other
License: Public License License: Public License
...@@ -23,12 +21,38 @@ License: Public License ...@@ -23,12 +21,38 @@ License: Public License
%description %description
Get version test Get version test
EOF EOF
}
check_get_version()
{
RES=$1
gen_spec
RESGET=`get_tarballname $SPEC` RESGET=`get_tarballname $SPEC`
[ "$RES" != "$RESGET" ] && echo "FATAL with 'get_tarballname': result '$RES' do not match with '$RESGET'" || echo "OK for 'get_tarballname' with '$RESGET'" [ "$RES" != "$RESGET" ] && echo "FATAL with 'get_tarballname': result '$RES' do not match with '$RESGET'" || echo "OK for 'get_tarballname' with '$RESGET'"
} }
TESTVER=1.0.10 TESTVER=1.0.10
SOURCEPATH=
check_get_version get_version_test check_get_version get_version_test
SOURCEPATH=ftp://etersoft.ru/pub/Etersoft/TEST/
echo "Source path $SOURCEPATH: "
gen_spec
get_etersoft_srpm_path $SPEC
SOURCEPATH=/var/ftp/pub/Etersoft/TEST/
echo "Source path $SOURCEPATH: "
gen_spec
get_etersoft_srpm_path $SPEC
SOURCEPATH=ftp.eter:/var/ftp/pub/Etersoft/TEST/
echo "Source path $SOURCEPATH: "
gen_spec
get_etersoft_srpm_path $SPEC
SOURCEPATH=ftp://somecompany.ru/Etersoft/TEST/
echo "Source path $SOURCEPATH: "
gen_spec
get_etersoft_srpm_path $SPEC
rm -f $SPEC rm -f $SPEC
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment