@@ -445,6 +445,45 @@ endToEndTestSuite(testName, argv, {containerOverrides: overrides}, bootstrapResp
445
445
}
446
446
} ) . timeout ( Duration . ofMinutes ( 2 ) . toMillis ( ) ) ;
447
447
448
+ it ( 'Enable Envoy proxy port forwarding and create client from network config should succeed' , async ( ) => {
449
+ try {
450
+ // using label `app=envoy-proxy-node1` to find Envoy proxy pod
451
+ const envoyProxyPod = await k8Factory . default ( ) . pods ( ) . list ( namespace , [ 'app=envoy-proxy-node1' ] ) ;
452
+ // enable portfroward of Envoy proxy pod
453
+ const portForward = await k8Factory
454
+ . default ( )
455
+ . pods ( )
456
+ . readByReference ( envoyProxyPod [ 0 ] . podReference )
457
+ . portForward ( 10_500 , 8080 ) ;
458
+
459
+ // Setup network configuration
460
+ const networkConfig = { } ;
461
+ networkConfig [ '127.0.0.1:10500' ] = AccountId . fromString ( '0.0.3' ) ;
462
+
463
+ // Instantiate SDK client
464
+ const sdkClient = Client . fromConfig ( { network : networkConfig , scheduleNetworkUpdate : false } ) ;
465
+ sdkClient . setOperator ( MY_ACCOUNT_ID , MY_PRIVATE_KEY ) ;
466
+
467
+ // Create a new public topic and submit a message
468
+ const txResponse = await new TopicCreateTransaction ( ) . execute ( sdkClient ) ;
469
+ const receipt = await txResponse . getReceipt ( sdkClient ) ;
470
+
471
+ const submitResponse = await new TopicMessageSubmitTransaction ( {
472
+ topicId : receipt . topicId ,
473
+ message : 'Hello, Hedera!' ,
474
+ } ) . execute ( sdkClient ) ;
475
+
476
+ const submitReceipt = await submitResponse . getReceipt ( sdkClient ) ;
477
+
478
+ expect ( submitReceipt . status ) . to . deep . equal ( Status . Success ) ;
479
+
480
+ // disable portForward
481
+ portForward . close ( ) ;
482
+ } catch ( error ) {
483
+ testLogger . showUserError ( error ) ;
484
+ }
485
+ } ) . timeout ( Duration . ofMinutes ( 2 ) . toMillis ( ) ) ;
486
+
448
487
// hitchhiker account test to test node freeze and restart
449
488
it ( 'Freeze and restart all nodes should succeed' , async ( ) => {
450
489
try {
0 commit comments