(CommandList
  children: [
    (FuncDef
      name: echoOK
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [(assign_pair lhs:(LhsName name:TC) op:Equal rhs:{(SQ <'\\e['>)} spids:[51])]
              spids: [51]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:RegB)
                  op: Equal
                  rhs: {(DQ (${ VSub_Name TC) (0m))}
                  spids: [57]
                )
              ]
              spids: [57]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (C {(Lit_Other '[')} {(DQ ($ VSub_Number '$1'))} {(-eq)} {(DQ (0))} 
                          {(Lit_Other ']')}
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:Green)
                          op: Equal
                          rhs: {(DQ (${ VSub_Name TC) (32m))}
                          spids: [86]
                        )
                      ]
                      spids: [86]
                    )
                    (C {(echo)} {(-e)} {(DQ ('[') (${ VSub_Name Green) (OK) (${ VSub_Name RegB) (']'))})
                  ]
                  spids: [16777215 83]
                )
              ]
              else_action: [
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:Red)
                      op: Equal
                      rhs: {(DQ (${ VSub_Name TC) (31m))}
                      spids: [115]
                    )
                  ]
                  spids: [115]
                )
                (C {(echo)} {(-e)} {(DQ ('[') (${ VSub_Name Red) (FAIL) (${ VSub_Name RegB) (']'))})
                (C {(echo)} {(DQ ('Check log file.'))})
                (C {(exit)} {(1)})
              ]
              spids: [112 153]
            )
          ]
          spids: [48]
        )
      spids: [44 47]
    )
    (FuncDef
      name: usage
      body: 
        (BraceGroup
          children: [(C {(echo)} {(DQ ('Usage options: [--logfile <path to file>]'))})]
          spids: [162]
        )
      spids: [158 161]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:logfile) op:Equal rhs:{(/dev/null)} spids:[174])]
      spids: [174]
    )
    (While
      cond: [
        (Sentence
          child: (DBracket expr:(BoolBinary op_id:Redir_Great left:{($ VSub_Pound '$#')} right:{(0)}))
          terminator: <Op_Semi ';'>
        )
      ]
      body: 
        (DoGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:key)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number '$1'))}
                  spids: [193]
                )
              ]
              spids: [193]
            )
            (C {(shift)})
            (Case
              to_match: {($ VSub_Name '$key')}
              arms: [
                (case_arm
                  pat_list: [{(-l)} {(--logfile)}]
                  action: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:logfile)
                          op: Equal
                          rhs: {(DQ ($ VSub_Number '$1'))}
                          spids: [215]
                        )
                      ]
                      spids: [215]
                    )
                    (If
                      arms: [
                        (if_arm
                          cond: [
                            (Sentence
                              child: 
                                (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$logfile'))} 
                                  {(Lit_Other '=') (Lit_Other '=')} {(DQ )} {(Lit_Other ']')}
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [(C {(usage)}) (C {(exit)} {(1)})]
                          spids: [16777215 238]
                        )
                      ]
                      spids: [16777215 249]
                    )
                    (C {(shift)})
                  ]
                  spids: [209 212 255 16777215]
                )
                (case_arm
                  pat_list: [{(Lit_Other '*')}]
                  action: [(C {(usage)}) (C {(exit)} {(1)})]
                  spids: [258 259 274 16777215]
                )
              ]
              spids: [202 206 277]
            )
          ]
          spids: [190 279]
        )
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:KUBE_ROOT)
          op: Equal
          rhs: 
            {
              (CommandSubPart
                command_list: 
                  (CommandList
                    children: [(C {(dirname)} {(DQ (${ VSub_Name BASH_SOURCE))})]
                  )
                left_token: <Left_CommandSub '$('>
                spids: [283 291]
              ) (/../..)
            }
          spids: [282]
        )
      ]
      spids: [282]
    )
    (C {(cd)} {(DQ (${ VSub_Name KUBE_ROOT))})
    (C {(echo)} {(All)} {(verbose)} {(output)} {(will)} {(be)} {(redirected)} {(to)} 
      {($ VSub_Name '$logfile') (Lit_Comma ',')} {(use)} {(--logfile)} {(option)} {(to)} {(change.)}
    )
    (C {(printf)} {(DQ ('Start the cluster with 2 nodes .. '))})
    (C {(export)} {(Lit_VarLike 'NUM_NODES=') (2)})
    (C {(export)} {(Lit_VarLike 'KUBERNETES_PROVIDER=') (vagrant)})
    (AndOr
      children: [
        (Subshell
          child: 
            (SimpleCommand
              words: [{(cluster/kube-up.sh)}]
              redirects: [
                (Redir
                  op_id: Redir_DGreat
                  fd: 16777215
                  arg_word: {(DQ ($ VSub_Name '$logfile'))}
                  spids: [353]
                )
                (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[358])
              ]
            )
          spids: [350 360]
        )
        (C {(true)})
      ]
      op_id: Op_DPipe
    )
    (C {(echoOK)} {($ VSub_QMark '$?')})
    (C {(printf)} {(DQ ('Check if node-1 can reach kubernetes master .. '))})
    (SimpleCommand
      words: [{(vagrant)} {(ssh)} {(node-1)} {(--)} {(ping)} {(-c)} {(10)} {(kubernetes-master)}]
      redirects: [
        (Redir
          op_id: Redir_DGreat
          fd: 16777215
          arg_word: {(DQ ($ VSub_Name '$logfile'))}
          spids: [393]
        )
        (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[398])
      ]
    )
    (C {(echoOK)} {($ VSub_QMark '$?')})
    (C {(printf)} {(DQ ('Check if node-2 can reach kubernetes master .. '))})
    (SimpleCommand
      words: [{(vagrant)} {(ssh)} {(node-2)} {(--)} {(ping)} {(-c)} {(10)} {(kubernetes-master)}]
      redirects: [
        (Redir
          op_id: Redir_DGreat
          fd: 16777215
          arg_word: {(DQ ($ VSub_Name '$logfile'))}
          spids: [427]
        )
        (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[432])
      ]
    )
    (C {(echoOK)} {($ VSub_QMark '$?')})
    (C {(printf)} {(DQ ('Pull an image that runs a web server on node-1 .. '))})
    (SimpleCommand
      words: [{(vagrant)} {(ssh)} {(node-1)} {(--)} {(SQ <'sudo docker pull kubernetes/serve_hostname'>)}]
      redirects: [
        (Redir
          op_id: Redir_DGreat
          fd: 16777215
          arg_word: {(DQ ($ VSub_Name '$logfile'))}
          spids: [458]
        )
        (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[463])
      ]
    )
    (C {(echoOK)} {($ VSub_QMark '$?')})
    (C {(printf)} {(DQ ('Pull an image that runs a web server on node-2 .. '))})
    (SimpleCommand
      words: [{(vagrant)} {(ssh)} {(node-2)} {(--)} {(SQ <'sudo docker pull kubernetes/serve_hostname'>)}]
      redirects: [
        (Redir
          op_id: Redir_DGreat
          fd: 16777215
          arg_word: {(DQ ($ VSub_Name '$logfile'))}
          spids: [488]
        )
        (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[493])
      ]
    )
    (C {(echoOK)} {($ VSub_QMark '$?')})
    (C {(printf)} {(DQ ('Run the server on node-1 .. '))})
    (SimpleCommand
      words: [
        {(vagrant)}
        {(ssh)}
        {(node-1)}
        {(--)}
        {(sudo)}
        {(docker)}
        {(run)}
        {(-d)}
        {(kubernetes/serve_hostname)}
      ]
      redirects: [
        (Redir
          op_id: Redir_DGreat
          fd: 16777215
          arg_word: {(DQ ($ VSub_Name '$logfile'))}
          spids: [525]
        )
        (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[530])
      ]
    )
    (C {(echoOK)} {($ VSub_QMark '$?')})
    (C {(printf)} {(DQ ('Run the server on node-2 .. '))})
    (SimpleCommand
      words: [
        {(vagrant)}
        {(ssh)}
        {(node-2)}
        {(--)}
        {(sudo)}
        {(docker)}
        {(run)}
        {(-d)}
        {(kubernetes/serve_hostname)}
      ]
      redirects: [
        (Redir
          op_id: Redir_DGreat
          fd: 16777215
          arg_word: {(DQ ($ VSub_Name '$logfile'))}
          spids: [561]
        )
        (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[566])
      ]
    )
    (C {(echoOK)} {($ VSub_QMark '$?')})
    (C {(printf)} 
      {(DQ ('Run ping from node-1 to docker bridges and to the containers on both nodes .. '))}
    )
    (SimpleCommand
      words: [
        {(vagrant)}
        {(ssh)}
        {(node-1)}
        {(--)}
        {
          (SQ 
            <
'ping -c 20 10.246.0.1 && ping -c 20 10.246.1.1 && ping -c 20 10.246.0.2 && ping -c 20 10.246.1.2'
            >
          )
        }
      ]
      redirects: [
        (Redir
          op_id: Redir_DGreat
          fd: 16777215
          arg_word: {(DQ ($ VSub_Name '$logfile'))}
          spids: [592]
        )
        (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[597])
      ]
    )
    (C {(echoOK)} {($ VSub_QMark '$?')})
    (C {(printf)} {(DQ ('Same pinch from node-2 .. '))})
    (SimpleCommand
      words: [
        {(vagrant)}
        {(ssh)}
        {(node-2)}
        {(--)}
        {
          (SQ 
            <
'ping -c 20 10.246.0.1 && ping -c 20 10.246.1.1 && ping -c 20 10.246.0.2 && ping -c 20 10.246.1.2'
            >
          )
        }
      ]
      redirects: [
        (Redir
          op_id: Redir_DGreat
          fd: 16777215
          arg_word: {(DQ ($ VSub_Name '$logfile'))}
          spids: [622]
        )
        (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[627])
      ]
    )
    (C {(echoOK)} {($ VSub_QMark '$?')})
    (C {(printf)} {(DQ ('tcp check, curl to both the running webservers from node-1 .. '))})
    (SimpleCommand
      words: [
        {(vagrant)}
        {(ssh)}
        {(node-1)}
        {(--)}
        {(SQ <'curl -sS 10.246.0.2:9376  && curl -sS 10.246.1.2:9376'>)}
      ]
      redirects: [
        (Redir
          op_id: Redir_DGreat
          fd: 16777215
          arg_word: {(DQ ($ VSub_Name '$logfile'))}
          spids: [653]
        )
        (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[658])
      ]
    )
    (C {(echoOK)} {($ VSub_QMark '$?')})
    (C {(printf)} {(DQ ('tcp check, curl to both the running webservers from node-2 .. '))})
    (SimpleCommand
      words: [
        {(vagrant)}
        {(ssh)}
        {(node-2)}
        {(--)}
        {(SQ <'curl -sS 10.246.0.2:9376  && curl -sS 10.246.1.2:9376'>)}
      ]
      redirects: [
        (Redir
          op_id: Redir_DGreat
          fd: 16777215
          arg_word: {(DQ ($ VSub_Name '$logfile'))}
          spids: [683]
        )
        (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[688])
      ]
    )
    (C {(echoOK)} {($ VSub_QMark '$?')})
    (C {(printf)} {(DQ ('All good, destroy the cluster .. '))})
    (SimpleCommand
      words: [{(vagrant)} {(destroy)} {(-f)}]
      redirects: [
        (Redir
          op_id: Redir_DGreat
          fd: 16777215
          arg_word: {(DQ ($ VSub_Name '$logfile'))}
          spids: [708]
        )
        (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[713])
      ]
    )
    (C {(echoOK)} {($ VSub_QMark '$?')})
  ]
)