@@ -15,11 +15,16 @@ import (
1515
1616const (
1717 offerName = "EM-B220E-NVME"
18+ region = "fr-par-1"
19+ offerId = "206ea234-9097-4ae1-af68-6d2be09f47ed"
1820)
1921
2022func TestAccDataSourceOffer_Basic (t * testing.T ) {
2123 tt := acctest .NewTestTools (t )
2224 defer tt .Cleanup ()
25+ if ! IsOfferAvailable (offerId , region , tt ) {
26+ t .Skip ("Offer is out of stock" )
27+ }
2328 resource .ParallelTest (t , resource.TestCase {
2429 PreCheck : func () { acctest .PreCheck (t ) },
2530 ProviderFactories : tt .ProviderFactories ,
@@ -47,9 +52,9 @@ func TestAccDataSourceOffer_Basic(t *testing.T) {
4752 resource .TestCheckResourceAttr ("data.scaleway_baremetal_offer.test2" , "commercial_range" , "beryllium" ),
4853 resource .TestCheckResourceAttr ("data.scaleway_baremetal_offer.test2" , "stock" , "available" ), // skipping this as stocks vary too much
4954 resource .TestCheckResourceAttr ("data.scaleway_baremetal_offer.test2" , "cpu.0.name" , "AMD EPYC 7232P" ),
50- resource .TestCheckResourceAttr ("data.scaleway_baremetal_offer.test2" , "cpu.0.core_count" , "4 " ),
55+ resource .TestCheckResourceAttr ("data.scaleway_baremetal_offer.test2" , "cpu.0.core_count" , "8 " ),
5156 resource .TestCheckResourceAttr ("data.scaleway_baremetal_offer.test2" , "cpu.0.frequency" , "3100" ),
52- resource .TestCheckResourceAttr ("data.scaleway_baremetal_offer.test2" , "cpu.0.thread_count" , "4 " ),
57+ resource .TestCheckResourceAttr ("data.scaleway_baremetal_offer.test2" , "cpu.0.thread_count" , "16 " ),
5358 resource .TestCheckResourceAttr ("data.scaleway_baremetal_offer.test2" , "disk.0.type" , "NVMe" ),
5459 resource .TestCheckResourceAttr ("data.scaleway_baremetal_offer.test2" , "disk.0.capacity" , "1024209543168" ),
5560 resource .TestCheckResourceAttr ("data.scaleway_baremetal_offer.test2" , "disk.1.type" , "NVMe" ),
@@ -67,6 +72,9 @@ func TestAccDataSourceOffer_Basic(t *testing.T) {
6772func TestAccDataSourceOffer_SubscriptionPeriodHourly (t * testing.T ) {
6873 tt := acctest .NewTestTools (t )
6974 defer tt .Cleanup ()
75+ if ! IsOfferAvailable (offerId , region , tt ) {
76+ t .Skip ("Offer is out of stock" )
77+ }
7078 resource .ParallelTest (t , resource.TestCase {
7179 PreCheck : func () { acctest .PreCheck (t ) },
7280 ProviderFactories : tt .ProviderFactories ,
@@ -118,6 +126,9 @@ func TestAccDataSourceOffer_SubscriptionPeriodHourly(t *testing.T) {
118126func TestAccDataSourceOffer_SubscriptionPeriodMonthly (t * testing.T ) {
119127 tt := acctest .NewTestTools (t )
120128 defer tt .Cleanup ()
129+ if ! IsOfferAvailable (offerId , region , tt ) {
130+ t .Skip ("Offer is out of stock" )
131+ }
121132 resource .ParallelTest (t , resource.TestCase {
122133 PreCheck : func () { acctest .PreCheck (t ) },
123134 ProviderFactories : tt .ProviderFactories ,
0 commit comments