(command.CommandList
  children: [
    (C {<atf_test_case>} {<bad_namespace>})
    (command.ShFunction
      name: bad_namespace_head
      body: 
        (BraceGroup
          children: [
            (C {<atf_set>} {(DQ <descr>)} {(DQ <'Can\'t set attributes for nonexistent namespaces'>)})
          ]
        )
    )
    (command.ShFunction
      name: bad_namespace_body
      body: 
        (BraceGroup
          children: [
            (C {<check_fs>})
            (C {<touch>} {<foo>})
            (C {<atf_check>} {<-s>} {<not-exit> <Id.Lit_Colon ':'> <0>} {<-e>} 
              {<match> <Id.Lit_Colon ':'> (DQ <'Invalid argument'>)} {<setextattr>} {<badnamespace>} {<myattr>} {<X>} {<foo>}
            )
            (C {<atf_check>} {<-s>} {<not-exit> <Id.Lit_Colon ':'> <0>} {<-e>} 
              {<match> <Id.Lit_Colon ':'> (DQ <'Invalid argument'>)} {<lsextattr>} {<-q>} {<badnamespace>} {<foo>}
            )
          ]
        )
    )
    (C {<atf_test_case>} {<hex>})
    (command.ShFunction
      name: hex_head
      body: 
        (BraceGroup
          children: [
            (C {<atf_set>} {(DQ <descr>)} {(DQ <'Set and get attribute values in hexadecimal'>)})
          ]
        )
    )
    (command.ShFunction
      name: hex_body
      body: 
        (BraceGroup
          children: [
            (C {<check_fs>})
            (C {<touch>} {<foo>})
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} {<empty>} 
              {<setextattr>} {<user>} {<myattr>} {<XYZ>} {<foo>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} 
              {<inline> <Id.Lit_Colon ':'> (DQ <'58 59 5a'> <Id.Lit_BadBackslash '\\'> <n>)} {<getextattr>} {<-qx>} {<user>} {<myattr>} {<foo>}
            )
          ]
        )
    )
    (C {<atf_test_case>} {<hex_nonascii>})
    (command.ShFunction
      name: hex_nonascii_head
      body: 
        (BraceGroup
          children: [
            (C {<atf_set>} {(DQ <descr>)} {(DQ <'Get binary attribute values in hexadecimal'>)})
          ]
        )
    )
    (command.ShFunction
      name: hex_nonascii_body
      body: 
        (BraceGroup
          children: [
            (C {<check_fs>})
            (C {<touch>} {<foo>})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:BINSTUFF)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_Backtick '`'>
                        child: 
                          (C {<echo>} 
                            {
                              (single_quoted
                                left: <Id.Left_DollarSingleQuote '$\''>
                                tokens: [
                                  <Id.Char_Hex '\\x20'>
                                  <Id.Char_Hex '\\x30'>
                                  <Id.Char_Hex '\\x40'>
                                  <Id.Char_Hex '\\x55'>
                                  <Id.Char_Hex '\\x66'>
                                  <Id.Char_Hex '\\x70'>
                                  <Id.Char_Hex '\\x81'>
                                  <Id.Char_Hex '\\xa2'>
                                  <Id.Char_Hex '\\xb3'>
                                  <Id.Char_Hex '\\xee'>
                                  <Id.Char_Hex '\\xff'>
                                ]
                                multiline: F
                              )
                            }
                          )
                      )
                    }
                  spids: [307]
                )
              ]
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} {<empty>} 
              {<setextattr>} {<user>} {<myattr>} {(DQ ($ Id.VSub_DollarName '$BINSTUFF'))} {<foo>}
            )
            (C {<getextattr>} {<user>} {<myattr>} {<foo>})
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} 
              {<inline> <Id.Lit_Colon ':'> 
                (DQ <'20 30 40 55 66 70 81 a2 b3 ee ff'> <Id.Lit_BadBackslash '\\'> <n>)
              } {<getextattr>} {<-qx>} {<user>} {<myattr>} {<foo>}
            )
          ]
        )
    )
    (C {<atf_test_case>} {<long_name>})
    (command.ShFunction
      name: long_name_head
      body: 
        (BraceGroup
          children: [(C {<atf_set>} {(DQ <descr>)} {(DQ <'A maximum length attribute name'>)})]
        )
    )
    (command.ShFunction
      name: long_name_body
      body: 
        (BraceGroup
          children: [
            (C {<check_fs>})
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.Pipeline
                              children: [
                                (command.ShAssignment
                                  pairs: [
                                    (assign_pair
                                      lhs: (sh_lhs_expr.Name name:NAME_MAX)
                                      op: assign_op.Equal
                                      rhs: 
                                        {
                                          (command_sub
                                            left_token: <Id.Left_DollarParen '$('>
                                            child: (C {<getconf>} {<NAME_MAX>} {<.>})
                                          )
                                        }
                                      spids: [456]
                                    )
                                  ]
                                )
                              ]
                              negated: T
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (C {<atf_skip>} {(DQ <'Filesystem not reporting NAME_MAX; skipping testcase'>)})
                  ]
                  spids: [452 466]
                )
              ]
            )
            (C {<atf_expect_fail>} {(DQ <'BUG 208965 extattr(2) doesn\'t allow maxlen attr names'>)})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:ATTRNAME)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_Backtick '`'>
                        child: 
                          (C {<jot>} {<-b>} {<X>} {<-s>} {(DQ )} {($ Id.VSub_DollarName '$NAME_MAX')} {<0>})
                      )
                    }
                  spids: [492]
                )
              ]
            )
            (C {<touch>} {<foo>})
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} {<empty>} 
              {<setextattr>} {<user>} {($ Id.VSub_DollarName '$ATTRNAME')} {<myvalue>} {<foo>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} 
              {<inline> <Id.Lit_Colon ':'> 
                (DQ (${ Id.VSub_Name ATTRNAME) <Id.Lit_BadBackslash '\\'> <n>)
              } {<lsextattr>} {<-q>} {<user>} {<foo>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} 
              {<inline> <Id.Lit_Colon ':'> (DQ <myvalue> <Id.Lit_BadBackslash '\\'> <n>)} {<getextattr>} {<-q>} {<user>} {(${ Id.VSub_Name ATTRNAME)} {<foo>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} {<empty>} 
              {<rmextattr>} {<user>} {(${ Id.VSub_Name ATTRNAME)} {<foo>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} {<empty>} 
              {<lsextattr>} {<-q>} {<user>} {<foo>}
            )
          ]
        )
    )
    (C {<atf_test_case>} {<loud>})
    (command.ShFunction
      name: loud_head
      body: 
        (BraceGroup
          children: [(C {<atf_set>} {(DQ <descr>)} {(DQ <'Loud (non -q) output for each command'>)})]
        )
    )
    (command.ShFunction
      name: loud_body
      body: 
        (BraceGroup
          children: [
            (C {<check_fs>})
            (C {<touch>} {<foo>})
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} {<empty>} 
              {<setextattr>} {<user>} {<myattr>} {<myvalue>} {<foo>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} 
              {<inline> <Id.Lit_Colon ':'> (DQ <'foo myattr'>)} {<printf>} {(DQ <'%s %s'>)} 
              {
                (command_sub
                  left_token: <Id.Left_DollarParen '$('>
                  child: (C {<lsextattr>} {<user>} {<foo>})
                )
              }
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} 
              {<inline> <Id.Lit_Colon ':'> (DQ <'foo myvalue'>)} {<printf>} {(DQ <'%s %s'>)} 
              {
                (command_sub
                  left_token: <Id.Left_DollarParen '$('>
                  child: (C {<getextattr>} {<user>} {<myattr>} {<foo>})
                )
              }
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} {<empty>} 
              {<rmextattr>} {<user>} {<myattr>} {<foo>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} 
              {<inline> <Id.Lit_Colon ':'> (DQ <foo>)} {<printf>} {<Id.Lit_Other '%'> <s>} 
              {
                (command_sub
                  left_token: <Id.Left_DollarParen '$('>
                  child: (C {<lsextattr>} {<user>} {<foo>})
                )
              }
            )
          ]
        )
    )
    (C {<atf_test_case>} {<noattrs>})
    (command.ShFunction
      name: noattrs_head
      body: 
        (BraceGroup
          children: [(C {<atf_set>} {(DQ <descr>)} {(DQ <'A file with no extended attributes'>)})]
        )
    )
    (command.ShFunction
      name: noattrs_body
      body: 
        (BraceGroup
          children: [
            (C {<check_fs>})
            (C {<touch>} {<foo>})
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} {<empty>} 
              {<lsextattr>} {<-q>} {<user>} {<foo>}
            )
          ]
        )
    )
    (C {<atf_test_case>} {<nonexistent_file>})
    (command.ShFunction
      name: nonexistent_file_head
      body: 
        (BraceGroup
          children: [(C {<atf_set>} {(DQ <descr>)} {(DQ <'A file that does not exist'>)})]
        )
    )
    (command.ShFunction
      name: nonexistent_file_body
      body: 
        (BraceGroup
          children: [
            (C {<check_fs>})
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <1>} {<-e>} 
              {<match> <Id.Lit_Colon ':'> (DQ <'No such file or directory'>)} {<lsextattr>} {<user>} {<foo>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <1>} {<-e>} 
              {<match> <Id.Lit_Colon ':'> (DQ <'No such file or directory'>)} {<setextattr>} {<user>} {<myattr>} {<myvalue>} {<foo>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <1>} {<-e>} 
              {<match> <Id.Lit_Colon ':'> (DQ <'No such file or directory'>)} {<getextattr>} {<user>} {<myattr>} {<foo>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <1>} {<-e>} 
              {<match> <Id.Lit_Colon ':'> (DQ <'No such file or directory'>)} {<rmextattr>} {<user>} {<myattr>} {<foo>}
            )
          ]
        )
    )
    (C {<atf_test_case>} {<null>})
    (command.ShFunction
      name: null_head
      body: 
        (BraceGroup
          children: [(C {<atf_set>} {(DQ <descr>)} {(DQ <'NUL-terminate an attribute value'>)})]
        )
    )
    (command.ShFunction
      name: null_body
      body: 
        (BraceGroup
          children: [
            (C {<check_fs>})
            (C {<touch>} {<foo>})
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} {<empty>} 
              {<setextattr>} {<-n>} {<user>} {<myattr>} {<myvalue>} {<foo>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} 
              {<inline> <Id.Lit_Colon ':'> 
                (DQ <myvalue> <Id.Lit_BadBackslash '\\'> <0> <Id.Lit_BadBackslash '\\'> <n>)
              } {<getextattr>} {<-q>} {<user>} {<myattr>} {<foo>}
            )
          ]
        )
    )
    (C {<atf_test_case>} {<one_user_attr>})
    (command.ShFunction
      name: one_user_attr_head
      body: 
        (BraceGroup
          children: [(C {<atf_set>} {(DQ <descr>)} {(DQ <'A file with one extended attribute'>)})]
        )
    )
    (command.ShFunction
      name: one_user_attr_body
      body: 
        (BraceGroup
          children: [
            (C {<check_fs>})
            (C {<touch>} {<foo>})
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} {<empty>} 
              {<setextattr>} {<user>} {<myattr>} {<myvalue>} {<foo>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} 
              {<inline> <Id.Lit_Colon ':'> (DQ <myattr> <Id.Lit_BadBackslash '\\'> <n>)} {<lsextattr>} {<-q>} {<user>} {<foo>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} 
              {<inline> <Id.Lit_Colon ':'> (DQ <myvalue> <Id.Lit_BadBackslash '\\'> <n>)} {<getextattr>} {<-q>} {<user>} {<myattr>} {<foo>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} {<empty>} 
              {<rmextattr>} {<user>} {<myattr>} {<foo>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} {<empty>} 
              {<lsextattr>} {<-q>} {<user>} {<foo>}
            )
          ]
        )
    )
    (C {<atf_test_case>} {<one_system_attr>})
    (command.ShFunction
      name: one_system_attr_head
      body: 
        (BraceGroup
          children: [
            (C {<atf_set>} {(DQ <descr>)} {(DQ <'A file with one extended attribute'>)})
            (C {<atf_set>} {(DQ <require.user>)} {(DQ <root>)})
          ]
        )
    )
    (command.ShFunction
      name: one_system_attr_body
      body: 
        (BraceGroup
          children: [
            (C {<check_fs>})
            (C {<touch>} {<foo>})
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} {<empty>} 
              {<setextattr>} {<system>} {<myattr>} {<myvalue>} {<foo>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} 
              {<inline> <Id.Lit_Colon ':'> (DQ <myattr> <Id.Lit_BadBackslash '\\'> <n>)} {<lsextattr>} {<-q>} {<system>} {<foo>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} 
              {<inline> <Id.Lit_Colon ':'> (DQ <myvalue> <Id.Lit_BadBackslash '\\'> <n>)} {<getextattr>} {<-q>} {<system>} {<myattr>} {<foo>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} {<empty>} 
              {<rmextattr>} {<system>} {<myattr>} {<foo>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} {<empty>} 
              {<lsextattr>} {<-q>} {<system>} {<foo>}
            )
          ]
        )
    )
    (C {<atf_test_case>} {<stdin>})
    (command.ShFunction
      name: stdin_head
      body: 
        (BraceGroup
          children: [(C {<atf_set>} {(DQ <descr>)} {(DQ <'Set attribute value from stdin'>)})]
        )
    )
    (command.ShFunction
      name: stdin_body
      body: 
        (BraceGroup
          children: [
            (C {<check_fs>})
            (C {<dd>} {<Id.Lit_VarLike 'if='> <'/dev/random'>} {<Id.Lit_VarLike 'of='> <infile>} 
              {<Id.Lit_VarLike 'bs='> <1k>} {<Id.Lit_VarLike 'count='> <8>}
            )
            (C {<touch>} {<foo>})
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (command.Simple
                  words: [{<setextattr>} {<-i>} {<user>} {<myattr>} {<foo>}]
                  redirects: [(redir op:<Id.Redir_Less '<'> loc:(redir_loc.Fd fd:0) arg:{<infile>})]
                  do_fork: T
                )
                (C {<atf_fail>} {(DQ <'setextattr failed'>)})
              ]
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} 
              {<inline> <Id.Lit_Colon ':'> (DQ <myattr> <Id.Lit_BadBackslash '\\'> <n>)} {<lsextattr>} {<-q>} {<user>} {<foo>}
            )
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (command.Simple
                  words: [{<getextattr>} {<-qq>} {<user>} {<myattr>} {<foo>}]
                  redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<outfile>})]
                  do_fork: T
                )
                (C {<atf_fail>} {(DQ <'getextattr failed'>)})
              ]
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<cmp>} {<-s>} 
              {<infile>} {<outfile>}
            )
          ]
        )
    )
    (C {<atf_test_case>} {<stringify>})
    (command.ShFunction
      name: stringify_head
      body: 
        (BraceGroup
          children: [(C {<atf_set>} {(DQ <descr>)} {(DQ <'Stringify the output of getextattr'>)})]
        )
    )
    (command.ShFunction
      name: stringify_body
      body: 
        (BraceGroup
          children: [
            (C {<check_fs>})
            (C {<touch>} {<foo>})
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} {<empty>} 
              {<setextattr>} {<user>} {<myattr>} {(DQ <'my value'>)} {<foo>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} 
              {<inline> <Id.Lit_Colon ':'> 
                (DQ (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) <my> 
                  (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\\\'>) <Id.Lit_BadBackslash '\\'> <040value> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) 
                  <Id.Lit_BadBackslash '\\'> <n>
                )
              } {<getextattr>} {<-qs>} {<user>} {<myattr>} {<foo>}
            )
          ]
        )
    )
    (C {<atf_test_case>} {<symlink>})
    (command.ShFunction
      name: symlink_head
      body: 
        (BraceGroup
          children: [(C {<atf_set>} {(DQ <descr>)} {(DQ <'A symlink to an ordinary file'>)})]
        )
    )
    (command.ShFunction
      name: symlink_body
      body: 
        (BraceGroup
          children: [
            (C {<check_fs>})
            (C {<touch>} {<foo>})
            (C {<ln>} {<-s>} {<foo>} {<foolink>})
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} {<empty>} 
              {<setextattr>} {<user>} {<myattr>} {<myvalue>} {<foolink>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} 
              {<inline> <Id.Lit_Colon ':'> (DQ <myvalue> <Id.Lit_BadBackslash '\\'> <n>)} {<getextattr>} {<-q>} {<user>} {<myattr>} {<foolink>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} 
              {<inline> <Id.Lit_Colon ':'> (DQ <myvalue> <Id.Lit_BadBackslash '\\'> <n>)} {<getextattr>} {<-q>} {<user>} {<myattr>} {<foo>}
            )
          ]
        )
    )
    (C {<atf_test_case>} {<symlink_nofollow>})
    (command.ShFunction
      name: symlink_nofollow_head
      body: 
        (BraceGroup
          children: [(C {<atf_set>} {(DQ <descr>)} {(DQ <'Operating directly on a symlink'>)})]
        )
    )
    (command.ShFunction
      name: symlink_nofollow_body
      body: 
        (BraceGroup
          children: [
            (C {<check_fs>})
            (C {<touch>} {<foo>})
            (C {<ln>} {<-s>} {<foo>} {<foolink>})
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} {<empty>} 
              {<setextattr>} {<-h>} {<user>} {<myattr>} {<myvalue>} {<foolink>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} 
              {<inline> <Id.Lit_Colon ':'> (DQ <myvalue> <Id.Lit_BadBackslash '\\'> <n>)} {<getextattr>} {<-qh>} {<user>} {<myattr>} {<foolink>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <1>} {<-e>} 
              {<match> <Id.Lit_Colon ':'> (DQ <'Attribute not found'>)} {<getextattr>} {<user>} {<myattr>} {<foolink>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <1>} {<-e>} 
              {<match> <Id.Lit_Colon ':'> (DQ <'Attribute not found'>)} {<getextattr>} {<user>} {<myattr>} {<foo>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} {<empty>} 
              {<setextattr>} {<user>} {<otherattr>} {<othervalue>} {<foo>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <1>} {<getextattr>} 
              {<-qh>} {<user>} {<otherattr>} {<foolink>}
            )
          ]
        )
    )
    (C {<atf_test_case>} {<system_and_user_attrs>})
    (command.ShFunction
      name: system_and_user_attrs_head
      body: 
        (BraceGroup
          children: [
            (C {<atf_set>} {(DQ <descr>)} {(DQ <'A file with both system and user extended attributes'>)})
            (C {<atf_set>} {(DQ <require.user>)} {(DQ <root>)})
          ]
        )
    )
    (command.ShFunction
      name: system_and_user_attrs_body
      body: 
        (BraceGroup
          children: [
            (C {<check_fs>})
            (C {<touch>} {<foo>})
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} {<empty>} 
              {<setextattr>} {<user>} {<userattr>} {<userval>} {<foo>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} {<empty>} 
              {<setextattr>} {<system>} {<sysattr>} {<sysval>} {<foo>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} 
              {<inline> <Id.Lit_Colon ':'> (DQ <userattr> <Id.Lit_BadBackslash '\\'> <n>)} {<lsextattr>} {<-q>} {<user>} {<foo>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} 
              {<inline> <Id.Lit_Colon ':'> (DQ <sysattr> <Id.Lit_BadBackslash '\\'> <n>)} {<lsextattr>} {<-q>} {<system>} {<foo>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} 
              {<inline> <Id.Lit_Colon ':'> (DQ <userval> <Id.Lit_BadBackslash '\\'> <n>)} {<getextattr>} {<-q>} {<user>} {<userattr>} {<foo>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} 
              {<inline> <Id.Lit_Colon ':'> (DQ <sysval> <Id.Lit_BadBackslash '\\'> <n>)} {<getextattr>} {<-q>} {<system>} {<sysattr>} {<foo>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} {<empty>} 
              {<rmextattr>} {<user>} {<userattr>} {<foo>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} {<empty>} 
              {<rmextattr>} {<system>} {<sysattr>} {<foo>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} {<empty>} 
              {<lsextattr>} {<-q>} {<user>} {<foo>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} {<empty>} 
              {<lsextattr>} {<-q>} {<system>} {<foo>}
            )
          ]
        )
    )
    (C {<atf_test_case>} {<two_files>})
    (command.ShFunction
      name: two_files_head
      body: (BraceGroup children:[(C {<atf_set>} {(DQ <descr>)} {(DQ <'Manipulate two files'>)})])
    )
    (command.ShFunction
      name: two_files_body
      body: 
        (BraceGroup
          children: [
            (C {<check_fs>})
            (C {<touch>} {<foo>} {<bar>})
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} {<empty>} 
              {<setextattr>} {<user>} {<myattr>} {<myvalue>} {<foo>} {<bar>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} 
              {<inline> <Id.Lit_Colon ':'> 
                (DQ <foo> <Id.Lit_BadBackslash '\\'> <tmyattr> <Id.Lit_BadBackslash '\\'> <nbar> 
                  <Id.Lit_BadBackslash '\\'> <tmyattr> <Id.Lit_BadBackslash '\\'> <n>
                )
              } {<lsextattr>} {<user>} {<foo>} {<bar>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} 
              {<inline> <Id.Lit_Colon ':'> 
                (DQ <foo> <Id.Lit_BadBackslash '\\'> <tmyvalue> <Id.Lit_BadBackslash '\\'> <nbar> 
                  <Id.Lit_BadBackslash '\\'> <tmyvalue> <Id.Lit_BadBackslash '\\'> <n>
                )
              } {<getextattr>} {<user>} {<myattr>} {<foo>} {<bar>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} {<empty>} 
              {<rmextattr>} {<user>} {<myattr>} {<foo>} {<bar>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} {<empty>} 
              {<lsextattr>} {<-q>} {<user>} {<foo>} {<bar>}
            )
          ]
        )
    )
    (C {<atf_test_case>} {<two_files_force>})
    (command.ShFunction
      name: two_files_force_head
      body: 
        (BraceGroup
          children: [
            (C {<atf_set>} {(DQ <descr>)} {(DQ <'Manipulate two files.  The first does not exist'>)})
          ]
        )
    )
    (command.ShFunction
      name: two_files_force_body
      body: 
        (BraceGroup
          children: [
            (C {<check_fs>})
            (C {<touch>} {<bar>})
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <1>} {<-e>} 
              {<match> <Id.Lit_Colon ':'> (DQ <'No such file or directory'>)} {<setextattr>} {<user>} {<myattr>} {<myvalue>} {<foo>} {<bar>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-e>} {<ignore>} 
              {<setextattr>} {<-f>} {<user>} {<myattr>} {<myvalue>} {<foo>} {<bar>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <1>} {<-e>} 
              {<match> <Id.Lit_Colon ':'> (DQ <'No such file or directory'>)} {<lsextattr>} {<user>} {<foo>} {<bar>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-e>} {<ignore>} 
              {<-o>} 
              {<inline> <Id.Lit_Colon ':'> 
                (DQ <bar> <Id.Lit_BadBackslash '\\'> <tmyattr> <Id.Lit_BadBackslash '\\'> <n>)
              } {<lsextattr>} {<-f>} {<user>} {<foo>} {<bar>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <1>} {<-e>} 
              {<match> <Id.Lit_Colon ':'> (DQ <'No such file or directory'>)} {<getextattr>} {<user>} {<myattr>} {<foo>} {<bar>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-e>} {<ignore>} 
              {<-o>} 
              {<inline> <Id.Lit_Colon ':'> 
                (DQ <bar> <Id.Lit_BadBackslash '\\'> <tmyvalue> <Id.Lit_BadBackslash '\\'> <n>)
              } {<getextattr>} {<-f>} {<user>} {<myattr>} {<foo>} {<bar>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <1>} {<-e>} 
              {<match> <Id.Lit_Colon ':'> (DQ <'No such file or directory'>)} {<rmextattr>} {<user>} {<myattr>} {<foo>} {<bar>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-e>} {<ignore>} 
              {<rmextattr>} {<-f>} {<user>} {<myattr>} {<foo>} {<bar>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} {<empty>} 
              {<lsextattr>} {<-q>} {<user>} {<bar>}
            )
          ]
        )
    )
    (C {<atf_test_case>} {<two_user_attrs>})
    (command.ShFunction
      name: two_user_attrs_head
      body: 
        (BraceGroup
          children: [(C {<atf_set>} {(DQ <descr>)} {(DQ <'A file with two extended attributes'>)})]
        )
    )
    (command.ShFunction
      name: two_user_attrs_body
      body: 
        (BraceGroup
          children: [
            (C {<check_fs>})
            (C {<touch>} {<foo>})
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} {<empty>} 
              {<setextattr>} {<user>} {<myattr1>} {<myvalue1>} {<foo>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} {<empty>} 
              {<setextattr>} {<user>} {<myattr2>} {<myvalue2>} {<foo>}
            )
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:raw_output)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (command_sub
                            left_token: <Id.Left_Backtick '`'>
                            child: (C {<lsextattr>} {<-q>} {<user>} {<foo>})
                          )
                        }
                      spids: [2942]
                    )
                  ]
                )
                (C {<atf_fail>} {(DQ <'lsextattr failed'>)})
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:tabless_output)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_Backtick '`'>
                        child: (C {<printf>} {(DQ <'%s %s'>)} {(${ Id.VSub_Name raw_output)})
                      )
                    }
                  spids: [2964]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {(DQ <'myattr1 myattr2'>)} 
                              {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {(DQ (${ Id.VSub_Name tabless_output))} {<-a>} {(DQ <'myattr2 myattr1'>)} 
                              {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {(DQ (${ Id.VSub_Name tabless_output))} {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (C {<atf_fail>} {(DQ <'lsextattr printed '> (${ Id.VSub_Name tabless_output))})
                  ]
                  spids: [2980 3017]
                )
              ]
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} 
              {<inline> <Id.Lit_Colon ':'> (DQ <myvalue1> <Id.Lit_BadBackslash '\\'> <n>)} {<getextattr>} {<-q>} {<user>} {<myattr1>} {<foo>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} 
              {<inline> <Id.Lit_Colon ':'> (DQ <myvalue2> <Id.Lit_BadBackslash '\\'> <n>)} {<getextattr>} {<-q>} {<user>} {<myattr2>} {<foo>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} {<empty>} 
              {<rmextattr>} {<user>} {<myattr2>} {<foo>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} {<empty>} 
              {<rmextattr>} {<user>} {<myattr1>} {<foo>}
            )
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <0>} {<-o>} {<empty>} 
              {<lsextattr>} {<-q>} {<user>} {<foo>}
            )
          ]
        )
    )
    (C {<atf_test_case>} {<unprivileged_user_cannot_set_system_attr>})
    (command.ShFunction
      name: unprivileged_user_cannot_set_system_attr_head
      body: 
        (BraceGroup
          children: [
            (C {<atf_set>} {(DQ <descr>)} {(DQ <'Unprivileged users can\'t set system attributes'>)})
            (C {<atf_set>} {(DQ <require.user>)} {(DQ <unprivileged>)})
          ]
        )
    )
    (command.ShFunction
      name: unprivileged_user_cannot_set_system_attr_body
      body: 
        (BraceGroup
          children: [
            (C {<check_fs>})
            (C {<touch>} {<foo>})
            (C {<atf_check>} {<-s>} {<Id.ControlFlow_Exit exit> <Id.Lit_Colon ':'> <1>} {<-e>} 
              {<match> <Id.Lit_Colon ':'> (DQ <'Operation not permitted'>)} {<setextattr>} {<system>} {<myattr>} {<myvalue>} {<foo>}
            )
          ]
        )
    )
    (command.ShFunction
      name: atf_init_test_cases
      body: 
        (BraceGroup
          children: [
            (C {<atf_add_test_case>} {<bad_namespace>})
            (C {<atf_add_test_case>} {<hex>})
            (C {<atf_add_test_case>} {<hex_nonascii>})
            (C {<atf_add_test_case>} {<long_name>})
            (C {<atf_add_test_case>} {<loud>})
            (C {<atf_add_test_case>} {<noattrs>})
            (C {<atf_add_test_case>} {<nonexistent_file>})
            (C {<atf_add_test_case>} {<null>})
            (C {<atf_add_test_case>} {<symlink_nofollow>})
            (C {<atf_add_test_case>} {<one_user_attr>})
            (C {<atf_add_test_case>} {<one_system_attr>})
            (C {<atf_add_test_case>} {<stdin>})
            (C {<atf_add_test_case>} {<stringify>})
            (C {<atf_add_test_case>} {<symlink>})
            (C {<atf_add_test_case>} {<symlink_nofollow>})
            (C {<atf_add_test_case>} {<system_and_user_attrs>})
            (C {<atf_add_test_case>} {<two_files>})
            (C {<atf_add_test_case>} {<two_files_force>})
            (C {<atf_add_test_case>} {<two_user_attrs>})
            (C {<atf_add_test_case>} {<unprivileged_user_cannot_set_system_attr>})
          ]
        )
    )
    (command.ShFunction
      name: check_fs
      body: 
        (BraceGroup
          children: [
            (command.Case
              to_match: 
                {
                  (command_sub
                    left_token: <Id.Left_Backtick '`'>
                    child: 
                      (command.Pipeline
                        children: [
                          (C {<df>} {<-T>} {<.>})
                          (C {<tail>} {<-n>} {<1>})
                          (C {<cut>} {<-wf>} {<2>})
                        ]
                        negated: F
                      )
                  )
                }
              arms: [
                (case_arm pat_list:[{(DQ <ufs>)}] spids:[3384 3387 3389 -1])
                (case_arm pat_list:[{(DQ <zfs>)}] spids:[3395 3398 3400 -1])
                (case_arm
                  pat_list: [{(DQ <tmpfs>)}]
                  action: [(C {<atf_skip>} {(DQ <'tmpfs does not support extended attributes'>)})]
                  spids: [3406 3409 3416 -1]
                )
              ]
            )
          ]
        )
    )
  ]
)