You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2013/04/01 23:14:24 UTC

[1/2] git commit: TS-1789 Script to compare RecordsConfig.cc default values with records.config.default.in

Updated Branches:
  refs/heads/master 78197f392 -> 0af1d8acc


TS-1789  Script to compare RecordsConfig.cc default values with records.config.default.in


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/8fdd369b
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/8fdd369b
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/8fdd369b

Branch: refs/heads/master
Commit: 8fdd369b59d42bd487f212ffafaf0876a6941251
Parents: 78197f3
Author: Mark Harrison <mark at mivok dot net>
Authored: Mon Apr 1 15:11:09 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Mon Apr 1 15:11:09 2013 -0600

----------------------------------------------------------------------
 contrib/python/compare_RecordsConfigcc.py |   87 ++++++++++++++++++++++++
 1 files changed, 87 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8fdd369b/contrib/python/compare_RecordsConfigcc.py
----------------------------------------------------------------------
diff --git a/contrib/python/compare_RecordsConfigcc.py b/contrib/python/compare_RecordsConfigcc.py
new file mode 100644
index 0000000..24aeb6a
--- /dev/null
+++ b/contrib/python/compare_RecordsConfigcc.py
@@ -0,0 +1,87 @@
+#!/usr/bin/env python
+#
+# 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 re
+import sys
+
+try:
+    src_dir = sys.argv[1]
+except IndexError:
+    print "Usage: %s [trafficserver_source_dir]" % sys.argv[0]
+    print "Compares values in RecordsConfig.cc with the default records.config file"
+    sys.exit(1)
+
+cc_re = re.compile(r'\{RECT_(?:CONFIG|LOCAL), "([^"]+)", RECD_([A-Z]+), "([^"]+)",')
+cc_re_2 = re.compile(r'\{RECT_(?:CONFIG|LOCAL), "([^"]+)", RECD_([A-Z]+), (NULL),')
+in_re = re.compile(r'(?:CONFIG|LOCAL) (\S+)\s+(\S+)\s+(\S+)')
+
+# We expect these keys to differ between files, so ignore them
+ignore_keys = {
+    "proxy.config.ssl.server.cert.path": 1,
+    "proxy.config.admin.user_id": 1,
+    "proxy.config.ssl.client.cert.path": 1,
+    "proxy.config.alarm_email": 1,
+    "proxy.config.log.logfile_dir": 1,
+    "proxy.config.ssl.CA.cert.path": 1,
+    "proxy.config.ssl.server.private_key.path": 1,
+    "proxy.config.ssl.client.CA.cert.path": 1,
+    "proxy.config.ssl.server.private_key.path": 1,
+    "proxy.config.ssl.client.CA.cert.path": 1,
+    "proxy.config.config_dir": 1,
+    "proxy.config.proxy_name": 1,
+    "proxy.config.cluster.ethernet_interface": 1,
+    "proxy.config.ssl.client.private_key.path": 1,
+    "proxy.config.net.defer_accept": 1 # Specified in RecordsConfig.cc funny
+}
+
+# RecordsConfig.cc values
+rc_cc = {}
+# records.config.in values
+rc_in = {}
+
+# Process RecordsConfig.cc
+fh = open("%s/mgmt/RecordsConfig.cc" % src_dir)
+for line in fh:
+    m = cc_re.search(line)
+    if not m:
+        m = cc_re_2.search(line)
+    if m:
+        rc_cc[m.group(1)] = (m.group(2), m.group(3))
+
+fh.close()
+
+# Process records.config.default.in
+fh = open("%s/proxy/config/records.config.default.in" % src_dir)
+for line in fh:
+    m = in_re.match(line)
+    if m:
+        rc_in[m.group(1)] = (m.group(2), m.group(3))
+fh.close()
+
+# Compare the two
+# If a value is in RecordsConfig.cc  and not records.config.default.in, it is
+# ignored right now.
+print "# RecordsConfig.cc -> records.config.default.in"
+for key in rc_in:
+    if key in ignore_keys:
+        continue
+    if key not in rc_cc:
+        print "%s missing -> %s" % (key, "%s %s" % rc_in[key])
+        continue
+    if rc_cc[key] != rc_in[key]:
+        print "%s : %s -> %s" % (key, "%s %s" % rc_cc[key], "%s %s" % rc_in[key])


[2/2] git commit: Added TS-1789.

Posted by zw...@apache.org.
Added TS-1789.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/0af1d8ac
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/0af1d8ac
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/0af1d8ac

Branch: refs/heads/master
Commit: 0af1d8acc14dd7dc4bd123ada941482b0c74e7b7
Parents: 8fdd369
Author: Leif Hedstrom <zw...@apache.org>
Authored: Mon Apr 1 15:14:12 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Mon Apr 1 15:14:12 2013 -0600

----------------------------------------------------------------------
 CHANGES |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0af1d8ac/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index a7f5aba..4880ea9 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,9 @@
   Changes with Apache Traffic Server 3.3.2
 
 
+  *) [TS-1789] Script to compare RecordsConfig.cc default values with
+   records.config.default.in: Author: Mark Harrison.
+
   *) [TS-1631] Mgmt API to clear stats does not actually clear it.
    Author: Yakov Kopel.