Debian Codegraph @

testsuite/systemtap.server/server_req_size.exp

raw
1 set test "server request size"
2
3 # The setup_server procedure always uses a "fresh" server log file, so
4 # we don't need to create an empty log file that this test used to do.
5 global server_logfile
6
7 # We want to check that we're not failing tests becuase the compiler server
8 # can't be started. if the basic stap server doesn't start up, label this as untested
9 if {! [setup_server]} then {
10 untested "$test"
11 return
12 }
13 # Now that we know that the basic compile can be started. let's shut it down
14 shutdown_server
15
16 # We'll test 2 server options. we're not checking the stap command's return.
17 # instead we will check the that correct error message is in the server log.
18 # 1. --max-compressed-request
19 # 2. --max-request-size size
20 set testcases {"--max-compressed-request" "--max-request-size"}
21 set outputs { " request file is too large" "Uncompressed request size of"}
22
23 foreach output $outputs testcase $testcases {
24 if {! [setup_server $testcase 10]} then {
25 fail "$test $testcase (server setup)"
26 } else {
27 stap_run_batch $srcdir/systemtap.server/hello.stp --use-server=$server_spec
28 set rc [catch {exec grep $output $server_logfile} result]
29 if {$rc != 0} then {
30 fail "$test $testcase"
31 } else {
32 pass "$test $testcase"
33 }
34 }
35 shutdown_server
36 }