diff --git a/examples/lib/loginUser.sh b/examples/lib/loginUser.sh index fd442b568070..84a8e6deb476 100644 --- a/examples/lib/loginUser.sh +++ b/examples/lib/loginUser.sh @@ -1,2 +1,3 @@ #!/bin/bash +echo "Logging in as user" azure account add -u "$azureUser" -p "$password" -s "$subscription" \ No newline at end of file diff --git a/examples/lib/setup.sh b/examples/lib/setup.sh deleted file mode 100644 index 9de247fce2d5..000000000000 --- a/examples/lib/setup.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -# Login -login() { - echo "Executing Login..." - export CmdletSessionId=1010 - azure account add --username $azureuser --password $azurepassword -} - -cleanup() { - set +e - printf "\nCleanup: removing resource group: %s\n" $groupName - azure group remove --name "$groupName" --force - set -e -} - -export -f login -export -f cleanup \ No newline at end of file diff --git a/examples/lib/testrunner.sh b/examples/lib/testrunner.sh index 0139799fb2fb..5e2eaaea1241 100644 --- a/examples/lib/testrunner.sh +++ b/examples/lib/testrunner.sh @@ -1,18 +1,23 @@ #!/bin/bash export BASEDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) -. $BASEDIR/assert.sh . $BASEDIR/helper.sh -. $BASEDIR/setup.sh export groupName=`randomName testrg` export location="westus" +export CmdletSessionID=1010 +export MSYS_NO_PATHCONV=1 -login +. $BASEDIR/loginUser.sh for d in $( ls $BASEDIR/.. --ignore=lib ); do for f in $( ls $BASEDIR/../$d/*.sh ); do echo "running: $f" . $f - cleanup + set +e + printf "\nCleanup: removing resource group: %s\n" $groupName + azure group remove --name "$groupName" --force + set -e echo "success: $f" done -done \ No newline at end of file +done + +export MSYS_NO_PATHCONV= \ No newline at end of file diff --git a/src/CLU/Commands.Common.ScenarioTest/EnvironmentCredentialsProvider.cs b/src/CLU/Commands.Common.ScenarioTest/EnvironmentCredentialsProvider.cs index 66b685bbe1db..0d3f6c20e05d 100644 --- a/src/CLU/Commands.Common.ScenarioTest/EnvironmentCredentialsProvider.cs +++ b/src/CLU/Commands.Common.ScenarioTest/EnvironmentCredentialsProvider.cs @@ -45,8 +45,7 @@ protected virtual IDictionary GetSettings(string key) var environmentValue = Environment.GetEnvironmentVariable(key); if (string.IsNullOrWhiteSpace(environmentValue)) { - throw new InvalidOperationException($"Unable to create credentials. " + - "Please set environment ${key}"); + throw new InvalidOperationException($"Unable to create credentials. Please set environment variable `{key}`"); } IDictionary settings = new Dictionary(); foreach ( diff --git a/src/CLU/Commands.Common.ScenarioTest/SampleTest.cs b/src/CLU/Commands.Common.ScenarioTest/SampleTest.cs index c727dc7e97f6..a18540c53ba9 100644 --- a/src/CLU/Commands.Common.ScenarioTest/SampleTest.cs +++ b/src/CLU/Commands.Common.ScenarioTest/SampleTest.cs @@ -33,14 +33,14 @@ public SampleTest(ScenarioTestFixture fixture) } [Fact] - public void RunSampleTest() + public void ResourceGroupsTest() { var helper = _collectionState.GetRunner("resource-management"); helper.RunScript("01-ResourceGroups"); } [Fact] - public void RunVirtualHardDiskTest() + public void VirtualHardDisksTest() { var helper = _collectionState.GetRunner("virtual-hard-disk"); helper.RunScript("01-VirtualHardDisks"); diff --git a/tools/CLU/BuildAndInstallClu.bat b/tools/CLU/BuildAndInstallClu.bat index f2869fe143d8..9b1c506c0c93 100644 --- a/tools/CLU/BuildAndInstallClu.bat +++ b/tools/CLU/BuildAndInstallClu.bat @@ -56,4 +56,4 @@ copy /Y %root%\drop\clurun\win7-x64\msclu.cfg %root%\drop\clurun\ubuntu.14.04-x6 copy /Y %azuresh% %root%\drop\clurun\ubuntu.14.04-x64 REM, windows version also needs it for bash based testing -copy /Y %azuresh% %root%\drop\clurun\win7-x64\azure +copy /Y %~dp0\azure.win.sh %root%\drop\clurun\win7-x64\azure diff --git a/tools/CLU/azure.win.sh b/tools/CLU/azure.win.sh new file mode 100644 index 000000000000..5889f49f4512 --- /dev/null +++ b/tools/CLU/azure.win.sh @@ -0,0 +1,8 @@ +#!/bin/bash +if [ -z ${CmdletSessionID} ] +then + export CmdletSessionID=$PPID +fi +SCRIPTPATH=$(dirname "$0") +WSCRIPTPATH=$({ cd $SCRIPTPATH && pwd -W; } | sed 's|/|\\|g') +$WSCRIPTPATH/clurun -s azure -r $WSCRIPTPATH/azure.lx "$@"