@@ -19,6 +19,7 @@ package azure
1919import (
2020 "fmt"
2121 "reflect"
22+ "slices"
2223 "testing"
2324
2425 "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
@@ -227,11 +228,15 @@ func TestListResourcesAzure(t *testing.T) {
227228 toDigests := func (rs map [string ]* resources.Resource ) map [string ]* resourceDigest {
228229 d := map [string ]* resourceDigest {}
229230 for k , r := range rs {
231+ blocks := slices .Clone (r .Blocks )
232+ blocked := slices .Clone (r .Blocked )
233+ slices .Sort (blocks )
234+ slices .Sort (blocked )
230235 d [k ] = & resourceDigest {
231236 rtype : r .Type ,
232237 name : r .Name ,
233- blocks : r . Blocks ,
234- blocked : r . Blocked ,
238+ blocks : blocks ,
239+ blocked : blocked ,
235240 shared : r .Shared ,
236241 }
237242 }
@@ -253,8 +258,8 @@ func TestListResourcesAzure(t *testing.T) {
253258 rtype : typeSubnet ,
254259 name : subnetName ,
255260 blocks : []string {
256- toKey (typeVirtualNetwork , vnetID ),
257261 toKey (typeResourceGroup , rgID ),
262+ toKey (typeVirtualNetwork , vnetID ),
258263 },
259264 },
260265 toKey (typeRouteTable , rtID ): {
@@ -267,8 +272,8 @@ func TestListResourcesAzure(t *testing.T) {
267272 name : vmssName ,
268273 blocks : []string {
269274 toKey (typeResourceGroup , rgID ),
270- toKey (typeVirtualNetwork , vnetID ),
271275 toKey (typeSubnet , subnetID ),
276+ toKey (typeVirtualNetwork , vnetID ),
272277 },
273278 blocked : []string {
274279 toKey (typeVMScaleSetVM , vmID ),
@@ -278,15 +283,13 @@ func TestListResourcesAzure(t *testing.T) {
278283 rtype : typeDisk ,
279284 name : diskName ,
280285 blocks : []string {toKey (typeResourceGroup , rgID )},
281- blocked : []string {toKey (typeVMScaleSet , vmssID )},
286+ blocked : []string {toKey (typeVMScaleSetVM , vmID )},
282287 },
283288 toKey (typeRoleAssignment , raID ): {
284- rtype : typeRoleAssignment ,
285- name : raName ,
286- blocks : []string {
287- toKey (typeResourceGroup , rgID ),
288- toKey (typeVMScaleSet , vmssID ),
289- },
289+ rtype : typeRoleAssignment ,
290+ name : raName ,
291+ blocks : []string {toKey (typeResourceGroup , rgID )},
292+ blocked : []string {toKey (typeVMScaleSet , vmssID )},
290293 },
291294 toKey (typeLoadBalancer , lbID ): {
292295 rtype : typeLoadBalancer ,
0 commit comments