(command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:test_description spids:[21]) op: Equal rhs: { (SQ <'gitweb as standalone script (http status tests).\n'> <'\n'> <'This test runs gitweb (git web interface) as a CGI script from the\n'> <'commandline, and checks that it returns the expected HTTP status\n'> <'code and message.'> ) } spids: [21] ) ] spids: [21] ) (C {(.)} {(./gitweb-lib.sh)}) (command.AndOr ops: [Op_DAmp] children: [ (command.SimpleCommand words: [{(perl)} {(-MHTTP) (Lit_Other ':') (Lit_Other ':') (Date)} {(-e)} {(0)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(/dev/null)}) (redir.Redir op:<Redir_GreatAnd '2>&'> fd:2 arg_word:{(1)}) ] ) (C {(test_set_prereq)} {(DATE_PARSER)}) ] ) (command.AndOr ops: [Op_DAmp] children: [ (command.SimpleCommand words: [{(perl)} {(-MTime) (Lit_Other ':') (Lit_Other ':') (ParseDate)} {(-e)} {(0)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(/dev/null)}) (redir.Redir op:<Redir_GreatAnd '2>&'> fd:2 arg_word:{(1)}) ] ) (C {(test_set_prereq)} {(DATE_PARSER)}) ] ) (C {(test_expect_success)} {(SQ <setup>)} {(DQ ('\n') ("\ttest_commit 'SnapshotTests' 'i can has snapshot'\n"))} ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_DGreat '>>'> fd:16777215 arg_word:{(gitweb_config.perl)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\E'>) (OF)} here_end_span_id: 126 stdin_parts: [("$feature{'snapshot'}{'override'} = 0;\n")] ) ] ) (C {(test_expect_success)} {(SQ <'snapshots: tgz only default format enabled'>)} { (SQ <'gitweb_run "p=.git;a=snapshot;h=HEAD;sf=tgz" &&\n'> <' grep "Status: 200 OK" gitweb.output &&\n'> <' gitweb_run "p=.git;a=snapshot;h=HEAD;sf=tbz2" &&\n'> <' grep "403 - Unsupported snapshot format" gitweb.output &&\n'> <' gitweb_run "p=.git;a=snapshot;h=HEAD;sf=txz" &&\n'> <' grep "403 - Snapshot format not allowed" gitweb.output &&\n'> <' gitweb_run "p=.git;a=snapshot;h=HEAD;sf=zip" &&\n'> <' grep "403 - Unsupported snapshot format" gitweb.output'> ) } ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_DGreat '>>'> fd:16777215 arg_word:{(gitweb_config.perl)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\E'>) (OF)} here_end_span_id: 161 stdin_parts: [("$feature{'snapshot'}{'default'} = ['tgz','tbz2','txz','zip'];\n")] ) ] ) (C {(test_expect_success)} {(SQ <'snapshots: all enabled in default, use default disabled value'>)} { (SQ <'gitweb_run "p=.git;a=snapshot;h=HEAD;sf=tgz" &&\n'> <' grep "Status: 200 OK" gitweb.output &&\n'> <' gitweb_run "p=.git;a=snapshot;h=HEAD;sf=tbz2" &&\n'> <' grep "Status: 200 OK" gitweb.output &&\n'> <' gitweb_run "p=.git;a=snapshot;h=HEAD;sf=txz" &&\n'> <' grep "403 - Snapshot format not allowed" gitweb.output &&\n'> <' gitweb_run "p=.git;a=snapshot;h=HEAD;sf=zip" &&\n'> <' grep "Status: 200 OK" gitweb.output'> ) } ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_DGreat '>>'> fd:16777215 arg_word:{(gitweb_config.perl)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\E'>) (OF)} here_end_span_id: 196 stdin_parts: [("$known_snapshot_formats{'zip'}{'disabled'} = 1;\n")] ) ] ) (C {(test_expect_success)} {(SQ <'snapshots: zip explicitly disabled'>)} { (SQ <'gitweb_run "p=.git;a=snapshot;h=HEAD;sf=zip" &&\n'> <' grep "403 - Snapshot format not allowed" gitweb.output'> ) } ) (C {(test_debug)} {(SQ <'cat gitweb.output'>)}) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_DGreat '>>'> fd:16777215 arg_word:{(gitweb_config.perl)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\E'>) (OF)} here_end_span_id: 231 stdin_parts: [("$known_snapshot_formats{'tgz'}{'disabled'} = 0;\n")] ) ] ) (C {(test_expect_success)} {(SQ <'snapshots: tgz explicitly enabled'>)} { (SQ <'gitweb_run "p=.git;a=snapshot;h=HEAD;sf=tgz" &&\n'> <' grep "Status: 200 OK" gitweb.output'> ) } ) (C {(test_debug)} {(SQ <'cat gitweb.headers'>)}) (C {(test_expect_success)} {(SQ <'snapshots: good tree-ish id'>)} { (SQ <'\n'> <'\tgitweb_run "p=.git;a=snapshot;h=master;sf=tgz" &&\n'> <'\tgrep "Status: 200 OK" gitweb.output\n'> ) } ) (C {(test_debug)} {(SQ <'cat gitweb.headers'>)}) (C {(test_expect_success)} {(SQ <'snapshots: bad tree-ish id'>)} { (SQ <'\n'> <'\tgitweb_run "p=.git;a=snapshot;h=frizzumFrazzum;sf=tgz" &&\n'> <'\tgrep "404 - Object does not exist" gitweb.output\n'> ) } ) (C {(test_debug)} {(SQ <'cat gitweb.output'>)}) (C {(test_expect_success)} {(SQ <'snapshots: bad tree-ish id (tagged object)'>)} { (SQ <'\n'> <'\techo object > tag-object &&\n'> <'\tgit add tag-object &&\n'> <'\ttest_tick && git commit -m "Object to be tagged" &&\n'> <'\tgit tag tagged-object $(git hash-object tag-object) &&\n'> <'\tgitweb_run "p=.git;a=snapshot;h=tagged-object;sf=tgz" &&\n'> <'\tgrep "400 - Object is not a tree-ish" gitweb.output\n'> ) } ) (C {(test_debug)} {(SQ <'cat gitweb.output'>)}) (C {(test_expect_success)} {(SQ <'snapshots: good object id'>)} { (SQ <'\n'> <'\tID=$(git rev-parse --verify HEAD) &&\n'> <'\tgitweb_run "p=.git;a=snapshot;h=$ID;sf=tgz" &&\n'> <'\tgrep "Status: 200 OK" gitweb.output\n'> ) } ) (C {(test_debug)} {(SQ <'cat gitweb.headers'>)}) (C {(test_expect_success)} {(SQ <'snapshots: bad object id'>)} { (SQ <'\n'> <'\tgitweb_run "p=.git;a=snapshot;h=abcdef01234;sf=tgz" &&\n'> <'\tgrep "404 - Object does not exist" gitweb.output\n'> ) } ) (C {(test_debug)} {(SQ <'cat gitweb.output'>)}) (C {(test_expect_success)} {(DATE_PARSER)} {(SQ <'modification: feed last-modified'>)} { (SQ <'\n'> <'\tgitweb_run "p=.git;a=atom;h=master" &&\n'> <'\tgrep "Status: 200 OK" gitweb.headers &&\n'> <'\tgrep "Last-modified: Thu, 7 Apr 2005 22:14:13 +0000" gitweb.headers\n'> ) } ) (C {(test_debug)} {(SQ <'cat gitweb.headers'>)}) (C {(test_expect_success)} {(DATE_PARSER)} {(SQ <'modification: feed if-modified-since (modified)'>)} { (SQ <'\n'> <'\tHTTP_IF_MODIFIED_SINCE="Wed, 6 Apr 2005 22:14:13 +0000" &&\n'> <'\texport HTTP_IF_MODIFIED_SINCE &&\n'> <'\ttest_when_finished "unset HTTP_IF_MODIFIED_SINCE" &&\n'> <'\tgitweb_run "p=.git;a=atom;h=master" &&\n'> <'\tgrep "Status: 200 OK" gitweb.headers\n'> ) } ) (C {(test_debug)} {(SQ <'cat gitweb.headers'>)}) (C {(test_expect_success)} {(DATE_PARSER)} {(SQ <'modification: feed if-modified-since (unmodified)'>)} { (SQ <'\n'> <'\tHTTP_IF_MODIFIED_SINCE="Thu, 7 Apr 2005 22:14:13 +0000" &&\n'> <'\texport HTTP_IF_MODIFIED_SINCE &&\n'> <'\ttest_when_finished "unset HTTP_IF_MODIFIED_SINCE" &&\n'> <'\tgitweb_run "p=.git;a=atom;h=master" &&\n'> <'\tgrep "Status: 304 Not Modified" gitweb.headers\n'> ) } ) (C {(test_debug)} {(SQ <'cat gitweb.headers'>)}) (C {(test_expect_success)} {(DATE_PARSER)} {(SQ <'modification: snapshot last-modified'>)} { (SQ <'\n'> <'\tgitweb_run "p=.git;a=snapshot;h=master;sf=tgz" &&\n'> <'\tgrep "Status: 200 OK" gitweb.headers &&\n'> <'\tgrep "Last-modified: Thu, 7 Apr 2005 22:14:13 +0000" gitweb.headers\n'> ) } ) (C {(test_debug)} {(SQ <'cat gitweb.headers'>)}) (C {(test_expect_success)} {(DATE_PARSER)} {(SQ <'modification: snapshot if-modified-since (modified)'>)} { (SQ <'\n'> <'\tHTTP_IF_MODIFIED_SINCE="Wed, 6 Apr 2005 22:14:13 +0000" &&\n'> <'\texport HTTP_IF_MODIFIED_SINCE &&\n'> <'\ttest_when_finished "unset HTTP_IF_MODIFIED_SINCE" &&\n'> <'\tgitweb_run "p=.git;a=snapshot;h=master;sf=tgz" &&\n'> <'\tgrep "Status: 200 OK" gitweb.headers\n'> ) } ) (C {(test_debug)} {(SQ <'cat gitweb.headers'>)}) (C {(test_expect_success)} {(DATE_PARSER)} {(SQ <'modification: snapshot if-modified-since (unmodified)'>)} { (SQ <'\n'> <'\tHTTP_IF_MODIFIED_SINCE="Thu, 7 Apr 2005 22:14:13 +0000" &&\n'> <'\texport HTTP_IF_MODIFIED_SINCE &&\n'> <'\ttest_when_finished "unset HTTP_IF_MODIFIED_SINCE" &&\n'> <'\tgitweb_run "p=.git;a=snapshot;h=master;sf=tgz" &&\n'> <'\tgrep "Status: 304 Not Modified" gitweb.headers\n'> ) } ) (C {(test_debug)} {(SQ <'cat gitweb.headers'>)}) (C {(test_expect_success)} {(DATE_PARSER)} {(SQ <'modification: tree snapshot'>)} { (SQ <'\n'> <'\tID=$(git rev-parse --verify HEAD^{tree}) &&\n'> <'\tHTTP_IF_MODIFIED_SINCE="Wed, 6 Apr 2005 22:14:13 +0000" &&\n'> <'\texport HTTP_IF_MODIFIED_SINCE &&\n'> <'\ttest_when_finished "unset HTTP_IF_MODIFIED_SINCE" &&\n'> <'\tgitweb_run "p=.git;a=snapshot;h=$ID;sf=tgz" &&\n'> <'\tgrep "Status: 200 OK" gitweb.headers &&\n'> <'\t! grep -i "last-modified" gitweb.headers\n'> ) } ) (C {(test_debug)} {(SQ <'cat gitweb.headers'>)}) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_DGreat '>>'> fd:16777215 arg_word:{(gitweb_config.perl)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\E'>) (OF)} here_end_span_id: 556 stdin_parts: [('our $maxload = -1;\n')] ) ] ) (C {(test_expect_success)} {(SQ <'load checking: load too high (default action)'>)} { (SQ <'\n'> <'\tgitweb_run "p=.git" &&\n'> <'\tgrep "Status: 503 Service Unavailable" gitweb.headers &&\n'> <'\tgrep "503 - The load average on the server is too high" gitweb.body\n'> ) } ) (C {(test_debug)} {(SQ <'cat gitweb.headers'>)}) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_DGreat '>>'> fd:16777215 arg_word:{(gitweb_config.perl)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\E'>) (OF)} here_end_span_id: 591 stdin_parts: [('our $maxload = undef;\n')] ) ] ) (C {(test_expect_success)} {(SQ <'invalid arguments: invalid regexp (in project search)'>)} { (SQ <'\n'> <'\tgitweb_run "a=project_list;s=*\\.git;sr=1" &&\n'> <'\tgrep "Status: 400" gitweb.headers &&\n'> <'\tgrep "400 - Invalid.*regexp" gitweb.body\n'> ) } ) (C {(test_debug)} {(SQ <'cat gitweb.headers'>)}) (C {(test_done)}) ] )