Commit a875f56c authored by Kirill Smelkov's avatar Kirill Smelkov

Merge branch 'master' into t

* master:
  go/neo/t/neotest: Use python -c 'print ...' in a way that works on both py2 and py3
  go/neo/t/tzodb.py: Fix zhash for Python3
parents 0bf5ec6b 789c9ed9
#!/bin/bash -e #!/bin/bash -e
# neotest: run tests and benchmarks against FileStorage, ZEO and various NEO/py and NEO/go clusters # neotest: run tests and benchmarks against FileStorage, ZEO and various NEO/py and NEO/go clusters
# Copyright (C) 2017-2021 Nexedi SA and Contributors. # Copyright (C) 2017-2022 Nexedi SA and Contributors.
# Kirill Smelkov <kirr@nexedi.com> # Kirill Smelkov <kirr@nexedi.com>
# #
# This program is free software: you can Use, Study, Modify and Redistribute # This program is free software: you can Use, Study, Modify and Redistribute
...@@ -567,7 +567,7 @@ proginfo() { ...@@ -567,7 +567,7 @@ proginfo() {
# fkghz file - extract value from file (in KHz) and render it as GHz # fkghz file - extract value from file (in KHz) and render it as GHz
fkghz() { fkghz() {
python -c "print '%.2fGHz' % (`cat $1` / 1E6)" python -c "print('%.2fGHz' % (`cat $1` / 1E6))"
} }
# lspci1 <pcidev> <field> - show <field> from lspci information about <pcidev> # lspci1 <pcidev> <field> - show <field> from lspci information about <pcidev>
...@@ -860,7 +860,7 @@ system_info() { ...@@ -860,7 +860,7 @@ system_info() {
s+=", txqlen=`cat $nic/tx_queue_len`" s+=", txqlen=`cat $nic/tx_queue_len`"
if test -e $nic/gro_flush_timeout ; then if test -e $nic/gro_flush_timeout ; then
tgroflush_ns=`cat $nic/gro_flush_timeout` tgroflush_ns=`cat $nic/gro_flush_timeout`
s+=", gro_flush_timeout=`python -c "print '%.3f' % ($tgroflush_ns / 1E3)"`µs" s+=", gro_flush_timeout=`python -c "print('%.3f' % ($tgroflush_ns / 1E3))"`µs"
else else
s+=", !gro_flush_timeout" s+=", !gro_flush_timeout"
fi fi
...@@ -879,7 +879,7 @@ system_info() { ...@@ -879,7 +879,7 @@ system_info() {
printf "%-20s" "sw/python:"; proginfo python --version 2>&1 # https://bugs.python.org/issue18338 printf "%-20s" "sw/python:"; proginfo python --version 2>&1 # https://bugs.python.org/issue18338
printf "%-20s" "sw/go:"; proginfo go version printf "%-20s" "sw/go:"; proginfo go version
printf "%-20s" "sw/sqlite:"; proginfo python -c \ printf "%-20s" "sw/sqlite:"; proginfo python -c \
'import sqlite3 as s; print "sqlite %s (py mod %s)" % (s.sqlite_version, s.version)' 'import sqlite3 as s; print("sqlite %s (py mod %s)" % (s.sqlite_version, s.version))'
printf "%-20s" "sw/mysqld:"; proginfo mysqld --version printf "%-20s" "sw/mysqld:"; proginfo mysqld --version
pyver neoppod neo pyver neoppod neo
...@@ -1024,7 +1024,7 @@ Benchmark$1-avg 1 \\3 \\4/op\ ...@@ -1024,7 +1024,7 @@ Benchmark$1-avg 1 \\3 \\4/op\
# hostof <url> - return hostname part of <url> # hostof <url> - return hostname part of <url>
hostof() { hostof() {
url=$1 url=$1
python -c "import urlparse as p; u=p.urlparse(\"scheme://$url\"); print u.hostname" python -c "import urlparse as p; u=p.urlparse(\"scheme://$url\"); print(u.hostname)"
} }
# bench_net <url> - benchmark network # bench_net <url> - benchmark network
......
#!/usr/bin/env python #!/usr/bin/env python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright (C) 2017-2018 Nexedi SA and Contributors. # Copyright (C) 2017-2022 Nexedi SA and Contributors.
# Kirill Smelkov <kirr@nexedi.com> # Kirill Smelkov <kirr@nexedi.com>
# #
# This program is free software: you can Use, Study, Modify and Redistribute # This program is free software: you can Use, Study, Modify and Redistribute
...@@ -56,7 +56,7 @@ def zhash(): ...@@ -56,7 +56,7 @@ def zhash():
exit(1) exit(1)
try: try:
optv, argv = getopt(sys.argv[2:], "h", ["help", "check=", "bench="] + hashRegistry.keys()) optv, argv = getopt(sys.argv[2:], "h", ["help", "check=", "bench="] + list(hashRegistry.keys()))
except GetoptError as e: except GetoptError as e:
print("E: %s" % e, file=sys.stderr) print("E: %s" % e, file=sys.stderr)
usage(sys.stderr) usage(sys.stderr)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment