Skip to content

Commit b98b6d2

Browse files
committed
Check the Downloaded VHD File
1 parent b5fe7a3 commit b98b6d2

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

examples/virtual-hard-disk/02-VirtualHardDisks.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,23 @@ printf "\n=== Managing Virtual Hard Disks in Azure Compute ===\n"
55
printf "\n1. Creating a new resource group: %s and location: %s.\n" "$groupName" "$location"
66
azure group create -n "$groupName" --location "$location"
77

8-
printf "\n2. Creating a new storage account '%s' in type '%s'" "$storageAccountName" "$storageAccountType"
8+
printf "\n2. Creating a new storage account '%s' in type '%s'.\n" "$storageAccountName" "$storageAccountType"
99
azure storage account new --resourcegroupname "$groupName" --name "$storageAccountName" --location "$location" --type "$storageAccountType"
1010

11-
printf "\n3. Uploading a virtual hard disk to: %s" "$storageAccountName"
11+
printf "\n3. Uploading a virtual hard disk to: %s.\n" "$storageAccountName"
1212
azure vhd add -o --resourcegroupname "$groupName" --destination https://"$storageAccountName".blob.core.windows.net/test/test.vhd --localfilepath $BASEDIR/test.vhd
1313

1414
printf "\n4. Downloading a virtual hard disk"
1515
azure vhd save -o --resourcegroupname "$groupName" --sourceuri https://"$storageAccountName".blob.core.windows.net/test/test.vhd --localfilepath ./test_downloaded_by_clu.vhd
1616

17-
printf "\n5. Validating the downloaded file is the same"
17+
printf "\n5. Validating the downloaded file is the same.\n"
1818
diffResult=`diff ./test_downloaded_by_clu.vhd $BASEDIR/test_uploaded_byps.vhd`
19+
if [ "$diffResult" = "" ]; then
20+
echo "Checked"
21+
else
22+
echo "Different!" 1>&2
23+
exit 1
24+
fi
1925

2026
printf "\n6. Removing resource group: %s.\n" "$groupName"
2127
azure group remove -n "$groupName" -f

0 commit comments

Comments
 (0)