|
4 | 4 | package manifest |
5 | 5 |
|
6 | 6 | import ( |
7 | | - "errors" |
8 | 7 | "fmt" |
9 | 8 | "io/ioutil" |
10 | 9 | "path/filepath" |
@@ -1255,92 +1254,6 @@ func TestLoadBalancedWebService_ApplyEnv(t *testing.T) { |
1255 | 1254 | } |
1256 | 1255 | } |
1257 | 1256 |
|
1258 | | -func TestLoadBalancedWebService_ValidateForWindows(t *testing.T) { |
1259 | | - testCases := map[string]struct { |
1260 | | - in *LoadBalancedWebService |
1261 | | - wantedErr error |
1262 | | - }{ |
1263 | | - "returns nil if not windows": { |
1264 | | - in: &LoadBalancedWebService{ |
1265 | | - LoadBalancedWebServiceConfig: LoadBalancedWebServiceConfig{ |
1266 | | - TaskConfig: TaskConfig{ |
1267 | | - Platform: PlatformArgsOrString{ |
1268 | | - PlatformString: (*PlatformString)(aws.String("doors/amp64")), |
1269 | | - PlatformArgs: PlatformArgs{ |
1270 | | - OSFamily: nil, |
1271 | | - Arch: nil, |
1272 | | - }, |
1273 | | - }, |
1274 | | - ExecuteCommand: ExecuteCommand{ |
1275 | | - Config: ExecuteCommandConfig{ |
1276 | | - Enable: aws.Bool(true)}, |
1277 | | - }, |
1278 | | - }, |
1279 | | - }, |
1280 | | - }, |
1281 | | - wantedErr: nil, |
1282 | | - }, |
1283 | | - "throws error when windows and exec both present": { |
1284 | | - in: &LoadBalancedWebService{ |
1285 | | - LoadBalancedWebServiceConfig: LoadBalancedWebServiceConfig{ |
1286 | | - TaskConfig: TaskConfig{ |
1287 | | - Platform: PlatformArgsOrString{ |
1288 | | - PlatformString: nil, |
1289 | | - PlatformArgs: PlatformArgs{ |
1290 | | - OSFamily: aws.String("Windows-Server-2019-Full"), |
1291 | | - Arch: aws.String("amd64"), |
1292 | | - }, |
1293 | | - }, |
1294 | | - ExecuteCommand: ExecuteCommand{ |
1295 | | - Config: ExecuteCommandConfig{ |
1296 | | - Enable: aws.Bool(true)}, |
1297 | | - }, |
1298 | | - }, |
1299 | | - }, |
1300 | | - }, |
1301 | | - wantedErr: errors.New("'exec' is not supported when deploying a Windows container"), |
1302 | | - }, |
1303 | | - "throws error when windows and efs both present": { |
1304 | | - in: &LoadBalancedWebService{ |
1305 | | - LoadBalancedWebServiceConfig: LoadBalancedWebServiceConfig{ |
1306 | | - TaskConfig: TaskConfig{ |
1307 | | - Platform: PlatformArgsOrString{ |
1308 | | - PlatformString: (*PlatformString)(aws.String("windows/amd64")), |
1309 | | - }, |
1310 | | - Storage: Storage{ |
1311 | | - Volumes: map[string]*Volume{ |
1312 | | - "myEFSVolume": { |
1313 | | - MountPointOpts: MountPointOpts{ |
1314 | | - ContainerPath: aws.String("/path/to/files"), |
1315 | | - ReadOnly: aws.Bool(false), |
1316 | | - }, |
1317 | | - EFS: EFSConfigOrBool{ |
1318 | | - Advanced: EFSVolumeConfiguration{ |
1319 | | - FileSystemID: aws.String("fs-1234"), |
1320 | | - }, |
1321 | | - }, |
1322 | | - }, |
1323 | | - }, |
1324 | | - }, |
1325 | | - }, |
1326 | | - }, |
1327 | | - }, |
1328 | | - wantedErr: errors.New("'EFS' is not supported when deploying a Windows container"), |
1329 | | - }, |
1330 | | - } |
1331 | | - for name, tc := range testCases { |
1332 | | - t.Run(name, func(t *testing.T) { |
1333 | | - // WHEN |
1334 | | - err := tc.in.windowsCompatibility() |
1335 | | - |
1336 | | - // THEN |
1337 | | - if err != nil { |
1338 | | - require.EqualError(t, err, tc.wantedErr.Error(), "errors should be returned when disallowed services present") |
1339 | | - } |
1340 | | - }) |
1341 | | - } |
1342 | | -} |
1343 | | - |
1344 | 1257 | func TestLoadBalancedWebService_Port(t *testing.T) { |
1345 | 1258 | // GIVEN |
1346 | 1259 | mft := LoadBalancedWebService{ |
|
0 commit comments