You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by da...@apache.org on 2018/04/02 14:55:55 UTC
[trafficserver] branch master updated: a better way of testing
thread configs
This is an automated email from the ASF dual-hosted git repository.
dagit pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new 6f263a3 a better way of testing thread configs
6f263a3 is described below
commit 6f263a39263bfcbf5d86db8658e8df3c1848d205
Author: Fei Deng <du...@gmail.com>
AuthorDate: Thu Mar 29 13:30:12 2018 -0500
a better way of testing thread configs
---
tests/gold_tests/thread_config/check_threads.py | 89 +++++++++++++++++
.../thread_config/gold/thread_100_0.gold | 101 -------------------
.../thread_config/gold/thread_100_1.gold | 102 -------------------
.../thread_config/gold/thread_100_10.gold | 111 ---------------------
.../gold_tests/thread_config/gold/thread_1_0.gold | 2 -
.../gold_tests/thread_config/gold/thread_1_1.gold | 3 -
.../gold_tests/thread_config/gold/thread_1_10.gold | 12 ---
.../gold_tests/thread_config/gold/thread_2_0.gold | 3 -
.../gold_tests/thread_config/gold/thread_2_1.gold | 4 -
.../gold_tests/thread_config/gold/thread_2_10.gold | 13 ---
.../gold_tests/thread_config/gold/thread_32_0.gold | 33 ------
.../gold_tests/thread_config/gold/thread_32_1.gold | 34 -------
.../thread_config/gold/thread_32_10.gold | 43 --------
.../gold_tests/thread_config/thread_100_0.test.py | 23 +++--
.../gold_tests/thread_config/thread_100_1.test.py | 23 +++--
.../gold_tests/thread_config/thread_100_10.test.py | 23 +++--
tests/gold_tests/thread_config/thread_1_0.test.py | 23 +++--
tests/gold_tests/thread_config/thread_1_1.test.py | 23 +++--
tests/gold_tests/thread_config/thread_1_10.test.py | 23 +++--
tests/gold_tests/thread_config/thread_2_0.test.py | 23 +++--
tests/gold_tests/thread_config/thread_2_1.test.py | 23 +++--
tests/gold_tests/thread_config/thread_2_10.test.py | 23 +++--
tests/gold_tests/thread_config/thread_32_0.test.py | 23 +++--
tests/gold_tests/thread_config/thread_32_1.test.py | 23 +++--
.../gold_tests/thread_config/thread_32_10.test.py | 23 +++--
25 files changed, 269 insertions(+), 557 deletions(-)
diff --git a/tests/gold_tests/thread_config/check_threads.py b/tests/gold_tests/thread_config/check_threads.py
new file mode 100755
index 0000000..716d6ba
--- /dev/null
+++ b/tests/gold_tests/thread_config/check_threads.py
@@ -0,0 +1,89 @@
+'''
+'''
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import psutil
+import argparse
+import sys
+
+
+def count_threads(ts_path, etnet_threads, accept_threads):
+
+ for pid in psutil.pids():
+
+ # Find the pid corresponding to the ats process we started in autest.
+ # It needs to match the process name and the binary path.
+ # If autest can expose the pid of the process this is not needed anymore.
+ p = psutil.Process(pid)
+ if p.name() == '[TS_MAIN]' and p.cwd() == ts_path:
+
+ etnet_check = set()
+ accept_check = set()
+
+ for t in p.threads():
+
+ # Get the name of the thread.
+ thread_name = psutil.Process(t.id).name()
+
+ if thread_name.startswith('[ET_NET'):
+
+ # Get the id of this thread and check if it's in range.
+ etnet_id = int(thread_name.split(' ')[1][:-1])
+ if etnet_id >= etnet_threads:
+ sys.stderr.write('Too many ET_NET threads created.\n')
+ return 2
+ elif etnet_id in etnet_check:
+ sys.stderr.write('ET_NET thread with duplicate thread id created.\n')
+ return 4
+ else:
+ etnet_check.add(etnet_id)
+
+ elif thread_name.startswith('[ACCEPT'):
+
+ # Get the id of this thread and check if it's in range.
+ accept_id = int(thread_name.split(' ')[1].split(':')[0])
+ if accept_id >= accept_threads:
+ sys.stderr.write('Too many accept threads created.\n')
+ return 3
+ else:
+ accept_check.add(accept_id)
+
+ # Check the size of the sets, must be equal to the expected size.
+ if len(etnet_check) != etnet_threads:
+ sys.stderr.write('Expected ET_NET threads: {0}, found: {1}.\n'.format(etnet_threads, len(etnet_check)))
+ return 6
+ elif len(accept_check) != accept_threads:
+ sys.stderr.write('Expected accept threads: {0}, found: {1}.\n'.format(accept_threads, len(accept_check)))
+ return 5
+ else:
+ return 0
+
+ # Return 1 if no pid is found to match the ats process.
+ return 1
+
+
+def main():
+ parser = argparse.ArgumentParser()
+ parser.add_argument('-t', '--ts-path', type=str, dest='ts_path', help='path to traffic_server binary', required=True)
+ parser.add_argument('-e', '--etnet-threads', type=int, dest='etnet_threads', help='expected number of ET_NET threads', required=True)
+ parser.add_argument('-a', '--accept-threads', type=int, dest='accept_threads', help='expected number of accept threads', required=True)
+ args = parser.parse_args()
+ exit(count_threads(args.ts_path, args.etnet_threads, args.accept_threads))
+
+
+if __name__ == '__main__':
+ main()
diff --git a/tests/gold_tests/thread_config/gold/thread_100_0.gold b/tests/gold_tests/thread_config/gold/thread_100_0.gold
deleted file mode 100644
index 9c9b1cd..0000000
--- a/tests/gold_tests/thread_config/gold/thread_100_0.gold
+++ /dev/null
@@ -1,101 +0,0 @@
-``Created ET_NET thread #1
-``Created ET_NET thread #2
-``Created ET_NET thread #3
-``Created ET_NET thread #4
-``Created ET_NET thread #5
-``Created ET_NET thread #6
-``Created ET_NET thread #7
-``Created ET_NET thread #8
-``Created ET_NET thread #9
-``Created ET_NET thread #10
-``Created ET_NET thread #11
-``Created ET_NET thread #12
-``Created ET_NET thread #13
-``Created ET_NET thread #14
-``Created ET_NET thread #15
-``Created ET_NET thread #16
-``Created ET_NET thread #17
-``Created ET_NET thread #18
-``Created ET_NET thread #19
-``Created ET_NET thread #20
-``Created ET_NET thread #21
-``Created ET_NET thread #22
-``Created ET_NET thread #23
-``Created ET_NET thread #24
-``Created ET_NET thread #25
-``Created ET_NET thread #26
-``Created ET_NET thread #27
-``Created ET_NET thread #28
-``Created ET_NET thread #29
-``Created ET_NET thread #30
-``Created ET_NET thread #31
-``Created ET_NET thread #32
-``Created ET_NET thread #33
-``Created ET_NET thread #34
-``Created ET_NET thread #35
-``Created ET_NET thread #36
-``Created ET_NET thread #37
-``Created ET_NET thread #38
-``Created ET_NET thread #39
-``Created ET_NET thread #40
-``Created ET_NET thread #41
-``Created ET_NET thread #42
-``Created ET_NET thread #43
-``Created ET_NET thread #44
-``Created ET_NET thread #45
-``Created ET_NET thread #46
-``Created ET_NET thread #47
-``Created ET_NET thread #48
-``Created ET_NET thread #49
-``Created ET_NET thread #50
-``Created ET_NET thread #51
-``Created ET_NET thread #52
-``Created ET_NET thread #53
-``Created ET_NET thread #54
-``Created ET_NET thread #55
-``Created ET_NET thread #56
-``Created ET_NET thread #57
-``Created ET_NET thread #58
-``Created ET_NET thread #59
-``Created ET_NET thread #60
-``Created ET_NET thread #61
-``Created ET_NET thread #62
-``Created ET_NET thread #63
-``Created ET_NET thread #64
-``Created ET_NET thread #65
-``Created ET_NET thread #66
-``Created ET_NET thread #67
-``Created ET_NET thread #68
-``Created ET_NET thread #69
-``Created ET_NET thread #70
-``Created ET_NET thread #71
-``Created ET_NET thread #72
-``Created ET_NET thread #73
-``Created ET_NET thread #74
-``Created ET_NET thread #75
-``Created ET_NET thread #76
-``Created ET_NET thread #77
-``Created ET_NET thread #78
-``Created ET_NET thread #79
-``Created ET_NET thread #80
-``Created ET_NET thread #81
-``Created ET_NET thread #82
-``Created ET_NET thread #83
-``Created ET_NET thread #84
-``Created ET_NET thread #85
-``Created ET_NET thread #86
-``Created ET_NET thread #87
-``Created ET_NET thread #88
-``Created ET_NET thread #89
-``Created ET_NET thread #90
-``Created ET_NET thread #91
-``Created ET_NET thread #92
-``Created ET_NET thread #93
-``Created ET_NET thread #94
-``Created ET_NET thread #95
-``Created ET_NET thread #96
-``Created ET_NET thread #97
-``Created ET_NET thread #98
-``Created ET_NET thread #99
-``Created ET_NET thread #100
-``
diff --git a/tests/gold_tests/thread_config/gold/thread_100_1.gold b/tests/gold_tests/thread_config/gold/thread_100_1.gold
deleted file mode 100644
index c968dbb..0000000
--- a/tests/gold_tests/thread_config/gold/thread_100_1.gold
+++ /dev/null
@@ -1,102 +0,0 @@
-``Created ET_NET thread #1
-``Created ET_NET thread #2
-``Created ET_NET thread #3
-``Created ET_NET thread #4
-``Created ET_NET thread #5
-``Created ET_NET thread #6
-``Created ET_NET thread #7
-``Created ET_NET thread #8
-``Created ET_NET thread #9
-``Created ET_NET thread #10
-``Created ET_NET thread #11
-``Created ET_NET thread #12
-``Created ET_NET thread #13
-``Created ET_NET thread #14
-``Created ET_NET thread #15
-``Created ET_NET thread #16
-``Created ET_NET thread #17
-``Created ET_NET thread #18
-``Created ET_NET thread #19
-``Created ET_NET thread #20
-``Created ET_NET thread #21
-``Created ET_NET thread #22
-``Created ET_NET thread #23
-``Created ET_NET thread #24
-``Created ET_NET thread #25
-``Created ET_NET thread #26
-``Created ET_NET thread #27
-``Created ET_NET thread #28
-``Created ET_NET thread #29
-``Created ET_NET thread #30
-``Created ET_NET thread #31
-``Created ET_NET thread #32
-``Created ET_NET thread #33
-``Created ET_NET thread #34
-``Created ET_NET thread #35
-``Created ET_NET thread #36
-``Created ET_NET thread #37
-``Created ET_NET thread #38
-``Created ET_NET thread #39
-``Created ET_NET thread #40
-``Created ET_NET thread #41
-``Created ET_NET thread #42
-``Created ET_NET thread #43
-``Created ET_NET thread #44
-``Created ET_NET thread #45
-``Created ET_NET thread #46
-``Created ET_NET thread #47
-``Created ET_NET thread #48
-``Created ET_NET thread #49
-``Created ET_NET thread #50
-``Created ET_NET thread #51
-``Created ET_NET thread #52
-``Created ET_NET thread #53
-``Created ET_NET thread #54
-``Created ET_NET thread #55
-``Created ET_NET thread #56
-``Created ET_NET thread #57
-``Created ET_NET thread #58
-``Created ET_NET thread #59
-``Created ET_NET thread #60
-``Created ET_NET thread #61
-``Created ET_NET thread #62
-``Created ET_NET thread #63
-``Created ET_NET thread #64
-``Created ET_NET thread #65
-``Created ET_NET thread #66
-``Created ET_NET thread #67
-``Created ET_NET thread #68
-``Created ET_NET thread #69
-``Created ET_NET thread #70
-``Created ET_NET thread #71
-``Created ET_NET thread #72
-``Created ET_NET thread #73
-``Created ET_NET thread #74
-``Created ET_NET thread #75
-``Created ET_NET thread #76
-``Created ET_NET thread #77
-``Created ET_NET thread #78
-``Created ET_NET thread #79
-``Created ET_NET thread #80
-``Created ET_NET thread #81
-``Created ET_NET thread #82
-``Created ET_NET thread #83
-``Created ET_NET thread #84
-``Created ET_NET thread #85
-``Created ET_NET thread #86
-``Created ET_NET thread #87
-``Created ET_NET thread #88
-``Created ET_NET thread #89
-``Created ET_NET thread #90
-``Created ET_NET thread #91
-``Created ET_NET thread #92
-``Created ET_NET thread #93
-``Created ET_NET thread #94
-``Created ET_NET thread #95
-``Created ET_NET thread #96
-``Created ET_NET thread #97
-``Created ET_NET thread #98
-``Created ET_NET thread #99
-``Created ET_NET thread #100
-``Created accept thread #1``
-``
diff --git a/tests/gold_tests/thread_config/gold/thread_100_10.gold b/tests/gold_tests/thread_config/gold/thread_100_10.gold
deleted file mode 100644
index dbbd404..0000000
--- a/tests/gold_tests/thread_config/gold/thread_100_10.gold
+++ /dev/null
@@ -1,111 +0,0 @@
-``Created ET_NET thread #1
-``Created ET_NET thread #2
-``Created ET_NET thread #3
-``Created ET_NET thread #4
-``Created ET_NET thread #5
-``Created ET_NET thread #6
-``Created ET_NET thread #7
-``Created ET_NET thread #8
-``Created ET_NET thread #9
-``Created ET_NET thread #10
-``Created ET_NET thread #11
-``Created ET_NET thread #12
-``Created ET_NET thread #13
-``Created ET_NET thread #14
-``Created ET_NET thread #15
-``Created ET_NET thread #16
-``Created ET_NET thread #17
-``Created ET_NET thread #18
-``Created ET_NET thread #19
-``Created ET_NET thread #20
-``Created ET_NET thread #21
-``Created ET_NET thread #22
-``Created ET_NET thread #23
-``Created ET_NET thread #24
-``Created ET_NET thread #25
-``Created ET_NET thread #26
-``Created ET_NET thread #27
-``Created ET_NET thread #28
-``Created ET_NET thread #29
-``Created ET_NET thread #30
-``Created ET_NET thread #31
-``Created ET_NET thread #32
-``Created ET_NET thread #33
-``Created ET_NET thread #34
-``Created ET_NET thread #35
-``Created ET_NET thread #36
-``Created ET_NET thread #37
-``Created ET_NET thread #38
-``Created ET_NET thread #39
-``Created ET_NET thread #40
-``Created ET_NET thread #41
-``Created ET_NET thread #42
-``Created ET_NET thread #43
-``Created ET_NET thread #44
-``Created ET_NET thread #45
-``Created ET_NET thread #46
-``Created ET_NET thread #47
-``Created ET_NET thread #48
-``Created ET_NET thread #49
-``Created ET_NET thread #50
-``Created ET_NET thread #51
-``Created ET_NET thread #52
-``Created ET_NET thread #53
-``Created ET_NET thread #54
-``Created ET_NET thread #55
-``Created ET_NET thread #56
-``Created ET_NET thread #57
-``Created ET_NET thread #58
-``Created ET_NET thread #59
-``Created ET_NET thread #60
-``Created ET_NET thread #61
-``Created ET_NET thread #62
-``Created ET_NET thread #63
-``Created ET_NET thread #64
-``Created ET_NET thread #65
-``Created ET_NET thread #66
-``Created ET_NET thread #67
-``Created ET_NET thread #68
-``Created ET_NET thread #69
-``Created ET_NET thread #70
-``Created ET_NET thread #71
-``Created ET_NET thread #72
-``Created ET_NET thread #73
-``Created ET_NET thread #74
-``Created ET_NET thread #75
-``Created ET_NET thread #76
-``Created ET_NET thread #77
-``Created ET_NET thread #78
-``Created ET_NET thread #79
-``Created ET_NET thread #80
-``Created ET_NET thread #81
-``Created ET_NET thread #82
-``Created ET_NET thread #83
-``Created ET_NET thread #84
-``Created ET_NET thread #85
-``Created ET_NET thread #86
-``Created ET_NET thread #87
-``Created ET_NET thread #88
-``Created ET_NET thread #89
-``Created ET_NET thread #90
-``Created ET_NET thread #91
-``Created ET_NET thread #92
-``Created ET_NET thread #93
-``Created ET_NET thread #94
-``Created ET_NET thread #95
-``Created ET_NET thread #96
-``Created ET_NET thread #97
-``Created ET_NET thread #98
-``Created ET_NET thread #99
-``Created ET_NET thread #100
-``Created accept thread #1``
-``Created accept thread #2``
-``Created accept thread #3``
-``Created accept thread #4``
-``Created accept thread #5``
-``Created accept thread #6``
-``Created accept thread #7``
-``Created accept thread #8``
-``Created accept thread #9``
-``Created accept thread #10``
-``
diff --git a/tests/gold_tests/thread_config/gold/thread_1_0.gold b/tests/gold_tests/thread_config/gold/thread_1_0.gold
deleted file mode 100644
index d3e4589..0000000
--- a/tests/gold_tests/thread_config/gold/thread_1_0.gold
+++ /dev/null
@@ -1,2 +0,0 @@
-``Created ET_NET thread #1
-``
diff --git a/tests/gold_tests/thread_config/gold/thread_1_1.gold b/tests/gold_tests/thread_config/gold/thread_1_1.gold
deleted file mode 100644
index 4332375..0000000
--- a/tests/gold_tests/thread_config/gold/thread_1_1.gold
+++ /dev/null
@@ -1,3 +0,0 @@
-``Created ET_NET thread #1
-``Created accept thread #1``
-``
diff --git a/tests/gold_tests/thread_config/gold/thread_1_10.gold b/tests/gold_tests/thread_config/gold/thread_1_10.gold
deleted file mode 100644
index 5bd53db..0000000
--- a/tests/gold_tests/thread_config/gold/thread_1_10.gold
+++ /dev/null
@@ -1,12 +0,0 @@
-``Created ET_NET thread #1
-``Created accept thread #1``
-``Created accept thread #2``
-``Created accept thread #3``
-``Created accept thread #4``
-``Created accept thread #5``
-``Created accept thread #6``
-``Created accept thread #7``
-``Created accept thread #8``
-``Created accept thread #9``
-``Created accept thread #10``
-``
diff --git a/tests/gold_tests/thread_config/gold/thread_2_0.gold b/tests/gold_tests/thread_config/gold/thread_2_0.gold
deleted file mode 100644
index 824ecd5..0000000
--- a/tests/gold_tests/thread_config/gold/thread_2_0.gold
+++ /dev/null
@@ -1,3 +0,0 @@
-``Created ET_NET thread #1
-``Created ET_NET thread #2
-``
diff --git a/tests/gold_tests/thread_config/gold/thread_2_1.gold b/tests/gold_tests/thread_config/gold/thread_2_1.gold
deleted file mode 100644
index 2a9e615..0000000
--- a/tests/gold_tests/thread_config/gold/thread_2_1.gold
+++ /dev/null
@@ -1,4 +0,0 @@
-``Created ET_NET thread #1
-``Created ET_NET thread #2
-``Created accept thread #1``
-``
diff --git a/tests/gold_tests/thread_config/gold/thread_2_10.gold b/tests/gold_tests/thread_config/gold/thread_2_10.gold
deleted file mode 100644
index 866f9d6..0000000
--- a/tests/gold_tests/thread_config/gold/thread_2_10.gold
+++ /dev/null
@@ -1,13 +0,0 @@
-``Created ET_NET thread #1
-``Created ET_NET thread #2
-``Created accept thread #1``
-``Created accept thread #2``
-``Created accept thread #3``
-``Created accept thread #4``
-``Created accept thread #5``
-``Created accept thread #6``
-``Created accept thread #7``
-``Created accept thread #8``
-``Created accept thread #9``
-``Created accept thread #10``
-``
diff --git a/tests/gold_tests/thread_config/gold/thread_32_0.gold b/tests/gold_tests/thread_config/gold/thread_32_0.gold
deleted file mode 100644
index 1927cb8..0000000
--- a/tests/gold_tests/thread_config/gold/thread_32_0.gold
+++ /dev/null
@@ -1,33 +0,0 @@
-``Created ET_NET thread #1
-``Created ET_NET thread #2
-``Created ET_NET thread #3
-``Created ET_NET thread #4
-``Created ET_NET thread #5
-``Created ET_NET thread #6
-``Created ET_NET thread #7
-``Created ET_NET thread #8
-``Created ET_NET thread #9
-``Created ET_NET thread #10
-``Created ET_NET thread #11
-``Created ET_NET thread #12
-``Created ET_NET thread #13
-``Created ET_NET thread #14
-``Created ET_NET thread #15
-``Created ET_NET thread #16
-``Created ET_NET thread #17
-``Created ET_NET thread #18
-``Created ET_NET thread #19
-``Created ET_NET thread #20
-``Created ET_NET thread #21
-``Created ET_NET thread #22
-``Created ET_NET thread #23
-``Created ET_NET thread #24
-``Created ET_NET thread #25
-``Created ET_NET thread #26
-``Created ET_NET thread #27
-``Created ET_NET thread #28
-``Created ET_NET thread #29
-``Created ET_NET thread #30
-``Created ET_NET thread #31
-``Created ET_NET thread #32
-``
diff --git a/tests/gold_tests/thread_config/gold/thread_32_1.gold b/tests/gold_tests/thread_config/gold/thread_32_1.gold
deleted file mode 100644
index 2a705ae..0000000
--- a/tests/gold_tests/thread_config/gold/thread_32_1.gold
+++ /dev/null
@@ -1,34 +0,0 @@
-``Created ET_NET thread #1
-``Created ET_NET thread #2
-``Created ET_NET thread #3
-``Created ET_NET thread #4
-``Created ET_NET thread #5
-``Created ET_NET thread #6
-``Created ET_NET thread #7
-``Created ET_NET thread #8
-``Created ET_NET thread #9
-``Created ET_NET thread #10
-``Created ET_NET thread #11
-``Created ET_NET thread #12
-``Created ET_NET thread #13
-``Created ET_NET thread #14
-``Created ET_NET thread #15
-``Created ET_NET thread #16
-``Created ET_NET thread #17
-``Created ET_NET thread #18
-``Created ET_NET thread #19
-``Created ET_NET thread #20
-``Created ET_NET thread #21
-``Created ET_NET thread #22
-``Created ET_NET thread #23
-``Created ET_NET thread #24
-``Created ET_NET thread #25
-``Created ET_NET thread #26
-``Created ET_NET thread #27
-``Created ET_NET thread #28
-``Created ET_NET thread #29
-``Created ET_NET thread #30
-``Created ET_NET thread #31
-``Created ET_NET thread #32
-``Created accept thread #1``
-``
diff --git a/tests/gold_tests/thread_config/gold/thread_32_10.gold b/tests/gold_tests/thread_config/gold/thread_32_10.gold
deleted file mode 100644
index 1f8d425..0000000
--- a/tests/gold_tests/thread_config/gold/thread_32_10.gold
+++ /dev/null
@@ -1,43 +0,0 @@
-``Created ET_NET thread #1
-``Created ET_NET thread #2
-``Created ET_NET thread #3
-``Created ET_NET thread #4
-``Created ET_NET thread #5
-``Created ET_NET thread #6
-``Created ET_NET thread #7
-``Created ET_NET thread #8
-``Created ET_NET thread #9
-``Created ET_NET thread #10
-``Created ET_NET thread #11
-``Created ET_NET thread #12
-``Created ET_NET thread #13
-``Created ET_NET thread #14
-``Created ET_NET thread #15
-``Created ET_NET thread #16
-``Created ET_NET thread #17
-``Created ET_NET thread #18
-``Created ET_NET thread #19
-``Created ET_NET thread #20
-``Created ET_NET thread #21
-``Created ET_NET thread #22
-``Created ET_NET thread #23
-``Created ET_NET thread #24
-``Created ET_NET thread #25
-``Created ET_NET thread #26
-``Created ET_NET thread #27
-``Created ET_NET thread #28
-``Created ET_NET thread #29
-``Created ET_NET thread #30
-``Created ET_NET thread #31
-``Created ET_NET thread #32
-``Created accept thread #1``
-``Created accept thread #2``
-``Created accept thread #3``
-``Created accept thread #4``
-``Created accept thread #5``
-``Created accept thread #6``
-``Created accept thread #7``
-``Created accept thread #8``
-``Created accept thread #9``
-``Created accept thread #10``
-``
diff --git a/tests/gold_tests/thread_config/thread_100_0.test.py b/tests/gold_tests/thread_config/thread_100_0.test.py
index 3211971..d4577c4 100644
--- a/tests/gold_tests/thread_config/thread_100_0.test.py
+++ b/tests/gold_tests/thread_config/thread_100_0.test.py
@@ -18,7 +18,8 @@
import sys
-Test.Summary = 'Test that Trafficserver starts with default configurations.'
+
+Test.Summary = 'Test that Trafficserver starts with different thread configurations.'
Test.SkipUnless(Condition.HasProgram('curl', 'Curl need to be installed on system for this test to work'))
Test.ContinueOnFail = True
@@ -28,12 +29,13 @@ server = Test.MakeOriginServer('server')
Test.testName = ''
request_header = {
- 'headers': 'GET / HTTP/1.1\r\nHost: www.example.com\r\n\r\n',
- 'timestamp': '1469733493.993',
- 'body': ''}
+ 'headers': 'GET / HTTP/1.1\r\nHost: www.example.com\r\n\r\n',
+ 'timestamp': '1469733493.993',
+ 'body': ''
+}
response_header = {
'headers': 'HTTP/1.1 200 OK\r\nConnection: close\r\n\r\n',
- 'timestamp': '1469733493.993',
+ 'timestamp': '1469733493.993',
'body': ''
}
server.addResponse("sessionfile.log", request_header, response_header)
@@ -50,12 +52,17 @@ ts.Disk.remap_config.AddLine(
'map http://www.example.com http://127.0.0.1:{0}'.format(server.Variables.Port)
)
+ts.Setup.CopyAs('check_threads.py', Test.RunDirectory)
+
tr = Test.AddTestRun()
tr.Processes.Default.Command = 'curl --proxy http://127.0.0.1:{0} http://www.example.com -H "Proxy-Connection: Keep-Alive" --verbose'.format(ts.Variables.port)
tr.Processes.Default.ReturnCode = 0
tr.Processes.Default.StartBefore(ts)
tr.Processes.Default.StartBefore(server)
tr.Processes.Default.Streams.stderr = 'gold/http_200.gold'
-ts.Streams.stderr = 'gold/thread_100_0.gold'
-ts.Streams.stderr += Testers.ExcludesExpression('Created ET\_NET thread #101', 'there should be more than 100 threads')
-ts.Streams.stderr += Testers.ExcludesExpression('Created accept thread #1', 'there should be more than 0 threads')
+tr.StillRunningAfter = server
+tr.StillRunningAfter = ts
+
+tr = Test.AddTestRun()
+tr.Processes.Default.Command = 'python3 check_threads.py -t {0} -e {1} -a {2}'.format(ts.Env['TS_ROOT'], 100, 0)
+tr.Processes.Default.ReturnCode = 0
diff --git a/tests/gold_tests/thread_config/thread_100_1.test.py b/tests/gold_tests/thread_config/thread_100_1.test.py
index 4117143..8a69cc6 100644
--- a/tests/gold_tests/thread_config/thread_100_1.test.py
+++ b/tests/gold_tests/thread_config/thread_100_1.test.py
@@ -18,7 +18,8 @@
import sys
-Test.Summary = 'Test that Trafficserver starts with default configurations.'
+
+Test.Summary = 'Test that Trafficserver starts with different thread configurations.'
Test.SkipUnless(Condition.HasProgram('curl', 'Curl need to be installed on system for this test to work'))
@@ -29,12 +30,13 @@ server = Test.MakeOriginServer('server')
Test.testName = ''
request_header = {
- 'headers': 'GET / HTTP/1.1\r\nHost: www.example.com\r\n\r\n',
- 'timestamp': '1469733493.993',
- 'body': ''}
+ 'headers': 'GET / HTTP/1.1\r\nHost: www.example.com\r\n\r\n',
+ 'timestamp': '1469733493.993',
+ 'body': ''
+}
response_header = {
'headers': 'HTTP/1.1 200 OK\r\nConnection: close\r\n\r\n',
- 'timestamp': '1469733493.993',
+ 'timestamp': '1469733493.993',
'body': ''
}
server.addResponse("sessionfile.log", request_header, response_header)
@@ -51,12 +53,17 @@ ts.Disk.remap_config.AddLine(
'map http://www.example.com http://127.0.0.1:{0}'.format(server.Variables.Port)
)
+ts.Setup.CopyAs('check_threads.py', Test.RunDirectory)
+
tr = Test.AddTestRun()
tr.Processes.Default.Command = 'curl --proxy http://127.0.0.1:{0} http://www.example.com -H "Proxy-Connection: Keep-Alive" --verbose'.format(ts.Variables.port)
tr.Processes.Default.ReturnCode = 0
tr.Processes.Default.StartBefore(ts)
tr.Processes.Default.StartBefore(server)
tr.Processes.Default.Streams.stderr = 'gold/http_200.gold'
-ts.Streams.stderr = 'gold/thread_100_1.gold'
-ts.Streams.stderr += Testers.ExcludesExpression('Created ET\_NET thread #101', 'there should be more than 100 threads')
-ts.Streams.stderr += Testers.ExcludesExpression('Created accept thread #2', 'there should be more than 1 threads')
+tr.StillRunningAfter = server
+tr.StillRunningAfter = ts
+
+tr = Test.AddTestRun()
+tr.Processes.Default.Command = 'python3 check_threads.py -t {0} -e {1} -a {2}'.format(ts.Env['TS_ROOT'], 100, 1)
+tr.Processes.Default.ReturnCode = 0
diff --git a/tests/gold_tests/thread_config/thread_100_10.test.py b/tests/gold_tests/thread_config/thread_100_10.test.py
index b6322ef..cfab5ca 100644
--- a/tests/gold_tests/thread_config/thread_100_10.test.py
+++ b/tests/gold_tests/thread_config/thread_100_10.test.py
@@ -18,7 +18,8 @@
import sys
-Test.Summary = 'Test that Trafficserver starts with default configurations.'
+
+Test.Summary = 'Test that Trafficserver starts with different thread configurations.'
Test.SkipUnless(Condition.HasProgram('curl', 'Curl need to be installed on system for this test to work'))
Test.ContinueOnFail = True
@@ -28,12 +29,13 @@ server = Test.MakeOriginServer('server')
Test.testName = ''
request_header = {
- 'headers': 'GET / HTTP/1.1\r\nHost: www.example.com\r\n\r\n',
- 'timestamp': '1469733493.993',
- 'body': ''}
+ 'headers': 'GET / HTTP/1.1\r\nHost: www.example.com\r\n\r\n',
+ 'timestamp': '1469733493.993',
+ 'body': ''
+}
response_header = {
'headers': 'HTTP/1.1 200 OK\r\nConnection: close\r\n\r\n',
- 'timestamp': '1469733493.993',
+ 'timestamp': '1469733493.993',
'body': ''
}
server.addResponse("sessionfile.log", request_header, response_header)
@@ -50,12 +52,17 @@ ts.Disk.remap_config.AddLine(
'map http://www.example.com http://127.0.0.1:{0}'.format(server.Variables.Port)
)
+ts.Setup.CopyAs('check_threads.py', Test.RunDirectory)
+
tr = Test.AddTestRun()
tr.Processes.Default.Command = 'curl --proxy http://127.0.0.1:{0} http://www.example.com -H "Proxy-Connection: Keep-Alive" --verbose'.format(ts.Variables.port)
tr.Processes.Default.ReturnCode = 0
tr.Processes.Default.StartBefore(ts)
tr.Processes.Default.StartBefore(server)
tr.Processes.Default.Streams.stderr = 'gold/http_200.gold'
-ts.Streams.stderr = 'gold/thread_100_10.gold'
-ts.Streams.stderr += Testers.ExcludesExpression('Created ET\_NET thread #101', 'there should be more than 100 threads')
-ts.Streams.stderr += Testers.ExcludesExpression('Created accept thread #11', 'there should be more than 10 threads')
+tr.StillRunningAfter = server
+tr.StillRunningAfter = ts
+
+tr = Test.AddTestRun()
+tr.Processes.Default.Command = 'python3 check_threads.py -t {0} -e {1} -a {2}'.format(ts.Env['TS_ROOT'], 100, 10)
+tr.Processes.Default.ReturnCode = 0
diff --git a/tests/gold_tests/thread_config/thread_1_0.test.py b/tests/gold_tests/thread_config/thread_1_0.test.py
index e423a1f..5b29c28 100644
--- a/tests/gold_tests/thread_config/thread_1_0.test.py
+++ b/tests/gold_tests/thread_config/thread_1_0.test.py
@@ -18,7 +18,8 @@
import sys
-Test.Summary = 'Test that Trafficserver starts with default configurations.'
+
+Test.Summary = 'Test that Trafficserver starts with different thread configurations.'
Test.SkipUnless(Condition.HasProgram('curl', 'Curl need to be installed on system for this test to work'))
Test.ContinueOnFail = True
@@ -28,12 +29,13 @@ server = Test.MakeOriginServer('server')
Test.testName = ''
request_header = {
- 'headers': 'GET / HTTP/1.1\r\nHost: www.example.com\r\n\r\n',
- 'timestamp': '1469733493.993',
- 'body': ''}
+ 'headers': 'GET / HTTP/1.1\r\nHost: www.example.com\r\n\r\n',
+ 'timestamp': '1469733493.993',
+ 'body': ''
+}
response_header = {
'headers': 'HTTP/1.1 200 OK\r\nConnection: close\r\n\r\n',
- 'timestamp': '1469733493.993',
+ 'timestamp': '1469733493.993',
'body': ''
}
server.addResponse("sessionfile.log", request_header, response_header)
@@ -50,12 +52,17 @@ ts.Disk.remap_config.AddLine(
'map http://www.example.com http://127.0.0.1:{0}'.format(server.Variables.Port)
)
+ts.Setup.CopyAs('check_threads.py', Test.RunDirectory)
+
tr = Test.AddTestRun()
tr.Processes.Default.Command = 'curl --proxy http://127.0.0.1:{0} http://www.example.com -H "Proxy-Connection: Keep-Alive" --verbose'.format(ts.Variables.port)
tr.Processes.Default.ReturnCode = 0
tr.Processes.Default.StartBefore(ts)
tr.Processes.Default.StartBefore(server)
tr.Processes.Default.Streams.stderr = 'gold/http_200.gold'
-ts.Streams.stderr = 'gold/thread_1_0.gold'
-ts.Streams.stderr += Testers.ExcludesExpression('Created ET\_NET thread #2', 'there should be more than 1 threads')
-ts.Streams.stderr += Testers.ExcludesExpression('Created accept thread #1', 'there should be more than 0 threads')
+tr.StillRunningAfter = server
+tr.StillRunningAfter = ts
+
+tr = Test.AddTestRun()
+tr.Processes.Default.Command = 'python3 check_threads.py -t {0} -e {1} -a {2}'.format(ts.Env['TS_ROOT'], 1, 0)
+tr.Processes.Default.ReturnCode = 0
diff --git a/tests/gold_tests/thread_config/thread_1_1.test.py b/tests/gold_tests/thread_config/thread_1_1.test.py
index 414b585..7517680 100644
--- a/tests/gold_tests/thread_config/thread_1_1.test.py
+++ b/tests/gold_tests/thread_config/thread_1_1.test.py
@@ -18,7 +18,8 @@
import sys
-Test.Summary = 'Test that Trafficserver starts with default configurations.'
+
+Test.Summary = 'Test that Trafficserver starts with different thread configurations.'
Test.SkipUnless(Condition.HasProgram('curl', 'Curl need to be installed on system for this test to work'))
Test.ContinueOnFail = True
@@ -28,12 +29,13 @@ server = Test.MakeOriginServer('server')
Test.testName = ''
request_header = {
- 'headers': 'GET / HTTP/1.1\r\nHost: www.example.com\r\n\r\n',
- 'timestamp': '1469733493.993',
- 'body': ''}
+ 'headers': 'GET / HTTP/1.1\r\nHost: www.example.com\r\n\r\n',
+ 'timestamp': '1469733493.993',
+ 'body': ''
+}
response_header = {
'headers': 'HTTP/1.1 200 OK\r\nConnection: close\r\n\r\n',
- 'timestamp': '1469733493.993',
+ 'timestamp': '1469733493.993',
'body': ''
}
server.addResponse("sessionfile.log", request_header, response_header)
@@ -50,12 +52,17 @@ ts.Disk.remap_config.AddLine(
'map http://www.example.com http://127.0.0.1:{0}'.format(server.Variables.Port)
)
+ts.Setup.CopyAs('check_threads.py', Test.RunDirectory)
+
tr = Test.AddTestRun()
tr.Processes.Default.Command = 'curl --proxy http://127.0.0.1:{0} http://www.example.com -H "Proxy-Connection: Keep-Alive" --verbose'.format(ts.Variables.port)
tr.Processes.Default.ReturnCode = 0
tr.Processes.Default.StartBefore(ts)
tr.Processes.Default.StartBefore(server)
tr.Processes.Default.Streams.stderr = 'gold/http_200.gold'
-ts.Streams.stderr = 'gold/thread_1_1.gold'
-ts.Streams.stderr += Testers.ExcludesExpression('Created ET\_NET thread #2', 'there should be more than 1 threads')
-ts.Streams.stderr += Testers.ExcludesExpression('Created accept thread #2', 'there should be more than 1 threads')
+tr.StillRunningAfter = server
+tr.StillRunningAfter = ts
+
+tr = Test.AddTestRun()
+tr.Processes.Default.Command = 'python3 check_threads.py -t {0} -e {1} -a {2}'.format(ts.Env['TS_ROOT'], 1, 1)
+tr.Processes.Default.ReturnCode = 0
diff --git a/tests/gold_tests/thread_config/thread_1_10.test.py b/tests/gold_tests/thread_config/thread_1_10.test.py
index 4c7c7e9..0f68cfd 100644
--- a/tests/gold_tests/thread_config/thread_1_10.test.py
+++ b/tests/gold_tests/thread_config/thread_1_10.test.py
@@ -18,7 +18,8 @@
import sys
-Test.Summary = 'Test that Trafficserver starts with default configurations.'
+
+Test.Summary = 'Test that Trafficserver starts with different thread configurations.'
Test.SkipUnless(Condition.HasProgram('curl', 'Curl need to be installed on system for this test to work'))
Test.ContinueOnFail = True
@@ -28,12 +29,13 @@ server = Test.MakeOriginServer('server')
Test.testName = ''
request_header = {
- 'headers': 'GET / HTTP/1.1\r\nHost: www.example.com\r\n\r\n',
- 'timestamp': '1469733493.993',
- 'body': ''}
+ 'headers': 'GET / HTTP/1.1\r\nHost: www.example.com\r\n\r\n',
+ 'timestamp': '1469733493.993',
+ 'body': ''
+}
response_header = {
'headers': 'HTTP/1.1 200 OK\r\nConnection: close\r\n\r\n',
- 'timestamp': '1469733493.993',
+ 'timestamp': '1469733493.993',
'body': ''
}
server.addResponse("sessionfile.log", request_header, response_header)
@@ -50,12 +52,17 @@ ts.Disk.remap_config.AddLine(
'map http://www.example.com http://127.0.0.1:{0}'.format(server.Variables.Port)
)
+ts.Setup.CopyAs('check_threads.py', Test.RunDirectory)
+
tr = Test.AddTestRun()
tr.Processes.Default.Command = 'curl --proxy http://127.0.0.1:{0} http://www.example.com -H "Proxy-Connection: Keep-Alive" --verbose'.format(ts.Variables.port)
tr.Processes.Default.ReturnCode = 0
tr.Processes.Default.StartBefore(ts)
tr.Processes.Default.StartBefore(server)
tr.Processes.Default.Streams.stderr = 'gold/http_200.gold'
-ts.Streams.stderr = 'gold/thread_1_10.gold'
-ts.Streams.stderr += Testers.ExcludesExpression('Created ET\_NET thread #2', 'there should be more than 1 threads')
-ts.Streams.stderr += Testers.ExcludesExpression('Created accept thread #11', 'there should be more than 10 threads')
+tr.StillRunningAfter = server
+tr.StillRunningAfter = ts
+
+tr = Test.AddTestRun()
+tr.Processes.Default.Command = 'python3 check_threads.py -t {0} -e {1} -a {2}'.format(ts.Env['TS_ROOT'], 1, 10)
+tr.Processes.Default.ReturnCode = 0
diff --git a/tests/gold_tests/thread_config/thread_2_0.test.py b/tests/gold_tests/thread_config/thread_2_0.test.py
index d642c6e..06506c5 100644
--- a/tests/gold_tests/thread_config/thread_2_0.test.py
+++ b/tests/gold_tests/thread_config/thread_2_0.test.py
@@ -18,7 +18,8 @@
import sys
-Test.Summary = 'Test that Trafficserver starts with default configurations.'
+
+Test.Summary = 'Test that Trafficserver starts with different thread configurations.'
Test.SkipUnless(Condition.HasProgram('curl', 'Curl need to be installed on system for this test to work'))
Test.ContinueOnFail = True
@@ -28,12 +29,13 @@ server = Test.MakeOriginServer('server')
Test.testName = ''
request_header = {
- 'headers': 'GET / HTTP/1.1\r\nHost: www.example.com\r\n\r\n',
- 'timestamp': '1469733493.993',
- 'body': ''}
+ 'headers': 'GET / HTTP/1.1\r\nHost: www.example.com\r\n\r\n',
+ 'timestamp': '1469733493.993',
+ 'body': ''
+}
response_header = {
'headers': 'HTTP/1.1 200 OK\r\nConnection: close\r\n\r\n',
- 'timestamp': '1469733493.993',
+ 'timestamp': '1469733493.993',
'body': ''
}
server.addResponse("sessionfile.log", request_header, response_header)
@@ -50,12 +52,17 @@ ts.Disk.remap_config.AddLine(
'map http://www.example.com http://127.0.0.1:{0}'.format(server.Variables.Port)
)
+ts.Setup.CopyAs('check_threads.py', Test.RunDirectory)
+
tr = Test.AddTestRun()
tr.Processes.Default.Command = 'curl --proxy http://127.0.0.1:{0} http://www.example.com -H "Proxy-Connection: Keep-Alive" --verbose'.format(ts.Variables.port)
tr.Processes.Default.ReturnCode = 0
tr.Processes.Default.StartBefore(ts)
tr.Processes.Default.StartBefore(server)
tr.Processes.Default.Streams.stderr = 'gold/http_200.gold'
-ts.Streams.stderr = 'gold/thread_2_0.gold'
-ts.Streams.stderr += Testers.ExcludesExpression('Created ET\_NET thread #3', 'there should be more than 2 threads')
-ts.Streams.stderr += Testers.ExcludesExpression('Created accept thread #1', 'there should be more than 0 threads')
+tr.StillRunningAfter = server
+tr.StillRunningAfter = ts
+
+tr = Test.AddTestRun()
+tr.Processes.Default.Command = 'python3 check_threads.py -t {0} -e {1} -a {2}'.format(ts.Env['TS_ROOT'], 2, 0)
+tr.Processes.Default.ReturnCode = 0
diff --git a/tests/gold_tests/thread_config/thread_2_1.test.py b/tests/gold_tests/thread_config/thread_2_1.test.py
index 81cc672..6eaa78d 100644
--- a/tests/gold_tests/thread_config/thread_2_1.test.py
+++ b/tests/gold_tests/thread_config/thread_2_1.test.py
@@ -18,7 +18,8 @@
import sys
-Test.Summary = 'Test that Trafficserver starts with default configurations.'
+
+Test.Summary = 'Test that Trafficserver starts with different thread configurations.'
Test.SkipUnless(Condition.HasProgram('curl', 'Curl need to be installed on system for this test to work'))
Test.ContinueOnFail = True
@@ -28,12 +29,13 @@ server = Test.MakeOriginServer('server')
Test.testName = ''
request_header = {
- 'headers': 'GET / HTTP/1.1\r\nHost: www.example.com\r\n\r\n',
- 'timestamp': '1469733493.993',
- 'body': ''}
+ 'headers': 'GET / HTTP/1.1\r\nHost: www.example.com\r\n\r\n',
+ 'timestamp': '1469733493.993',
+ 'body': ''
+}
response_header = {
'headers': 'HTTP/1.1 200 OK\r\nConnection: close\r\n\r\n',
- 'timestamp': '1469733493.993',
+ 'timestamp': '1469733493.993',
'body': ''
}
server.addResponse("sessionfile.log", request_header, response_header)
@@ -50,12 +52,17 @@ ts.Disk.remap_config.AddLine(
'map http://www.example.com http://127.0.0.1:{0}'.format(server.Variables.Port)
)
+ts.Setup.CopyAs('check_threads.py', Test.RunDirectory)
+
tr = Test.AddTestRun()
tr.Processes.Default.Command = 'curl --proxy http://127.0.0.1:{0} http://www.example.com -H "Proxy-Connection: Keep-Alive" --verbose'.format(ts.Variables.port)
tr.Processes.Default.ReturnCode = 0
tr.Processes.Default.StartBefore(ts)
tr.Processes.Default.StartBefore(server)
tr.Processes.Default.Streams.stderr = 'gold/http_200.gold'
-ts.Streams.stderr = 'gold/thread_2_1.gold'
-ts.Streams.stderr += Testers.ExcludesExpression('Created ET\_NET thread #3', 'there should be more than 2 threads')
-ts.Streams.stderr += Testers.ExcludesExpression('Created accept thread #2', 'there should be more than 1 threads')
+tr.StillRunningAfter = server
+tr.StillRunningAfter = ts
+
+tr = Test.AddTestRun()
+tr.Processes.Default.Command = 'python3 check_threads.py -t {0} -e {1} -a {2}'.format(ts.Env['TS_ROOT'], 2, 1)
+tr.Processes.Default.ReturnCode = 0
diff --git a/tests/gold_tests/thread_config/thread_2_10.test.py b/tests/gold_tests/thread_config/thread_2_10.test.py
index 79de9a1..c8042b6 100644
--- a/tests/gold_tests/thread_config/thread_2_10.test.py
+++ b/tests/gold_tests/thread_config/thread_2_10.test.py
@@ -18,7 +18,8 @@
import sys
-Test.Summary = 'Test that Trafficserver starts with default configurations.'
+
+Test.Summary = 'Test that Trafficserver starts with different thread configurations.'
Test.SkipUnless(Condition.HasProgram('curl', 'Curl need to be installed on system for this test to work'))
Test.ContinueOnFail = True
@@ -28,12 +29,13 @@ server = Test.MakeOriginServer('server')
Test.testName = ''
request_header = {
- 'headers': 'GET / HTTP/1.1\r\nHost: www.example.com\r\n\r\n',
- 'timestamp': '1469733493.993',
- 'body': ''}
+ 'headers': 'GET / HTTP/1.1\r\nHost: www.example.com\r\n\r\n',
+ 'timestamp': '1469733493.993',
+ 'body': ''
+}
response_header = {
'headers': 'HTTP/1.1 200 OK\r\nConnection: close\r\n\r\n',
- 'timestamp': '1469733493.993',
+ 'timestamp': '1469733493.993',
'body': ''
}
server.addResponse("sessionfile.log", request_header, response_header)
@@ -50,12 +52,17 @@ ts.Disk.remap_config.AddLine(
'map http://www.example.com http://127.0.0.1:{0}'.format(server.Variables.Port)
)
+ts.Setup.CopyAs('check_threads.py', Test.RunDirectory)
+
tr = Test.AddTestRun()
tr.Processes.Default.Command = 'curl --proxy http://127.0.0.1:{0} http://www.example.com -H "Proxy-Connection: Keep-Alive" --verbose'.format(ts.Variables.port)
tr.Processes.Default.ReturnCode = 0
tr.Processes.Default.StartBefore(ts)
tr.Processes.Default.StartBefore(server)
tr.Processes.Default.Streams.stderr = 'gold/http_200.gold'
-ts.Streams.stderr = 'gold/thread_2_10.gold'
-ts.Streams.stderr += Testers.ExcludesExpression('Created ET\_NET thread #3', 'there should be more than 2 threads')
-ts.Streams.stderr += Testers.ExcludesExpression('Created accept thread #11', 'there should be more than 10 threads')
+tr.StillRunningAfter = server
+tr.StillRunningAfter = ts
+
+tr = Test.AddTestRun()
+tr.Processes.Default.Command = 'python3 check_threads.py -t {0} -e {1} -a {2}'.format(ts.Env['TS_ROOT'], 2, 10)
+tr.Processes.Default.ReturnCode = 0
diff --git a/tests/gold_tests/thread_config/thread_32_0.test.py b/tests/gold_tests/thread_config/thread_32_0.test.py
index 3f874af..21adbb4 100644
--- a/tests/gold_tests/thread_config/thread_32_0.test.py
+++ b/tests/gold_tests/thread_config/thread_32_0.test.py
@@ -18,7 +18,8 @@
import sys
-Test.Summary = 'Test that Trafficserver starts with default configurations.'
+
+Test.Summary = 'Test that Trafficserver starts with different thread configurations.'
Test.SkipUnless(Condition.HasProgram('curl', 'Curl need to be installed on system for this test to work'))
Test.ContinueOnFail = True
@@ -28,12 +29,13 @@ server = Test.MakeOriginServer('server')
Test.testName = ''
request_header = {
- 'headers': 'GET / HTTP/1.1\r\nHost: www.example.com\r\n\r\n',
- 'timestamp': '1469733493.993',
- 'body': ''}
+ 'headers': 'GET / HTTP/1.1\r\nHost: www.example.com\r\n\r\n',
+ 'timestamp': '1469733493.993',
+ 'body': ''
+}
response_header = {
'headers': 'HTTP/1.1 200 OK\r\nConnection: close\r\n\r\n',
- 'timestamp': '1469733493.993',
+ 'timestamp': '1469733493.993',
'body': ''
}
server.addResponse("sessionfile.log", request_header, response_header)
@@ -50,12 +52,17 @@ ts.Disk.remap_config.AddLine(
'map http://www.example.com http://127.0.0.1:{0}'.format(server.Variables.Port)
)
+ts.Setup.CopyAs('check_threads.py', Test.RunDirectory)
+
tr = Test.AddTestRun()
tr.Processes.Default.Command = 'curl --proxy http://127.0.0.1:{0} http://www.example.com -H "Proxy-Connection: Keep-Alive" --verbose'.format(ts.Variables.port)
tr.Processes.Default.ReturnCode = 0
tr.Processes.Default.StartBefore(ts)
tr.Processes.Default.StartBefore(server)
tr.Processes.Default.Streams.stderr = 'gold/http_200.gold'
-ts.Streams.stderr = 'gold/thread_32_0.gold'
-ts.Streams.stderr += Testers.ExcludesExpression('Created ET\_NET thread #33', 'there should be more than 32 threads')
-ts.Streams.stderr += Testers.ExcludesExpression('Created accept thread #1', 'there should be more than 0 threads')
+tr.StillRunningAfter = server
+tr.StillRunningAfter = ts
+
+tr = Test.AddTestRun()
+tr.Processes.Default.Command = 'python3 check_threads.py -t {0} -e {1} -a {2}'.format(ts.Env['TS_ROOT'], 32, 0)
+tr.Processes.Default.ReturnCode = 0
diff --git a/tests/gold_tests/thread_config/thread_32_1.test.py b/tests/gold_tests/thread_config/thread_32_1.test.py
index 09026af..5a7a3d8 100644
--- a/tests/gold_tests/thread_config/thread_32_1.test.py
+++ b/tests/gold_tests/thread_config/thread_32_1.test.py
@@ -18,7 +18,8 @@
import sys
-Test.Summary = 'Test that Trafficserver starts with default configurations.'
+
+Test.Summary = 'Test that Trafficserver starts with different thread configurations.'
Test.SkipUnless(Condition.HasProgram('curl', 'Curl need to be installed on system for this test to work'))
Test.ContinueOnFail = True
@@ -28,12 +29,13 @@ server = Test.MakeOriginServer('server')
Test.testName = ''
request_header = {
- 'headers': 'GET / HTTP/1.1\r\nHost: www.example.com\r\n\r\n',
- 'timestamp': '1469733493.993',
- 'body': ''}
+ 'headers': 'GET / HTTP/1.1\r\nHost: www.example.com\r\n\r\n',
+ 'timestamp': '1469733493.993',
+ 'body': ''
+}
response_header = {
'headers': 'HTTP/1.1 200 OK\r\nConnection: close\r\n\r\n',
- 'timestamp': '1469733493.993',
+ 'timestamp': '1469733493.993',
'body': ''
}
server.addResponse("sessionfile.log", request_header, response_header)
@@ -50,12 +52,17 @@ ts.Disk.remap_config.AddLine(
'map http://www.example.com http://127.0.0.1:{0}'.format(server.Variables.Port)
)
+ts.Setup.CopyAs('check_threads.py', Test.RunDirectory)
+
tr = Test.AddTestRun()
tr.Processes.Default.Command = 'curl --proxy http://127.0.0.1:{0} http://www.example.com -H "Proxy-Connection: Keep-Alive" --verbose'.format(ts.Variables.port)
tr.Processes.Default.ReturnCode = 0
tr.Processes.Default.StartBefore(ts)
tr.Processes.Default.StartBefore(server)
tr.Processes.Default.Streams.stderr = 'gold/http_200.gold'
-ts.Streams.stderr = 'gold/thread_32_1.gold'
-ts.Streams.stderr += Testers.ExcludesExpression('Created ET\_NET thread #33', 'there should be more than 32 threads')
-ts.Streams.stderr += Testers.ExcludesExpression('Created accept thread #2', 'there should be more than 1 threads')
+tr.StillRunningAfter = server
+tr.StillRunningAfter = ts
+
+tr = Test.AddTestRun()
+tr.Processes.Default.Command = 'python3 check_threads.py -t {0} -e {1} -a {2}'.format(ts.Env['TS_ROOT'], 32, 1)
+tr.Processes.Default.ReturnCode = 0
diff --git a/tests/gold_tests/thread_config/thread_32_10.test.py b/tests/gold_tests/thread_config/thread_32_10.test.py
index 4bb7580..32a066a 100644
--- a/tests/gold_tests/thread_config/thread_32_10.test.py
+++ b/tests/gold_tests/thread_config/thread_32_10.test.py
@@ -18,7 +18,8 @@
import sys
-Test.Summary = 'Test that Trafficserver starts with default configurations.'
+
+Test.Summary = 'Test that Trafficserver starts with different thread configurations.'
Test.SkipUnless(Condition.HasProgram('curl', 'Curl need to be installed on system for this test to work'))
Test.ContinueOnFail = True
@@ -28,12 +29,13 @@ server = Test.MakeOriginServer('server')
Test.testName = ''
request_header = {
- 'headers': 'GET / HTTP/1.1\r\nHost: www.example.com\r\n\r\n',
- 'timestamp': '1469733493.993',
- 'body': ''}
+ 'headers': 'GET / HTTP/1.1\r\nHost: www.example.com\r\n\r\n',
+ 'timestamp': '1469733493.993',
+ 'body': ''
+}
response_header = {
'headers': 'HTTP/1.1 200 OK\r\nConnection: close\r\n\r\n',
- 'timestamp': '1469733493.993',
+ 'timestamp': '1469733493.993',
'body': ''
}
server.addResponse("sessionfile.log", request_header, response_header)
@@ -50,12 +52,17 @@ ts.Disk.remap_config.AddLine(
'map http://www.example.com http://127.0.0.1:{0}'.format(server.Variables.Port)
)
+ts.Setup.CopyAs('check_threads.py', Test.RunDirectory)
+
tr = Test.AddTestRun()
tr.Processes.Default.Command = 'curl --proxy http://127.0.0.1:{0} http://www.example.com -H "Proxy-Connection: Keep-Alive" --verbose'.format(ts.Variables.port)
tr.Processes.Default.ReturnCode = 0
tr.Processes.Default.StartBefore(ts)
tr.Processes.Default.StartBefore(server)
tr.Processes.Default.Streams.stderr = 'gold/http_200.gold'
-ts.Streams.stderr = 'gold/thread_32_10.gold'
-ts.Streams.stderr += Testers.ExcludesExpression('Created ET\_NET thread #33', 'there should be more than 32 threads')
-ts.Streams.stderr += Testers.ExcludesExpression('Created accept thread #11', 'there should be more than 10 threads')
+tr.StillRunningAfter = server
+tr.StillRunningAfter = ts
+
+tr = Test.AddTestRun()
+tr.Processes.Default.Command = 'python3 check_threads.py -t {0} -e {1} -a {2}'.format(ts.Env['TS_ROOT'], 32, 10)
+tr.Processes.Default.ReturnCode = 0
--
To stop receiving notification emails like this one, please contact
dagit@apache.org.