@@ -1814,7 +1814,6 @@ func TestRenewCertRestoringValues(t *testing.T) {
1814
1814
req .KeyType = certificate .KeyTypeECDSA
1815
1815
req .KeyCurve = certificate .EllipticCurveP521
1816
1816
req .CsrOrigin = certificate .ServiceGeneratedCSR
1817
- req .Timeout = time .Second * 10
1818
1817
err = tpp .GenerateRequest (& endpoint.ZoneConfiguration {}, req )
1819
1818
if err != nil {
1820
1819
t .Fatalf ("err is not nil, err: %s" , err )
@@ -1828,6 +1827,11 @@ func TestRenewCertRestoringValues(t *testing.T) {
1828
1827
req .FetchPrivateKey = true
1829
1828
req .KeyPassword = os .Getenv ("TPP_PASSWORD" )
1830
1829
1830
+ req .Timeout = time .Second * 30 // explicitly setting this value here
1831
+ // to make sure we only wait for certificate issuance for 30 seconds because
1832
+ // setting it before the RequestCertificate function, will override
1833
+ // workToDoTimeout to only wait to 30 seconds
1834
+
1831
1835
pcc , err := tpp .RetrieveCertificate (req )
1832
1836
if err != nil {
1833
1837
t .Fatal (err )
@@ -1847,11 +1851,11 @@ func TestRenewCertRestoringValues(t *testing.T) {
1847
1851
renewReq := certificate.RenewalRequest {
1848
1852
CertificateDN : req .PickupID ,
1849
1853
}
1850
- pickupdID , err := tpp .RenewCertificate (& renewReq )
1854
+ pickupID , err := tpp .RenewCertificate (& renewReq )
1851
1855
if err != nil {
1852
1856
t .Fatal (err )
1853
1857
}
1854
- req = & certificate.Request {PickupID : pickupdID , Timeout : 30 * time .Second }
1858
+ req = & certificate.Request {PickupID : pickupID , Timeout : 30 * time .Second }
1855
1859
pcc , err = tpp .RetrieveCertificate (req )
1856
1860
if err != nil {
1857
1861
t .Fatal (err )
@@ -2288,7 +2292,6 @@ func TestEnrollWithLocation(t *testing.T) {
2288
2292
2289
2293
req := certificate.Request {}
2290
2294
req .Subject .CommonName = cn
2291
- req .Timeout = time .Second * 10
2292
2295
req .Location = & certificate.Location {
2293
2296
Instance : "instance" ,
2294
2297
Workload : workload ,
@@ -2305,7 +2308,6 @@ func TestEnrollWithLocation(t *testing.T) {
2305
2308
}
2306
2309
req = certificate.Request {}
2307
2310
req .Subject .CommonName = cn
2308
- req .Timeout = time .Second * 10
2309
2311
req .Location = & certificate.Location {
2310
2312
Instance : "instance" ,
2311
2313
Workload : workload ,
@@ -2322,7 +2324,6 @@ func TestEnrollWithLocation(t *testing.T) {
2322
2324
}
2323
2325
req = certificate.Request {}
2324
2326
req .Subject .CommonName = cn
2325
- req .Timeout = time .Second * 10
2326
2327
req .Location = & certificate.Location {
2327
2328
Instance : "instance" ,
2328
2329
Workload : workload ,
@@ -2862,6 +2863,9 @@ func TestSetPolicyValuesAndValidate(t *testing.T) {
2862
2863
func TestCreateSshCertServiceGeneratedKP (t * testing.T ) {
2863
2864
2864
2865
tpp , err := getTestConnector (ctx .TPPurl , ctx .TPPZone )
2866
+ if err != nil {
2867
+ t .Fatalf ("err is not nil, err: %s" , err )
2868
+ }
2865
2869
2866
2870
duration := 4
2867
2871
@@ -2880,7 +2884,6 @@ func TestCreateSshCertServiceGeneratedKP(t *testing.T) {
2880
2884
req .ValidityPeriod = fmt .Sprint (duration , "h" )
2881
2885
req .Template = os .Getenv ("TPP_SSH_CA" )
2882
2886
req .SourceAddresses = []string {"test.com" }
2883
- req .Timeout = time .Second * 10
2884
2887
2885
2888
respData , err := tpp .RequestSSHCertificate (req )
2886
2889
@@ -2928,6 +2931,10 @@ func TestCreateSshCertLocalGeneratedKP(t *testing.T) {
2928
2931
2929
2932
tpp , err := getTestConnector (ctx .TPPurl , ctx .TPPZone )
2930
2933
2934
+ if err != nil {
2935
+ t .Fatalf ("err is not nil, err: %s" , err )
2936
+ }
2937
+
2931
2938
duration := 4
2932
2939
2933
2940
tpp .verbose = true
@@ -2959,7 +2966,6 @@ func TestCreateSshCertLocalGeneratedKP(t *testing.T) {
2959
2966
req .ValidityPeriod = fmt .Sprint (duration , "h" )
2960
2967
req .Template = os .Getenv ("TPP_SSH_CA" )
2961
2968
req .SourceAddresses = []string {"test.com" }
2962
- req .Timeout = time .Second * 10
2963
2969
2964
2970
sPubKey := string (pub )
2965
2971
0 commit comments