@@ -171,12 +171,92 @@ func TestDiskImageDiffSuppress(t *testing.T) {
171171 New : "different-cloud/debian-8" ,
172172 ExpectDiffSuppress : false ,
173173 },
174+ // arm images
175+ "matching image opensuse arm64 self_link" : {
176+ Old : "https://www.googleapis.com/compute/v1/projects/opensuse-cloud/global/images/opensuse-leap-15-4-v20220713-arm64" ,
177+ New : "opensuse-leap-arm64" ,
178+ ExpectDiffSuppress : true ,
179+ },
180+ "matching image sles arm64 self_link" : {
181+ Old : "https://www.googleapis.com/compute/v1/projects/suse-cloud/global/images/sles-15-sp4-v20220713-arm64" ,
182+ New : "sles-15-arm64" ,
183+ ExpectDiffSuppress : true ,
184+ },
185+ "matching image ubuntu arm64 self_link" : {
186+ Old : "https://www.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/images/ubuntu-1804-bionic-arm64-v20220712" ,
187+ New : "ubuntu-1804-lts-arm64" ,
188+ ExpectDiffSuppress : true ,
189+ },
190+ "matching image ubuntu-minimal arm64 self_link" : {
191+ Old : "https://www.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/images/ubuntu-minimal-2004-focal-arm64-v20220713" ,
192+ New : "ubuntu-minimal-2004-lts-arm64" ,
193+ ExpectDiffSuppress : true ,
194+ },
195+ "matching image debian arm64 self_link" : {
196+ Old : "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-11-bullseye-arm64-v20220719" ,
197+ New : "debian-11-arm64" ,
198+ ExpectDiffSuppress : true ,
199+ },
200+ "different architecture image opensuse arm64 self_link" : {
201+ Old : "https://www.googleapis.com/compute/v1/projects/opensuse-cloud/global/images/opensuse-leap-15-4-v20220713-arm64" ,
202+ New : "opensuse-leap" ,
203+ ExpectDiffSuppress : false ,
204+ },
205+ "different architecture image sles arm64 self_link" : {
206+ Old : "https://www.googleapis.com/compute/v1/projects/suse-cloud/global/images/sles-15-sp4-v20220713-arm64" ,
207+ New : "sles-15" ,
208+ ExpectDiffSuppress : false ,
209+ },
210+ "different architecture image ubuntu arm64 self_link" : {
211+ Old : "https://www.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/images/ubuntu-1804-bionic-arm64-v20220712" ,
212+ New : "ubuntu-1804-lts" ,
213+ ExpectDiffSuppress : false ,
214+ },
215+ "different architecture image ubuntu-minimal arm64 self_link" : {
216+ Old : "https://www.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/images/ubuntu-minimal-2004-focal-arm64-v20220713" ,
217+ New : "ubuntu-minimal-2004-lts" ,
218+ ExpectDiffSuppress : false ,
219+ },
220+ "different architecture image debian arm64 self_link" : {
221+ Old : "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-11-bullseye-arm64-v20220719" ,
222+ New : "debian-11" ,
223+ ExpectDiffSuppress : false ,
224+ },
225+ "different architecture image opensuse arm64 family" : {
226+ Old : "https://www.googleapis.com/compute/v1/projects/opensuse-cloud/global/images/opensuse-leap-15-2-v20200702" ,
227+ New : "opensuse-leap-arm64" ,
228+ ExpectDiffSuppress : false ,
229+ },
230+ "different architecture image sles arm64 family" : {
231+ Old : "https://www.googleapis.com/compute/v1/projects/suse-cloud/global/images/sles-15-sp4-v20220722-x86-64" ,
232+ New : "sles-15-arm64" ,
233+ ExpectDiffSuppress : false ,
234+ },
235+ "different architecture image ubuntu arm64 family" : {
236+ Old : "https://www.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/images/ubuntu-1804-bionic-v20220712" ,
237+ New : "ubuntu-1804-lts-arm64" ,
238+ ExpectDiffSuppress : false ,
239+ },
240+ "different architecture image ubuntu-minimal arm64 family" : {
241+ Old : "https://www.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/images/ubuntu-minimal-2004-focal-v20220713" ,
242+ New : "ubuntu-minimal-2004-lts-arm64" ,
243+ ExpectDiffSuppress : false ,
244+ },
245+ "different architecture image debian arm64 family" : {
246+ Old : "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-11-bullseye-v20220719" ,
247+ New : "debian-11-arm64" ,
248+ ExpectDiffSuppress : false ,
249+ },
174250 }
175251
176252 for tn , tc := range cases {
177- if diskImageDiffSuppress ("image" , tc .Old , tc .New , nil ) != tc .ExpectDiffSuppress {
178- t .Errorf ("bad: %s, %q => %q expect DiffSuppress to return %t" , tn , tc .Old , tc .New , tc .ExpectDiffSuppress )
179- }
253+ tc := tc
254+ t .Run (tn , func (t * testing.T ) {
255+ t .Parallel ()
256+ if diskImageDiffSuppress ("image" , tc .Old , tc .New , nil ) != tc .ExpectDiffSuppress {
257+ t .Fatalf ("%q => %q expect DiffSuppress to return %t" , tc .Old , tc .New , tc .ExpectDiffSuppress )
258+ }
259+ })
180260 }
181261}
182262
0 commit comments