@@ -21,7 +21,7 @@ import (
2121)
2222
2323func TestGetKey (t * testing.T ) {
24- client := dstack .NewDstackClient ()
24+ client := dstack .NewDstackClientV0 ()
2525 resp , err := client .GetKey (context .Background (), "/" , "test" , "ed25519" )
2626 if err != nil {
2727 t .Fatal (err )
@@ -37,7 +37,7 @@ func TestGetKey(t *testing.T) {
3737}
3838
3939func TestGetQuote (t * testing.T ) {
40- client := dstack .NewDstackClient ()
40+ client := dstack .NewDstackClientV0 ()
4141 resp , err := client .GetQuote (context .Background (), []byte ("test" ))
4242 if err != nil {
4343 t .Fatal (err )
@@ -59,7 +59,7 @@ func TestGetQuote(t *testing.T) {
5959}
6060
6161func TestAttest (t * testing.T ) {
62- client := dstack .NewDstackClient ()
62+ client := dstack .NewDstackClientV0 ()
6363 resp , err := client .Attest (context .Background (), []byte ("test" ))
6464 if err != nil {
6565 t .Fatal (err )
@@ -111,7 +111,7 @@ func TestAttestRequestIsFrozenAtV0(t *testing.T) {
111111}
112112
113113func TestGetTlsKey (t * testing.T ) {
114- client := dstack .NewDstackClient ()
114+ client := dstack .NewDstackClientV0 ()
115115 altNames := []string {"localhost" }
116116 resp , err := client .GetTlsKey (
117117 context .Background (),
@@ -177,7 +177,7 @@ func TestGetTlsKey(t *testing.T) {
177177}
178178
179179func TestGetTlsKeyMinimalOptions (t * testing.T ) {
180- client := dstack .NewDstackClient ()
180+ client := dstack .NewDstackClientV0 ()
181181 // Test with minimal options (just subject)
182182 resp , err := client .GetTlsKey (
183183 context .Background (),
@@ -217,7 +217,7 @@ func TestGetTlsKeyMinimalOptions(t *testing.T) {
217217}
218218
219219func TestGetTlsKeyServerOnly (t * testing.T ) {
220- client := dstack .NewDstackClient ()
220+ client := dstack .NewDstackClientV0 ()
221221 // Test with server auth only
222222 resp , err := client .GetTlsKey (
223223 context .Background (),
@@ -269,7 +269,7 @@ func TestGetTlsKeyServerOnly(t *testing.T) {
269269}
270270
271271func TestGetTlsKeyClientOnly (t * testing.T ) {
272- client := dstack .NewDstackClient ()
272+ client := dstack .NewDstackClientV0 ()
273273 // Test with client auth only
274274 resp , err := client .GetTlsKey (
275275 context .Background (),
@@ -321,7 +321,7 @@ func TestGetTlsKeyClientOnly(t *testing.T) {
321321}
322322
323323func TestGetTlsKeyWithMultipleAltNames (t * testing.T ) {
324- client := dstack .NewDstackClient ()
324+ client := dstack .NewDstackClientV0 ()
325325 // Test with multiple alternative names
326326 altNames := []string {"example.com" , "test.example.com" }
327327 resp , err := client .GetTlsKey (
@@ -385,7 +385,7 @@ func parseCertificate(pemCert string) (*x509.Certificate, error) {
385385}
386386
387387func TestInfo (t * testing.T ) {
388- client := dstack .NewDstackClient ()
388+ client := dstack .NewDstackClientV0 ()
389389 resp , err := client .Info (context .Background ())
390390 if err != nil {
391391 t .Fatal (err )
@@ -443,7 +443,7 @@ func TestInfo(t *testing.T) {
443443}
444444
445445func TestSignAndVerifyEd25519 (t * testing.T ) {
446- client := dstack .NewDstackClient ()
446+ client := dstack .NewDstackClientV0 ()
447447 dataToSign := []byte ("test message for ed25519" )
448448 algorithm := "ed25519"
449449
@@ -486,7 +486,7 @@ func TestSignAndVerifyEd25519(t *testing.T) {
486486}
487487
488488func TestSignAndVerifySecp256k1 (t * testing.T ) {
489- client := dstack .NewDstackClient ()
489+ client := dstack .NewDstackClientV0 ()
490490 dataToSign := []byte ("test message for secp256k1" )
491491 algorithm := "secp256k1"
492492
@@ -522,7 +522,7 @@ func TestSignAndVerifySecp256k1(t *testing.T) {
522522}
523523
524524func TestSignAndVerifySecp256k1Prehashed (t * testing.T ) {
525- client := dstack .NewDstackClient ()
525+ client := dstack .NewDstackClientV0 ()
526526 dataToSign := []byte ("test message for secp256k1 prehashed" )
527527 digest := sha256 .Sum256 (dataToSign )
528528 algorithm := "secp256k1_prehashed"
@@ -567,7 +567,7 @@ func TestSignAndVerifySecp256k1Prehashed(t *testing.T) {
567567}
568568
569569func TestGetVersion (t * testing.T ) {
570- client := dstack .NewDstackClient ()
570+ client := dstack .NewDstackClientV0 ()
571571 resp , err := client .GetVersion (context .Background ())
572572 if err != nil {
573573 t .Fatal (err )
@@ -579,7 +579,7 @@ func TestGetVersion(t *testing.T) {
579579}
580580
581581func TestGetKeyK256Alias (t * testing.T ) {
582- client := dstack .NewDstackClient ()
582+ client := dstack .NewDstackClientV0 ()
583583
584584 respK256 , err := client .GetKey (context .Background (), "/test" , "purpose" , "k256" )
585585 if err != nil {
@@ -598,23 +598,23 @@ func TestGetKeyK256Alias(t *testing.T) {
598598}
599599
600600func TestGetKeyUnsupportedAlgorithm (t * testing.T ) {
601- client := dstack .NewDstackClient ()
601+ client := dstack .NewDstackClientV0 ()
602602 _ , err := client .GetKey (context .Background (), "/test" , "purpose" , "rsa" )
603603 if err == nil {
604604 t .Fatal ("expected error for unsupported algorithm" )
605605 }
606606}
607607
608608func TestGetKeySecp256k1PrehashedRejected (t * testing.T ) {
609- client := dstack .NewDstackClient ()
609+ client := dstack .NewDstackClientV0 ()
610610 _ , err := client .GetKey (context .Background (), "/test" , "purpose" , "secp256k1_prehashed" )
611611 if err == nil {
612612 t .Fatal ("expected error for secp256k1_prehashed in GetKey" )
613613 }
614614}
615615
616616func TestGetKeyAlgorithmValidation (t * testing.T ) {
617- client := dstack .NewDstackClient ()
617+ client := dstack .NewDstackClientV0 ()
618618
619619 // ed25519 should succeed (Version RPC is available on the simulator)
620620 resp , err := client .GetKey (context .Background (), "/test" , "purpose" , "ed25519" )
@@ -646,12 +646,11 @@ func TestEmitEventSurfacesTheRemovalMessage(t *testing.T) {
646646 }
647647}
648648
649- // NewDstackClient is kept as a deprecated alias for NewDstackClientV0, so code
650- // written against the pre-0.6 SDK keeps compiling and keeps talking to the same
651- // frozen surface.
652- func TestDeprecatedAliasIsTheV0Client (t * testing.T ) {
653- var client * dstack.DstackClientV0 = dstack .NewDstackClient ()
649+ // The frozen surface stays reachable, but only under its explicit name now that
650+ // the unsuffixed client means v1.
651+ func TestV0RemainsAvailableUnderItsExplicitName (t * testing.T ) {
652+ var client * dstack.DstackClientV0 = dstack .NewDstackClientV0 ()
654653 if ! client .IsReachable (context .Background ()) {
655- t .Error ("expected the aliased client to reach the simulator" )
654+ t .Error ("expected the v0 client to reach the simulator" )
656655 }
657656}
0 commit comments