(command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:TEST_NO_CREATE_REPO) op:Equal rhs:{(NoThanks)})] ) (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:RETRY_TIMEOUT) op:Equal rhs:{(60)})] ) (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:P4D_TIMEOUT) op:Equal rhs:{(300)})] ) (C {(.)} {(./test-lib.sh)}) (command.If arms: [ (if_arm cond: [(command.Pipeline children:[(C {(test_have_prereq)} {(PYTHON)})] negated:T)] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:skip_all) op: Equal rhs: {(SQ <'skipping git p4 tests; python not available'>)} ) ] ) (C {(test_done)}) ] ) ] ) (command.AndOr ops: [Op_DPipe] children: [ (command.Subshell command_list: (command.CommandList children: [ (command.AndOr ops: [Op_DAmp] children: [(C {(p4)} {(-h)}) (C {(p4d)} {(-h)})] ) ] ) redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(/dev/null)}) (redir.Redir op:<Redir_GreatAnd '2>&'> fd:2 arg_word:{(1)}) ] ) (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:skip_all) op: Equal rhs: {(SQ <'skipping git p4 tests; no p4 or p4d'>)} ) ] ) (C {(test_done)}) ] ) ] ) (command.FuncDef name: native_path body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DAmp Op_DAmp] children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:path) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} ) ] ) (command.If arms: [ (if_arm cond: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(test_have_prereq)} {(CYGWIN)}) (command.Pipeline children: [(C {(p4)} {(-V)}) (C {(grep)} {(-q)} {(CYGWIN)})] negated: T ) ] ) ] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:path) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(cygpath)} {(--windows)} {(DQ ($ VSub_DollarName '$path'))}) ] ) left_token: <Left_CommandSub '$('> ) } ) ] ) ] ) ] else_action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:path) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(test-path-utils)} {(real_path)} {(DQ ($ VSub_DollarName '$path'))} ) ] ) left_token: <Left_CommandSub '$('> ) } ) ] ) ] ) (C {(echo)} {(DQ ($ VSub_DollarName '$path'))}) ] ) ] ) ) (command.FuncDef name: time_in_seconds body: (command.BraceGroup children: [ (command.Subshell command_list: (command.CommandList children: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(cd)} {(/)}) (C {(DQ ($ VSub_DollarName '$PYTHON_PATH'))} {(-c)} {(SQ <'import time; print(int(time.time()))'>)} ) ] ) ] ) ) ] ) ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:testid) op: Equal rhs: { (word_part.BracedVarSub token: <VSub_Name this_test> suffix_op: (suffix_op.StringUnary op_id:VOp1_Pound arg_word:{(t)}) ) } ) ] ) (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:git_p4_test_start) op:Equal rhs:{(9800)})] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:P4DPORT) op: Equal rhs: { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Plus left: (arith_expr.ArithWord w:{(Lit_Digits 10669)}) right: (arith_expr.ArithBinary op_id: Arith_Minus left: (arith_expr.ArithWord w:{($ VSub_DollarName '$testid')}) right: (arith_expr.ArithWord w:{($ VSub_DollarName '$git_p4_test_start')}) ) ) ) } ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:P4PORT) op: Equal rhs: {(localhost) (Lit_Other ':') ($ VSub_DollarName '$P4DPORT')} ) ] ) (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:P4CLIENT) op:Equal rhs:{(client)})] ) (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:P4USER) op:Equal rhs:{(author)})] ) (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:P4EDITOR) op:Equal rhs:{(true)})] ) (C {(unset)} {(P4CHARSET)}) (C {(export)} {(P4PORT)} {(P4CLIENT)} {(P4USER)} {(P4EDITOR)} {(P4CHARSET)}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:db) op: Equal rhs: {(DQ ($ VSub_DollarName '$TRASH_DIRECTORY') (/db))} ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:cli) op: Equal rhs: {(DQ ($ VSub_DollarName '$TRASH_DIRECTORY') (/cli))} ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:git) op: Equal rhs: {(DQ ($ VSub_DollarName '$TRASH_DIRECTORY') (/git))} ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:pidfile) op: Equal rhs: {(DQ ($ VSub_DollarName '$TRASH_DIRECTORY') (/p4d.pid))} ) ] ) (command.FuncDef name: cleanup body: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [(C {(test)} {(-f)} {(DQ ($ VSub_DollarName '$pidfile'))})] action: [ (command.AndOr ops: [Op_DAmp] children: [ (command.SimpleCommand words: [ {(kill)} {(-9)} { (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(cat)} {(DQ ($ VSub_DollarName '$pidfile'))})] ) left_token: <Left_CommandSub '$('> ) } ] redirects: [(redir.Redir op:<Redir_Great '2>'> fd:2 arg_word:{(/dev/null)})] ) (command.ControlFlow token: <ControlFlow_Exit exit> arg_word: {(255)} ) ] ) ] ) ] ) ] ) ) (C {(trap)} {(cleanup)} {(EXIT)}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:TMPDIR) op: Equal rhs: {(DQ ($ VSub_DollarName '$TRASH_DIRECTORY'))} ) ] ) (C {(export)} {(TMPDIR)}) (command.FuncDef name: start_p4d body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DAmp Op_DAmp Op_DAmp] children: [ (C {(mkdir)} {(-p)} {(DQ ($ VSub_DollarName '$db'))} {(DQ ($ VSub_DollarName '$cli'))} {(DQ ($ VSub_DollarName '$git'))} ) (C {(rm)} {(-f)} {(DQ ($ VSub_DollarName '$pidfile'))}) (command.Subshell command_list: (command.CommandList children: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(cd)} {(DQ ($ VSub_DollarName '$db'))}) (command.BraceGroup children: [ (command.Sentence child: (C {(p4d)} {(-q)} {(-p)} {($ VSub_DollarName '$P4DPORT')} {(DQ ($ VSub_At '$@'))} ) terminator: <Op_Amp '&'> ) (command.SimpleCommand words: [{(echo)} {($ VSub_Bang '$!')}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(DQ ($ VSub_DollarName '$pidfile'))} ) ] ) ] ) ] ) ] ) ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:i) op: Equal rhs: { (word_part.BracedVarSub token: <VSub_Name P4D_START_PATIENCE> suffix_op: (suffix_op.StringUnary op_id:VTest_ColonHyphen arg_word:{(300)}) ) } ) ] ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:pid) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(cat)} {(DQ ($ VSub_DollarName '$pidfile'))})] ) left_token: <Left_CommandSub '$('> ) } ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:timeout) op: Equal rhs: { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Plus left: (arith_expr.ArithWord w: { (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(time_in_seconds)})] ) left_token: <Left_CommandSub '$('> ) } ) right: (arith_expr.ArithWord w:{($ VSub_DollarName '$P4D_TIMEOUT')}) ) ) } ) ] ) (command.Sentence child: (command.WhileUntil keyword: <KW_While while> cond: [(C {(true)})] body: (command.DoGroup children: [ (command.If arms: [ (if_arm cond: [ (C {(test)} { (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(time_in_seconds)})] ) left_token: <Left_CommandSub '$('> ) } {(-gt)} {($ VSub_DollarName '$timeout')} ) ] action: [ (C {(kill)} {(-9)} {($ VSub_DollarName '$pid')}) (command.ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) ] ) ] ) (C {(sleep)} {(1)}) ] ) ) terminator: <Op_Amp '&'> ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:watchdog_pid) op: Equal rhs: {($ VSub_Bang '$!')} ) ] ) (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:ready) op:Equal rhs:(word.EmptyWord))] ) (command.WhileUntil keyword: <KW_While while> cond: [(C {(test)} {($ VSub_DollarName '$i')} {(-gt)} {(0)})] body: (command.DoGroup children: [ (command.If arms: [ (if_arm cond: [ (command.SimpleCommand words: [{(p4)} {(info)}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(/dev/null)} ) (redir.Redir op: <Redir_GreatAnd '2>&'> fd: 2 arg_word: {(1)} ) ] ) ] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:ready) op: Equal rhs: {(true)} ) ] ) (command.ControlFlow token: <ControlFlow_Break break> ) ] ) ] ) (command.AndOr ops: [Op_DPipe] children: [ (command.SimpleCommand words: [{(kill)} {(-0)} {($ VSub_DollarName '$pid')}] redirects: [(redir.Redir op:<Redir_Great '2>'> fd:2 arg_word:{(/dev/null)})] ) (command.ControlFlow token:<ControlFlow_Break break>) ] ) (C {(echo)} {(waiting)} {(KW_For for)} {(p4d)} {(to)} {(start)}) (C {(sleep)} {(1)}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:i) op: Equal rhs: { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Minus left: (arith_expr.ArithWord w:{($ VSub_DollarName '$i')}) right: (arith_expr.ArithWord w:{(Lit_Digits 1)}) ) ) } ) ] ) ] ) ) (command.If arms: [ (if_arm cond: [(C {(test)} {(-z)} {(DQ ($ VSub_DollarName '$ready'))})] action: [(command.ControlFlow token:<ControlFlow_Return return> arg_word:{(1)})] ) ] ) (C {(p4_add_user)} {(author)}) (command.AndOr ops: [Op_DAmp] children: [ (C {(client_view)} {(DQ ('//depot/... //client/...'))}) (command.ControlFlow token:<ControlFlow_Return return> arg_word:{(0)}) ] ) ] ) ) (command.FuncDef name: p4_add_user body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DAmp] children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:name) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) (command.SimpleCommand words: [{(p4)} {(user)} {(-f)} {(-i)}] redirects: [ (redir.HereDoc op: <Redir_DLessDash '<<-'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 811 stdin_parts: [ ('User: ') ($ VSub_DollarName '$name') ('\n') ('Email: ') ($ VSub_DollarName '$name') ('@example.com\n') ('FullName: Dr. ') ($ VSub_DollarName '$name') ('\n') ] ) ] ) ] ) ] ) ) (command.FuncDef name: p4_add_job body: (command.BraceGroup children: [ (command.SimpleCommand words: [{(p4)} {(job)} {(-f)} {(-i)}] redirects: [ (redir.HereDoc op: <Redir_DLessDash '<<-'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 841 stdin_parts: [ ('Job: ') ($ VSub_Number '$1') ('\n') ('Status: open\n') ('User: dummy\n') ('Description:\n') ] ) ] ) ] ) ) (command.FuncDef name: retry_until_success body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:timeout) op: Equal rhs: { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Plus left: (arith_expr.ArithWord w: { (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(time_in_seconds)})] ) left_token: <Left_CommandSub '$('> ) } ) right: (arith_expr.ArithWord w:{($ VSub_DollarName '$RETRY_TIMEOUT')}) ) ) } ) ] ) (command.WhileUntil keyword: <KW_Until until> cond: [ (command.AndOr ops: [Op_DPipe] children: [ (command.SimpleCommand words: [{(DQ ($ VSub_At '$@'))}] redirects: [(redir.Redir op:<Redir_Great '2>'> fd:2 arg_word:{(/dev/null)})] ) (C {(test)} { (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(time_in_seconds)})]) left_token: <Left_CommandSub '$('> ) } {(-gt)} {($ VSub_DollarName '$timeout')} ) ] ) ] body: (command.DoGroup children:[(C {(sleep)} {(1)})]) ) ] ) ) (command.FuncDef name: retry_until_fail body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:timeout) op: Equal rhs: { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Plus left: (arith_expr.ArithWord w: { (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(time_in_seconds)})] ) left_token: <Left_CommandSub '$('> ) } ) right: (arith_expr.ArithWord w:{($ VSub_DollarName '$RETRY_TIMEOUT')}) ) ) } ) ] ) (command.WhileUntil keyword: <KW_Until until> cond: [ (command.AndOr ops: [Op_DPipe] children: [ (command.Pipeline children: [ (command.SimpleCommand words: [{(DQ ($ VSub_At '$@'))}] redirects: [(redir.Redir op:<Redir_Great '2>'> fd:2 arg_word:{(/dev/null)})] ) ] negated: T ) (C {(test)} { (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(time_in_seconds)})]) left_token: <Left_CommandSub '$('> ) } {(-gt)} {($ VSub_DollarName '$timeout')} ) ] ) ] body: (command.DoGroup children:[(C {(sleep)} {(1)})]) ) ] ) ) (command.FuncDef name: kill_p4d body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:pid) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(cat)} {(DQ ($ VSub_DollarName '$pidfile'))})] ) left_token: <Left_CommandSub '$('> ) } ) ] ) (C {(retry_until_fail)} {(kill)} {($ VSub_DollarName '$pid')}) (C {(retry_until_fail)} {(kill)} {(-9)} {($ VSub_DollarName '$pid')}) (command.AndOr ops: [Op_DAmp Op_DAmp] children: [ (command.SimpleCommand words: [{(test_must_fail)} {(kill)} {($ VSub_DollarName '$pid')}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(/dev/null)} ) (redir.Redir op:<Redir_GreatAnd '2>&'> fd:2 arg_word:{(1)}) ] ) (C {(rm)} {(-rf)} {(DQ ($ VSub_DollarName '$db'))} {(DQ ($ VSub_DollarName '$cli'))} {(DQ ($ VSub_DollarName '$pidfile'))} ) (C {(retry_until_fail)} {(kill)} {(-9)} {($ VSub_DollarName '$watchdog_pid')}) ] ) ] ) ) (command.FuncDef name: cleanup_git body: (command.BraceGroup children: [ (C {(retry_until_success)} {(rm)} {(-r)} {(DQ ($ VSub_DollarName '$git'))}) (command.AndOr ops: [Op_DAmp] children: [ (C {(test_must_fail)} {(test)} {(-d)} {(DQ ($ VSub_DollarName '$git'))}) (C {(retry_until_success)} {(mkdir)} {(DQ ($ VSub_DollarName '$git'))}) ] ) ] ) ) (command.FuncDef name: marshal_dump body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DAmp Op_DAmp Op_DAmp] children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:what) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:line) op: Equal rhs: { (word_part.BracedVarSub token: <VSub_Number 2> suffix_op: (suffix_op.StringUnary op_id:VTest_ColonHyphen arg_word:{(1)}) ) } ) ] ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(DQ ($ VSub_DollarName '$TRASH_DIRECTORY') (/marshal-dump.py))} ) (redir.HereDoc op: <Redir_DLessDash '<<-'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 1133 stdin_parts: [ ('import marshal\n') ('import sys\n') ("instream = getattr(sys.stdin, 'buffer', sys.stdin)\n") ('for i in range(') ($ VSub_DollarName '$line') ('):\n') (' d = marshal.load(instream)\n') ("print(d[b'") ($ VSub_DollarName '$what') ("'].decode('utf-8'))\n") ] ) ] ) (C {(DQ ($ VSub_DollarName '$PYTHON_PATH'))} {(DQ ($ VSub_DollarName '$TRASH_DIRECTORY') (/marshal-dump.py))} ) ] ) ] ) ) (command.FuncDef name: client_view body: (command.BraceGroup children: [ (command.Pipeline children: [ (command.Subshell command_list: (command.CommandList children: [ (command.AndOr ops: [Op_DAmp] children: [ (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.HereDoc op: <Redir_DLessDash '<<-'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 1195 stdin_parts: [ ('Client: ') ($ VSub_DollarName '$P4CLIENT') ('\n') ('Description: ') ($ VSub_DollarName '$P4CLIENT') ('\n') ('Root: ') ($ VSub_DollarName '$cli') ('\n') ('AltRoots: ') (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(native_path)} {(DQ ($ VSub_DollarName '$cli'))}) ] ) left_token: <Left_CommandSub '$('> ) ('\n') ('LineEnd: unix\n') ('View:\n') ] ) ] ) (C {(printf)} {(DQ (Lit_Other '\\') ('t%s') (Lit_Other '\\') (n))} {(DQ ($ VSub_At '$@'))} ) ] ) ] ) ) (C {(p4)} {(client)} {(-i)}) ] negated: F ) ] ) ) (command.FuncDef name: is_cli_file_writeable body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DAmp] children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:file) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} ) ] ) (command.If arms: [ (if_arm cond: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(test_have_prereq)} {(CYGWIN)}) (command.Pipeline children: [(C {(p4)} {(-V)}) (C {(grep)} {(-q)} {(CYGWIN)})] negated: F ) ] ) ] action: [ (command.AndOr ops: [Op_DAmp] children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:stat) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(stat)} {(--format) (Lit_Other '=') (Lit_Other '%') (a)} {(DQ ($ VSub_DollarName '$file'))} ) ] ) left_token: <Left_CommandSub '$('> ) } ) ] ) (C {(test)} {($ VSub_DollarName '$stat')} {(Lit_Other '=')} {(644)}) ] ) ] ) ] else_action: [(C {(test)} {(-w)} {(DQ ($ VSub_DollarName '$file'))})] ) ] ) ] ) ) ] )