(CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:efivarfs_mount) op: Equal rhs: {(/sys/firmware/efi/efivars)} spids: [4] ) ] spids: [4] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_guid) op: Equal rhs: {(210be57c-9849-4fc7-a635-e6382d1aec27)} spids: [7] ) ] spids: [7] ) (FuncDef name: check_prereqs body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:msg) op: Equal rhs: {(DQ ("skip all tests:"))} spids: [20] ) ] spids: [18] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {($ VSub_Name "$UID")} {(KW_Bang "!") (Lit_Other "=")} {(0)} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [{(echo)} {($ VSub_Name "$msg")} {(must)} {(be)} {(run)} {(as)} {(root)}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[58])] ) (C {(exit)} {(0)}) ] spids: [-1 41] ) ] spids: [-1 67] ) (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children: [ (C {(grep)} {(-q)} { (DQ ("^") (EscapedLiteralPart token:<Lit_EscapedChar "\\S">) (EscapedLiteralPart token: <Lit_EscapedChar "\\+"> ) (" ") ($ VSub_Name "$efivarfs_mount") (" efivarfs") ) } {(/proc/mounts)} ) ] negated: True ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [ {(echo)} {($ VSub_Name "$msg")} {(efivarfs)} {(is)} {(not)} {(mounted)} {(on)} {($ VSub_Name "$efivarfs_mount")} ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[110])] ) (C {(exit)} {(0)}) ] spids: [-1 91] ) ] spids: [-1 119] ) ] spids: [15] ) spids: [11 14] ) (FuncDef name: run_test body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:test) op: Equal rhs: {(DQ ($ VSub_Number "$1"))} spids: [133] ) ] spids: [131] ) (C {(echo)} {(DQ (--------------------))}) (C {(echo)} {(DQ ("running ") ($ VSub_Name "$test"))}) (C {(echo)} {(DQ (--------------------))}) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} { (DQ (CommandSubPart command_list: (CommandList children: [(C {(type)} {(-t)} {($ VSub_Name "$test")})] ) left_token: <Left_CommandSub "$("> spids: [168 174] ) ) } {(Lit_Other "=")} {(SQ <function>)} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [(Subshell child:(C {($ VSub_Name "$test")}) spids:[189193])] spids: [-1 186] ) ] else_action: [(Subshell child:(C {(./) ($ VSub_Name "$test")}) spids:[199204])] spids: [196 207] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {($ VSub_QMark "$?")} {(-ne)} {(0)} {(Lit_Other "]")}) terminator: <Op_Semi ";"> ) ] action: [ (C {(echo)} {(DQ (" [FAIL]"))}) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:rc) op:Equal rhs:{(1)} spids:[234])] spids: [234] ) ] spids: [-1 224] ) ] else_action: [(C {(echo)} {(DQ (" [PASS]"))})] spids: [238 248] ) ] spids: [128] ) spids: [124 127] ) (FuncDef name: test_create body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:attrs) op: Equal rhs: {(SQ <"\\x07\\x00\\x00\\x00">)} spids: [262] ) ] spids: [260] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:file) op: Equal rhs: {($ VSub_Name "$efivarfs_mount") (/) ($ VSub_Name "$FUNCNAME") (-) ($ VSub_Name "$test_guid") } spids: [270] ) ] spids: [268] ) (SimpleCommand words: [ {(printf)} {(DQ ($ VSub_Name "$attrs") (EscapedLiteralPart token:<Lit_EscapedChar "\\x">) (00))} ] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {($ VSub_Name "$file")} spids: [287] ) ] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(KW_Bang "!")} {(-e)} {($ VSub_Name "$file")} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [{(echo)} {(DQ ($ VSub_Name "$file") (" couldn't be created"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[316])] ) (C {(exit)} {(1)}) ] spids: [-1 306] ) ] spids: [-1 325] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} { (CommandSubPart command_list: (CommandList children: [ (C {(stat)} {(-c)} {(Lit_Other "%") (s)} {($ VSub_Name "$file")}) ] ) left_token: <Left_CommandSub "$("> spids: [333 342] ) } {(-ne)} {(5)} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [{(echo)} {(DQ ($ VSub_Name "$file") (" has invalid size"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[361])] ) (C {(exit)} {(1)}) ] spids: [-1 351] ) ] spids: [-1 370] ) ] spids: [257] ) spids: [253 256] ) (FuncDef name: test_create_empty body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:file) op: Equal rhs: {($ VSub_Name "$efivarfs_mount") (/) ($ VSub_Name "$FUNCNAME") (-) ($ VSub_Name "$test_guid") } spids: [384] ) ] spids: [382] ) (SimpleCommand words: [{(Lit_Other ":")}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {($ VSub_Name "$file")} spids: [395] ) ] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(KW_Bang "!")} {(-e)} {($ VSub_Name "$file")} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [ {(echo)} {(DQ ($ VSub_Name "$file") (" can not be created without writing"))} ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[424])] ) (C {(exit)} {(1)}) ] spids: [-1 414] ) ] spids: [-1 433] ) ] spids: [379] ) spids: [375 378] ) (FuncDef name: test_create_read body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:file) op: Equal rhs: {($ VSub_Name "$efivarfs_mount") (/) ($ VSub_Name "$FUNCNAME") (-) ($ VSub_Name "$test_guid") } spids: [447] ) ] spids: [445] ) (C {(./create-read)} {($ VSub_Name "$file")}) ] spids: [442] ) spids: [438 441] ) (FuncDef name: test_delete body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:attrs) op: Equal rhs: {(SQ <"\\x07\\x00\\x00\\x00">)} spids: [471] ) ] spids: [469] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:file) op: Equal rhs: {($ VSub_Name "$efivarfs_mount") (/) ($ VSub_Name "$FUNCNAME") (-) ($ VSub_Name "$test_guid") } spids: [479] ) ] spids: [477] ) (SimpleCommand words: [ {(printf)} {(DQ ($ VSub_Name "$attrs") (EscapedLiteralPart token:<Lit_EscapedChar "\\x">) (00))} ] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {($ VSub_Name "$file")} spids: [496] ) ] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(KW_Bang "!")} {(-e)} {($ VSub_Name "$file")} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [{(echo)} {(DQ ($ VSub_Name "$file") (" couldn't be created"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[525])] ) (C {(exit)} {(1)}) ] spids: [-1 515] ) ] spids: [-1 534] ) (SimpleCommand words: [{(rm)} {($ VSub_Name "$file")}] redirects: [(Redir op_id:Redir_Great fd:2 arg_word:{(/dev/null)} spids:[542])] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {($ VSub_QMark "$?")} {(-ne)} {(0)} {(Lit_Other "]")}) terminator: <Op_Semi ";"> ) ] action: [ (C {(chattr)} {(-i)} {($ VSub_Name "$file")}) (C {(rm)} {($ VSub_Name "$file")}) ] spids: [-1 559] ) ] spids: [-1 574] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-e)} {($ VSub_Name "$file")} {(Lit_Other "]")}) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [{(echo)} {(DQ ($ VSub_Name "$file") (" couldn't be deleted"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[599])] ) (C {(exit)} {(1)}) ] spids: [-1 589] ) ] spids: [-1 608] ) ] spids: [466] ) spids: [462 465] ) (FuncDef name: test_zero_size_delete body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:attrs) op: Equal rhs: {(SQ <"\\x07\\x00\\x00\\x00">)} spids: [629] ) ] spids: [627] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:file) op: Equal rhs: {($ VSub_Name "$efivarfs_mount") (/) ($ VSub_Name "$FUNCNAME") (-) ($ VSub_Name "$test_guid") } spids: [637] ) ] spids: [635] ) (SimpleCommand words: [ {(printf)} {(DQ ($ VSub_Name "$attrs") (EscapedLiteralPart token:<Lit_EscapedChar "\\x">) (00))} ] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {($ VSub_Name "$file")} spids: [654] ) ] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(KW_Bang "!")} {(-e)} {($ VSub_Name "$file")} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [{(echo)} {(DQ ($ VSub_Name "$file") (" does not exist"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[683])] ) (C {(exit)} {(1)}) ] spids: [-1 673] ) ] spids: [-1 692] ) (C {(chattr)} {(-i)} {($ VSub_Name "$file")}) (SimpleCommand words: [{(printf)} {(DQ ($ VSub_Name "$attrs"))}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {($ VSub_Name "$file")} spids: [709] ) ] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-e)} {($ VSub_Name "$file")} {(Lit_Other "]")}) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [{(echo)} {(DQ ($ VSub_Name "$file") (" should have been deleted"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[736])] ) (C {(exit)} {(1)}) ] spids: [-1 726] ) ] spids: [-1 745] ) ] spids: [624] ) spids: [620 623] ) (FuncDef name: test_open_unlink body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:file) op: Equal rhs: {($ VSub_Name "$efivarfs_mount") (/) ($ VSub_Name "$FUNCNAME") (-) ($ VSub_Name "$test_guid") } spids: [759] ) ] spids: [757] ) (C {(./open-unlink)} {($ VSub_Name "$file")}) ] spids: [754] ) spids: [750 753] ) (FuncDef name: test_valid_filenames body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:attrs) op: Equal rhs: {(SQ <"\\x07\\x00\\x00\\x00">)} spids: [786] ) ] spids: [784] ) (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:ret) op:Equal rhs:{(0)} spids:[794])] spids: [792] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:file_list) op: Equal rhs: {(DQ ("abc dump-type0-11-1-1362436005 1234 -"))} spids: [801] ) ] spids: [799] ) (ForEach iter_name: f iter_words: [{($ VSub_Name "$file_list")}] do_arg_iter: False body: (DoGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:file) op: Equal rhs: {($ VSub_Name "$efivarfs_mount") (/) ($ VSub_Name "$f") (-) ($ VSub_Name "$test_guid") } spids: [821] ) ] spids: [819] ) (SimpleCommand words: [ {(printf)} { (DQ ($ VSub_Name "$attrs") (EscapedLiteralPart token:<Lit_EscapedChar "\\x">) (00) ) } ] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {($ VSub_Name "$file")} spids: [838] ) ] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(KW_Bang "!")} {(-e)} {($ VSub_Name "$file")} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [{(echo)} {(DQ ($ VSub_Name "$file") (" could not be created"))}] redirects: [ (Redir op_id: Redir_GreatAnd fd: -1 arg_word: {(2)} spids: [867] ) ] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ret) op: Equal rhs: {(1)} spids: [871] ) ] spids: [871] ) ] spids: [-1 857] ) ] else_action: [ (SimpleCommand words: [{(rm)} {($ VSub_Name "$file")}] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [882] ) ] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {($ VSub_QMark "$?")} {(-ne)} {(0)} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (C {(chattr)} {(-i)} {($ VSub_Name "$file")}) (C {(rm)} {($ VSub_Name "$file")}) ] spids: [-1 899] ) ] spids: [-1 914] ) ] spids: [875 917] ) ] spids: [816 920] ) spids: [812 814] ) (C {(exit)} {($ VSub_Name "$ret")}) ] spids: [781] ) spids: [777 780] ) (FuncDef name: test_invalid_filenames body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:attrs) op: Equal rhs: {(SQ <"\\x07\\x00\\x00\\x00">)} spids: [940] ) ] spids: [938] ) (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:ret) op:Equal rhs:{(0)} spids:[948])] spids: [946] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:file_list) op: Equal rhs: { (DQ ("\n") ("\t\t-1234-1234-1234-123456789abc\n") ("\t\tfoo\n") ("\t\tfoo-bar\n") ("\t\t-foo-\n") ("\t\tfoo-barbazba-foob-foob-foob-foobarbazfoo\n") ("\t\tfoo-------------------------------------\n") ("\t\t-12345678-1234-1234-1234-123456789abc\n") ("\t\ta-12345678=1234-1234-1234-123456789abc\n") ("\t\ta-12345678-1234=1234-1234-123456789abc\n") ("\t\ta-12345678-1234-1234=1234-123456789abc\n") ("\t\ta-12345678-1234-1234-1234=123456789abc\n") ("\t\t1112345678-1234-1234-1234-123456789abc") ) } spids: [955] ) ] spids: [953] ) (ForEach iter_name: f iter_words: [{($ VSub_Name "$file_list")}] do_arg_iter: False body: (DoGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:file) op: Equal rhs: {($ VSub_Name "$efivarfs_mount") (/) ($ VSub_Name "$f")} spids: [988] ) ] spids: [986] ) (SimpleCommand words: [ {(printf)} { (DQ ($ VSub_Name "$attrs") (EscapedLiteralPart token:<Lit_EscapedChar "\\x">) (00) ) } ] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [1003] ) (Redir op_id: Redir_Great fd: -1 arg_word: {($ VSub_Name "$file")} spids: [1006] ) ] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-e)} {($ VSub_Name "$file")} {(Lit_Other "]")}) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [ {(echo)} {(DQ ("Creating ") ($ VSub_Name "$file") (" should have failed"))} ] redirects: [ (Redir op_id: Redir_GreatAnd fd: -1 arg_word: {(2)} spids: [1034] ) ] ) (SimpleCommand words: [{(rm)} {($ VSub_Name "$file")}] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [1042] ) ] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {($ VSub_QMark "$?")} {(-ne)} {(0)} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (C {(chattr)} {(-i)} {($ VSub_Name "$file")}) (C {(rm)} {($ VSub_Name "$file")}) ] spids: [-1 1059] ) ] spids: [-1 1074] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ret) op: Equal rhs: {(1)} spids: [1077] ) ] spids: [1077] ) ] spids: [-1 1023] ) ] spids: [-1 1081] ) ] spids: [983 1084] ) spids: [979 981] ) (C {(exit)} {($ VSub_Name "$ret")}) ] spids: [935] ) spids: [931 934] ) (C {(check_prereqs)}) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:rc) op:Equal rhs:{(0)} spids:[1098])] spids: [1098] ) (C {(run_test)} {(test_create)}) (C {(run_test)} {(test_create_empty)}) (C {(run_test)} {(test_create_read)}) (C {(run_test)} {(test_delete)}) (C {(run_test)} {(test_zero_size_delete)}) (C {(run_test)} {(test_open_unlink)}) (C {(run_test)} {(test_valid_filenames)}) (C {(run_test)} {(test_invalid_filenames)}) (C {(exit)} {($ VSub_Name "$rc")}) ] )