@@ -30,8 +30,9 @@ func TestLaunchSpecUnmarshalJSONHappyCases(t *testing.T) {
3030 Experiments : experiments.Experiments {
3131 EnableItaVerifier : true ,
3232 },
33- GcaAddress : "https://confidentialcomputing.googleapis.com" ,
34- InstallGpuDriver : true ,
33+ GcaAddress : "https://confidentialcomputing.googleapis.com" ,
34+ InstallGpuDriver : true ,
35+ DisableGcaRefresh : false ,
3536 }
3637
3738 var testCases = []struct {
@@ -79,8 +80,7 @@ func TestLaunchSpecUnmarshalJSONHappyCases(t *testing.T) {
7980 "tee-mount":"type=tmpfs,source=tmpfs,destination=/tmpmount;type=tmpfs,source=tmpfs,destination=/sized,size=222",
8081 "ita-region":"US",
8182 "ita-api-key":"test-api-key",
82- "tee-install-gpu-driver":"true",
83- "tee-gpu-driver-version":"590.48.01"
83+ "tee-install-gpu-driver":"true"
8484 }` ,
8585 modifyWant : func (ls LaunchSpec ) LaunchSpec {
8686 ls .GcaAddress = ""
@@ -105,8 +105,7 @@ func TestLaunchSpecUnmarshalJSONHappyCases(t *testing.T) {
105105 "ita-region":"US",
106106 "ita-api-key":"test-api-key",
107107 "gca-service-env":"prod",
108- "tee-install-gpu-driver":"true",
109- "tee-gpu-driver-version":"590.48.01"
108+ "tee-install-gpu-driver":"true"
110109 }` ,
111110 modifyWant : func (ls LaunchSpec ) LaunchSpec {
112111 return ls
@@ -130,14 +129,37 @@ func TestLaunchSpecUnmarshalJSONHappyCases(t *testing.T) {
130129 "ita-region":"US",
131130 "ita-api-key":"test-api-key",
132131 "gca-service-env":"staging",
133- "tee-install-gpu-driver":"true",
134- "tee-gpu-driver-version":"590.48.01"
132+ "tee-install-gpu-driver":"true"
135133 }` ,
136134 modifyWant : func (ls LaunchSpec ) LaunchSpec {
137135 ls .GcaAddress = "https://staging-confidentialcomputing.sandbox.googleapis.com"
138136 return ls
139137 },
140138 },
139+ {
140+ testName : "DisableGcaRefreshSetToTrue" ,
141+ mdsJSON : `{
142+ "tee-cmd":"[\"--foo\",\"--bar\",\"--baz\"]",
143+ "tee-env-foo":"bar",
144+ "tee-image-reference":"docker.io/library/hello-world:latest",
145+ "tee-signed-image-repos":"docker.io/library/hello-world,gcr.io/cloudrun/hello",
146+ "tee-restart-policy":"Always",
147+ "tee-impersonate-service-accounts":"sv1@developer.gserviceaccount.com,sv2@developer.gserviceaccount.com",
148+ "tee-container-log-redirect":"true",
149+ "tee-monitoring-memory-enable":"true",
150+ "tee-dev-shm-size-kb":"234234",
151+ "tee-mount":"type=tmpfs,source=tmpfs,destination=/tmpmount;type=tmpfs,source=tmpfs,destination=/sized,size=222",
152+ "ita-region":"US",
153+ "ita-api-key":"test-api-key",
154+ "tee-install-gpu-driver":"true",
155+ "tee-disable-gca-refresh":"true"
156+ }` ,
157+ modifyWant : func (ls LaunchSpec ) LaunchSpec {
158+ ls .GcaAddress = ""
159+ ls .DisableGcaRefresh = true
160+ return ls
161+ },
162+ },
141163 }
142164
143165 for _ , testcase := range testCases {
@@ -239,6 +261,13 @@ func TestLaunchSpecUnmarshalJSONBadInput(t *testing.T) {
239261 "gca-service-env":""
240262 }` ,
241263 },
264+ {
265+ "EmptyStringAsDisableGcaRefresh" ,
266+ `{
267+ "tee-image-reference":"docker.io/library/hello-world:latest",
268+ "tee-disable-gca-refresh":"badvalue"
269+ }` ,
270+ },
242271 }
243272
244273 for _ , testcase := range testCases {
@@ -274,6 +303,7 @@ func TestLaunchSpecUnmarshalJSONWithDefaultValue(t *testing.T) {
274303 MonitoringEnabled : None ,
275304 GcaAddress : "" ,
276305 InstallGpuDriver : false ,
306+ DisableGcaRefresh : false ,
277307 }
278308
279309 if ! cmp .Equal (spec , want ) {
0 commit comments