File: server_req_size.exp

package info (click to toggle)
systemtap 3.1-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 32,860 kB
  • ctags: 12,513
  • sloc: cpp: 58,610; ansic: 58,189; exp: 37,322; sh: 10,633; xml: 7,771; perl: 2,252; python: 2,066; tcl: 1,305; makefile: 969; lisp: 105; java: 100; awk: 94; asm: 91; sed: 16
file content (38 lines) | stat: -rw-r--r-- 1,291 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
set test "server request size"

# Create a new server log and make sure it's world writable.
set logfile "[pwd]/server.log"
catch {exec rm -f $logfile}
catch {exec touch $logfile}
catch {exec chmod 666 $logfile}

# We want to check that we're not failing tests becuase the compiler server
# can't be started. if the basic stap server doesn't start up, label this as untested
if {! [setup_server]} then {
    untested "$test"
    return
}
# Now that we know that the basic compile can be started. let's shut it down
shutdown_server

# We'll test 2 server options. we're not checking the stap command's return.
# instead we will check the that correct error message is in the server log.
# 1. --max-compressed-request 
# 2. --max-request-size size
set testcases  {"--max-compressed-request" "--max-request-size"}
set outputs { " request file is too large" "Uncompressed request size of"}

foreach output $outputs testcase $testcases {
  if {! [setup_server $testcase 10]} then {
    fail "$test $testcase (server setup)"
  } else {
    stap_run_batch $srcdir/systemtap.server/hello.stp --use-server=$server_spec
    set rc [catch {exec grep $output $logfile} result]
    if {$rc != 0} then {
      fail "$test $testcase"
    } else {
      pass "$test $testcase"
    }
  }
  shutdown_server
}