@@ -1490,3 +1490,34 @@ func (vcd *TestVCD) Test_CatalogCreateCompleteness(check *C) {
1490
1490
err = catalog .Delete (true , true )
1491
1491
check .Assert (err , IsNil )
1492
1492
}
1493
+
1494
+ func (vcd * TestVCD ) Test_CaptureVapp (check * C ) {
1495
+ fmt .Printf ("Running: %s\n " , check .TestName ())
1496
+
1497
+ vapp , vm := createNsxtVAppAndVm (vcd , check )
1498
+ check .Assert (vapp , NotNil )
1499
+ check .Assert (vm , NotNil )
1500
+
1501
+ // retrieve NSX-T Catalog
1502
+ cat , err := vcd .org .GetCatalogByName (vcd .config .VCD .Catalog .NsxtBackedCatalogName , false )
1503
+ check .Assert (err , IsNil )
1504
+ check .Assert (cat , NotNil )
1505
+
1506
+ vAppCaptureParams := & types.CaptureVAppParams {
1507
+ Name : check .TestName () + "vm-template" ,
1508
+ Source : & types.Reference {
1509
+ HREF : vapp .VApp .HREF ,
1510
+ },
1511
+ CustomizationSection : types.CaptureVAppParamsCustomizationSection {
1512
+ Info : "CustomizeOnInstantiate Settings" ,
1513
+ CustomizeOnInstantiate : true ,
1514
+ },
1515
+ CopyTpmOnInstantiate : addrOf (false ),
1516
+ }
1517
+
1518
+ templ , err := cat .CaptureVappTemplate (vAppCaptureParams )
1519
+ check .Assert (err , IsNil )
1520
+ check .Assert (templ , NotNil )
1521
+
1522
+ AddToCleanupList (templ .VAppTemplate .Name , "catalogItem" , vcd .org .Org .Name + "|" + vcd .config .VCD .Catalog .NsxtBackedCatalogName , "Test_UploadOvf" )
1523
+ }
0 commit comments