Skip to content

Commit 14fb36d

Browse files
committed
Refactored login
1 parent c691484 commit 14fb36d

File tree

5 files changed

+10
-25
lines changed

5 files changed

+10
-25
lines changed

examples/lib/loginUser.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
#!/bin/bash
2+
echo "Logging in as user"
23
azure account add -u "$azureUser" -p "$password" -s "$subscription"

examples/lib/setup.sh

Lines changed: 0 additions & 17 deletions
This file was deleted.

examples/lib/testrunner.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
#!/bin/bash
22
export BASEDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
3-
. $BASEDIR/assert.sh
43
. $BASEDIR/helper.sh
5-
. $BASEDIR/setup.sh
64
export groupName=`randomName testrg`
75
export location="westus"
6+
export CmdletSessionID=1010
87
export MSYS_NO_PATHCONV=1
98

10-
login
9+
. $BASEDIR/loginUser.sh
1110

1211
for d in $( ls $BASEDIR/.. --ignore=lib ); do
1312
for f in $( ls $BASEDIR/../$d/*.sh ); do
1413
echo "running: $f"
1514
. $f
16-
cleanup
15+
set +e
16+
printf "\nCleanup: removing resource group: %s\n" $groupName
17+
azure group remove --name "$groupName" --force
18+
set -e
1719
echo "success: $f"
1820
done
1921
done

src/CLU/Commands.Common.ScenarioTest/EnvironmentCredentialsProvider.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ protected virtual IDictionary<string, string> GetSettings(string key)
4545
var environmentValue = Environment.GetEnvironmentVariable(key);
4646
if (string.IsNullOrWhiteSpace(environmentValue))
4747
{
48-
throw new InvalidOperationException($"Unable to create credentials. " +
49-
"Please set environment ${key}");
48+
throw new InvalidOperationException($"Unable to create credentials. Please set environment variable `{key}`");
5049
}
5150
IDictionary<string, string> settings = new Dictionary<string, string>();
5251
foreach (

src/CLU/Commands.Common.ScenarioTest/SampleTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ public SampleTest(ScenarioTestFixture fixture)
3333
}
3434

3535
[Fact]
36-
public void RunSampleTest()
36+
public void ResourceGroupsTest()
3737
{
3838
var helper = _collectionState.GetRunner("resource-management");
3939
helper.RunScript("01-ResourceGroups");
4040
}
4141

4242
[Fact]
43-
public void RunVirtualHardDiskTest()
43+
public void VirtualHardDisksTest()
4444
{
4545
var helper = _collectionState.GetRunner("virtual-hard-disk");
4646
helper.RunScript("01-VirtualHardDisks");

0 commit comments

Comments
 (0)