summaryrefslogtreecommitdiff
path: root/tools/mergestatus.py
diff options
context:
space:
mode:
authorMagnus Ahltorp <map@kth.se>2017-02-06 15:08:42 +0100
committerMagnus Ahltorp <map@kth.se>2017-02-06 15:08:42 +0100
commit8c1e3ac28cbb902b540f776886a6556c40d3f601 (patch)
tree2e629effbfc5000c656b0fbe0389af56dbcfafff /tools/mergestatus.py
parent8a1f3a5f5b1458aceb7567add95e7637e9c2e5fc (diff)
Wait for merge in tests
Diffstat (limited to 'tools/mergestatus.py')
-rwxr-xr-xtools/mergestatus.py46
1 files changed, 46 insertions, 0 deletions
diff --git a/tools/mergestatus.py b/tools/mergestatus.py
new file mode 100755
index 0000000..80d755e
--- /dev/null
+++ b/tools/mergestatus.py
@@ -0,0 +1,46 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2017, NORDUnet A/S.
+# See LICENSE for licensing information.
+#
+import sys
+import json
+import urllib2
+import time
+import requests
+import base64
+from base64 import b64encode
+from mergetools import parse_args, get_nfetched, hexencode, hexdecode, \
+ get_logorder, get_sth
+from certtools import create_ssl_context, get_public_key_from_file, \
+ timing_point, create_sth_signature, write_file, check_sth_signature, \
+ build_merkle_tree
+
+def main():
+ args, config, localconfig = parse_args()
+ paths = localconfig["paths"]
+ mergenodes = config.get("mergenodes", [])
+ mergedb = paths["mergedb"]
+ sthfile = mergedb + "/sth"
+ currentsizefile = mergedb + "/fetched"
+
+ sth = json.loads(open(sthfile, "r").read())
+ currentsize = json.loads(open(currentsizefile, "r").read())
+
+ print >>sys.stderr, currentsize["index"]+1,
+
+ for mergenode in mergenodes:
+ if mergenode["name"] == config["primarymergenode"]:
+ continue
+ verifiedfile = mergedb + "/verified." + mergenode["name"]
+ try:
+ tree = json.loads(open(verifiedfile, "r").read())
+ print >>sys.stderr, tree["tree_size"],
+ except (IOError, ValueError):
+ pass
+ print >>sys.stderr, sth["tree_size"],
+ print
+
+if __name__ == '__main__':
+ sys.exit(main())