@@ -383,7 +383,7 @@ func TestRunCommand(t *testing.T) {
383383
384384 t .Run ("Run works" , func (t * testing.T ) {
385385 expected := "command-1"
386- actual , err := m .RunCommand (targets , "ls -la" )
386+ actual , err := m .RunCommand (targets , "AWS-RunShellScript" , map [ string ] string { "commands" : " ls -la"} )
387387 assert .Nil (t , err )
388388 assert .NotNil (t , actual )
389389 assert .Equal (t , expected , actual )
@@ -395,17 +395,13 @@ func TestRunCommand(t *testing.T) {
395395 ssmMock .Error = false
396396 }()
397397
398- actual , err := m .RunCommand (targets , "ls -la" )
398+ actual , err := m .RunCommand (targets , "AWS-RunShellScript" , map [ string ] string { "commands" : " ls -la"} )
399399 assert .NotNil (t , err )
400400 assert .EqualError (t , err , "expected" )
401401 assert .Equal (t , "" , actual )
402402 })
403403}
404404
405- /*
406- func TestRunDocumentCommand(t *testing.T) {
407- }*/
408-
409405func TestAbortCommand (t * testing.T ) {
410406 ssmMock := & manager.MockSSM {
411407 Error : false ,
@@ -433,14 +429,14 @@ func TestAbortCommand(t *testing.T) {
433429 }
434430
435431 t .Run ("Abort works" , func (t * testing.T ) {
436- id , err := m .RunCommand (targets , "ls -la" )
432+ id , err := m .RunCommand (targets , "AWS-RunShellScript" , map [ string ] string { "commands" : " ls -la"} )
437433 assert .Nil (t , err )
438434 err = m .AbortCommand (targets , id )
439435 assert .Nil (t , err )
440436 })
441437
442438 t .Run ("Invalid command id errors are propagated" , func (t * testing.T ) {
443- _ , err := m .RunCommand (targets , "ls -la" )
439+ _ , err := m .RunCommand (targets , "AWS-RunShellScript" , map [ string ] string { "commands" : " ls -la"} )
444440 assert .Nil (t , err )
445441 err = m .AbortCommand (targets , "invalid" )
446442 assert .NotNil (t , err )
@@ -486,7 +482,7 @@ func TestOutput(t *testing.T) {
486482 }
487483
488484 t .Run ("Get output works with standard out" , func (t * testing.T ) {
489- id , err := m .RunCommand (targets , "ls -la" )
485+ id , err := m .RunCommand (targets , "AWS-RunShellScript" , map [ string ] string { "commands" : " ls -la"} )
490486 assert .Nil (t , err )
491487
492488 ctx := context .Background ()
@@ -510,7 +506,7 @@ func TestOutput(t *testing.T) {
510506 ssmMock .CommandStatus = "Success"
511507 }()
512508
513- id , err := m .RunCommand (targets , "ls -la" )
509+ id , err := m .RunCommand (targets , "AWS-RunShellScript" , map [ string ] string { "commands" : " ls -la"} )
514510 assert .Nil (t , err )
515511
516512 ctx := context .Background ()
@@ -525,7 +521,7 @@ func TestOutput(t *testing.T) {
525521 })
526522
527523 t .Run ("Get output is aborted if the context is done" , func (t * testing.T ) {
528- id , err := m .RunCommand (targets , "ls -la" )
524+ id , err := m .RunCommand (targets , "AWS-RunShellScript" , map [ string ] string { "commands" : " ls -la"} )
529525 assert .Nil (t , err )
530526
531527 ctx , cancel := context .WithCancel (context .Background ())
0 commit comments