diff --git a/lib/core.sh b/lib/core.sh index 11a1f69..31c52f2 100644 --- a/lib/core.sh +++ b/lib/core.sh @@ -137,7 +137,7 @@ function setup_from_file_juju(){ [ ! -e ${imagefile} ] && die "Error: The JuJu image file ${imagefile} does not exist" info "Installing JuJu from ${imagefile}..." - _setup_juju ${ORIGIN_WD}/${imagefile} + _setup_juju ${imagefile} builtin cd $ORIGIN_WD } diff --git a/tests/test_core.sh b/tests/test_core.sh index 1a4be0c..1555303 100755 --- a/tests/test_core.sh +++ b/tests/test_core.sh @@ -69,6 +69,13 @@ function test_setup_from_file_juju(){ is_equal $? 1 || return 1 } +function test_setup_from_file_juju_with_absolute_path(){ + touch file + tar -czvf juju-${ARCH}.tar.gz file 1> /dev/null + setup_from_file_juju ${ORIGIN_WD}/juju-${ARCH}.tar.gz &> /dev/null + [ -e $JUJU_HOME/file ] || return 1 + [ -e $JUJU_HOME/run/lock ] || return 1 +} function test_run_juju_as_root(){ install_mini_juju