Changeset: ba25cdda952f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ba25cdda952f
Added Files:
sql/test/testdb-reload/Tests/reload.stable.out.src
Removed Files:
sql/test/testdb-reload/Tests/reload.stable.out
Modified Files:
sql/test/testdb-reload/Tests/reload.py
Branch: mtest
Log Message:
Converted directory sql/test/testdb-reload.
diffs (truncated from 101638 to 300 lines):
diff --git a/sql/test/testdb-reload/Tests/reload.py
b/sql/test/testdb-reload/Tests/reload.py
--- a/sql/test/testdb-reload/Tests/reload.py
+++ b/sql/test/testdb-reload/Tests/reload.py
@@ -21,14 +21,6 @@ if not tstdb or not dbfarm:
print('No TSTDB or GDK_DBFARM in environment')
sys.exit(1)
-def freeport():
- sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- sock.bind(('', 0))
- port = sock.getsockname()[1]
- sock.close()
- return port
-
-port2 = freeport()
tstdb2 = tstdb + '-clone'
if os.path.exists(os.path.join(dbfarm, tstdb2)):
shutil.rmtree(os.path.join(dbfarm, tstdb2))
@@ -37,7 +29,7 @@ if os.path.exists(os.path.join(dbfarm, t
with process.server(stdin=process.PIPE,
stdout=process.PIPE,
stderr=process.PIPE,
- mapiport=os.environ.get('MAPIPORT', '50000')) as s1:
+ mapiport='0') as s1:
# load data into the first server's database
with sqllogictest.SQLLogic(out=open(os.devnull, 'w')) as sql:
sql.connect(hostname='localhost',
@@ -47,7 +39,7 @@ with process.server(stdin=process.PIPE,
'testdb', 'Tests', 'load.test'))
# start the second server
with process.server(dbname=tstdb2,
- mapiport=port2,
+ mapiport='0',
stdin=process.PIPE,
stdout=process.PIPE,
stderr=process.PIPE) as s2:
@@ -57,24 +49,42 @@ with process.server(stdin=process.PIPE,
server=s1,
stdin=process.PIPE,
stdout='PIPE',
- stderr=process.DEVNULL) as d1, \
+ stderr=process.PIPE) as d1, \
process.client(lang='sql',
- server=s2,
- stdin=d1.stdout,
- stdout=process.DEVNULL,
- stderr=process.DEVNULL) as c2:
+ server=s2,
+ stdin=d1.stdout,
+ stdout=process.DEVNULL,
+ stderr=process.PIPE) as c2:
d1.stdout.close()
d1.stdout = None
c2out, c2err = c2.communicate()
d1out, d1err = d1.communicate()
+ sys.stderr.write(c2err)
+ sys.stderr.write(d1err)
s1out, s1err = s1.communicate()
- sys.stdout.write(s1out)
- sys.stderr.write(s1err)
+ sys.stdout.writelines([line for line in
s1out.splitlines(keepends=True) if not line.startswith('#')])
+ sys.stderr.writelines([line for line in
s1err.splitlines(keepends=True) if not line.startswith('#')])
# dump the second server's database
with process.client(lang='sqldump',
- server=s2) as d2:
+ server=s2,
+ stdin=process.PIPE,
+ stdout=process.PIPE,
+ stderr=process.PIPE) as d2:
d2out, d2err = d2.communicate()
+ sys.stderr.write(d2err)
s2out, s2err = s2.communicate()
- sys.stdout.write(s2out)
- sys.stderr.write(s2err)
+ sys.stdout.writelines([line for line in
s2out.splitlines(keepends=True) if not line.startswith('#')])
+ sys.stderr.writelines([line for line in
s2err.splitlines(keepends=True) if not line.startswith('#')])
+
+if len(sys.argv) == 2 and sys.argv[1] == 'reload':
+ output = ''.join(d2out).splitlines(keepends=True)
+ while len(output) > 0 and output[0].startswith('--'):
+ del output[0]
+ stableout = 'reload.stable.out'
+ stable = open(stableout).readlines()
+ import difflib
+ for line in difflib.unified_diff(stable, output, fromfile='test',
tofile=stableout):
+ sys.stderr.write(line)
+else:
+ sys.stdout.writelines(d2out)
diff --git a/sql/test/testdb-reload/Tests/reload.stable.out
b/sql/test/testdb-reload/Tests/reload.stable.out
deleted file mode 100644
--- a/sql/test/testdb-reload/Tests/reload.stable.out
+++ /dev/null
@@ -1,101538 +0,0 @@
-stdout of test 'reload` in directory 'sql/test/testdb-reload` itself:
-
-
-# 17:34:32 >
-# 17:34:32 > "/usr/bin/python2" "reload.py" "reload"
-# 17:34:32 >
-
-START TRANSACTION;
-CREATE USER "testuser" WITH ENCRYPTED PASSWORD
'e9e633097ab9ceb3e48ec3f70ee2beba41d05d5420efee5da85f97d97005727587fda33ef4ff2322088f4c79e8133cc9cd9f3512f4d3a303cbdb5bc585415a00'
NAME 'Test User' SCHEMA "sys";
-CREATE SCHEMA "testschema" AUTHORIZATION "testuser";
-COMMENT ON SCHEMA "testschema" IS 'a schema used for testing';
-ALTER USER "testuser" SET SCHEMA "testschema";
-CREATE SEQUENCE "testschema"."selfref_seq" AS INTEGER;
-COMMENT ON SEQUENCE "testschema"."selfref_seq" IS 'sequence number for selfref
table';
-CREATE SEQUENCE "testschema"."test_seq" AS INTEGER;
-COMMENT ON SEQUENCE "testschema"."test_seq" IS 'sequence number for testing';
-SET SCHEMA "testschema";
-CREATE TABLE "testschema"."smallstring" (
- "string1" VARCHAR(5),
- "string2" CHAR(5),
- "string3" CHARACTER LARGE OBJECT
-);
-COMMENT ON TABLE "testschema"."smallstring" IS 'table to test small strings';
-COMMENT ON COLUMN "testschema"."smallstring"."string1" IS 'first column of
table to test small strings';
-COMMENT ON COLUMN "testschema"."smallstring"."string2" IS 'second column of
table to test small strings';
-COMMENT ON COLUMN "testschema"."smallstring"."string3" IS 'third column of
table to test small strings';
-COPY 66 RECORDS INTO "testschema"."smallstring" FROM stdin USING DELIMITERS
E'\t',E'\n','"';
-"a0" "b0" "c0"
-"a1" "b1" "c1"
-"a2" "b2" "c2"
-"a3" "b3" "c3"
-"a4" "b4" "c4"
-"a5" "b5" "c5"
-"a6" "b6" "c6"
-"a7" "b7" "c7"
-"a8" "b8" "c8"
-"a9" "b9" "c9"
-"a10" "b10" "c10"
-"a0" "b0" "c0"
-"a1" "b1" "c1"
-"a2" "b2" "c2"
-"a3" "b3" "c3"
-"a4" "b4" "c4"
-"a5" "b5" "c5"
-"a6" "b6" "c6"
-"a7" "b7" "c7"
-"a8" "b8" "c8"
-"a9" "b9" "c9"
-"a10" "b10" "c10"
-"a0" "b0" "c0"
-"a1" "b1" "c1"
-"a2" "b2" "c2"
-"a3" "b3" "c3"
-"a4" "b4" "c4"
-"a5" "b5" "c5"
-"a6" "b6" "c6"
-"a7" "b7" "c7"
-"a8" "b8" "c8"
-"a9" "b9" "c9"
-"a10" "b10" "c10"
-"a0" "b0" "c0"
-"a1" "b1" "c1"
-"a2" "b2" "c2"
-"a3" "b3" "c3"
-"a4" "b4" "c4"
-"a5" "b5" "c5"
-"a6" "b6" "c6"
-"a7" "b7" "c7"
-"a8" "b8" "c8"
-"a9" "b9" "c9"
-"a10" "b10" "c10"
-"a0" "b0" "c0"
-"a1" "b1" "c1"
-"a2" "b2" "c2"
-"a3" "b3" "c3"
-"a4" "b4" "c4"
-"a5" "b5" "c5"
-"a6" "b6" "c6"
-"a7" "b7" "c7"
-"a8" "b8" "c8"
-"a9" "b9" "c9"
-"a10" "b10" "c10"
-"a0" "b0" "c0"
-"a1" "b1" "c1"
-"a2" "b2" "c2"
-"a3" "b3" "c3"
-"a4" "b4" "c4"
-"a5" "b5" "c5"
-"a6" "b6" "c6"
-"a7" "b7" "c7"
-"a8" "b8" "c8"
-"a9" "b9" "c9"
-"a10" "b10" "c10"
-CREATE TABLE "testschema"."mediumstring" (
- "string1" VARCHAR(20),
- "string2" CHAR(20),
- "string3" CHARACTER LARGE OBJECT
-);
-COPY 1001 RECORDS INTO "testschema"."mediumstring" FROM stdin USING DELIMITERS
E'\t',E'\n','"';
-"a222833216428103" "b222833216428103" "c222833216428103"
-"a22462275706708" "b22462275706708" "c22462275706708"
-"a207961069219280" "b207961069219280" "c207961069219280"
-"a1430667456508" "b1430667456508" "c1430667456508"
-"a143912596726204" "b143912596726204" "c143912596726204"
-"a35882931026608" "b35882931026608" "c35882931026608"
-"a12630311241498" "b12630311241498" "c12630311241498"
-"a1147528919691" "b1147528919691" "c1147528919691"
-"a2463126399106" "b2463126399106" "c2463126399106"
-"a26499139713669" "b26499139713669" "c26499139713669"
-"a1248634873065" "b1248634873065" "c1248634873065"
-"a78212594930635" "b78212594930635" "c78212594930635"
-"a14529139788559" "b14529139788559" "c14529139788559"
-"a10412828415305" "b10412828415305" "c10412828415305"
-"a754999078504" "b754999078504" "c754999078504"
-"a985134955047" "b985134955047" "c985134955047"
-"a27593261253403" "b27593261253403" "c27593261253403"
-"a29091483332322" "b29091483332322" "c29091483332322"
-"a29783294642194" "b29783294642194" "c29783294642194"
-"a61212319516165" "b61212319516165" "c61212319516165"
-"a9790291319652" "b9790291319652" "c9790291319652"
-"a128551073512834" "b128551073512834" "c128551073512834"
-"a107222526426812" "b107222526426812" "c107222526426812"
-"a192822630622328" "b192822630622328" "c192822630622328"
-"a1819108732235" "b1819108732235" "c1819108732235"
-"a10323207312962" "b10323207312962" "c10323207312962"
-"a15370296666320" "b15370296666320" "c15370296666320"
-"a187742599011153" "b187742599011153" "c187742599011153"
-"a18328230057849" "b18328230057849" "c18328230057849"
-"a205222912631044" "b205222912631044" "c205222912631044"
-"a392061491190" "b392061491190" "c392061491190"
-"a235721900411925" "b235721900411925" "c235721900411925"
-"a3638297274421" "b3638297274421" "c3638297274421"
-"a304501624130727" "b304501624130727" "c304501624130727"
-"a200101806031815" "b200101806031815" "c200101806031815"
-"a19477283831120" "b19477283831120" "c19477283831120"
-"a324401098630786" "b324401098630786" "c324401098630786"
-"a59922976024008" "b59922976024008" "c59922976024008"
-"a171451532014245" "b171451532014245" "c171451532014245"
-"a24994307510604" "b24994307510604" "c24994307510604"
-"a23270699516753" "b23270699516753" "c23270699516753"
-"a24460305672989" "b24460305672989" "c24460305672989"
-"a3617143832716" "b3617143832716" "c3617143832716"
-"a80393188816189" "b80393188816189" "c80393188816189"
-"a5998191311481" "b5998191311481" "c5998191311481"
-"a5045584029865" "b5045584029865" "c5045584029865"
-"a616555128083" "b616555128083" "c616555128083"
-"a4184115045075" "b4184115045075" "c4184115045075"
-"a281922864920395" "b281922864920395" "c281922864920395"
-"a96702087523470" "b96702087523470" "c96702087523470"
-"a202741137830465" "b202741137830465" "c202741137830465"
-"a4259307028265" "b4259307028265" "c4259307028265"
-"a7248668829703" "b7248668829703" "c7248668829703"
-"a71971472728823" "b71971472728823" "c71971472728823"
-"a233862072515186" "b233862072515186" "c233862072515186"
-"a248682577121027" "b248682577121027" "c248682577121027"
-"a219653193626539" "b219653193626539" "c219653193626539"
-"a3004833525276" "b3004833525276" "c3004833525276"
-"a2355315451157" "b2355315451157" "c2355315451157"
-"a22750844722033" "b22750844722033" "c22750844722033"
-"a1345328721643" "b1345328721643" "c1345328721643"
-"a111502123713" "b111502123713" "c111502123713"
-"a6647746010401" "b6647746010401" "c6647746010401"
-"a35821465725128" "b35821465725128" "c35821465725128"
-"a32406527613086" "b32406527613086" "c32406527613086"
-"a14824301446089" "b14824301446089" "c14824301446089"
-"a3083193415257" "b3083193415257" "c3083193415257"
-"a29623166218610" "b29623166218610" "c29623166218610"
-"a2131189767387" "b2131189767387" "c2131189767387"
-"a3288895815834" "b3288895815834" "c3288895815834"
-"a253212241111787" "b253212241111787" "c253212241111787"
-"a2596479411999" "b2596479411999" "c2596479411999"
-"a29678744119459" "b29678744119459" "c29678744119459"
-"a7311110241349" "b7311110241349" "c7311110241349"
-"a32440106626625" "b32440106626625" "c32440106626625"
-"a12758254864001" "b12758254864001" "c12758254864001"
-"a188472857023342" "b188472857023342" "c188472857023342"
-"a24104254257195" "b24104254257195" "c24104254257195"
-"a327142755626171" "b327142755626171" "c327142755626171"
-"a7333308442361" "b7333308442361" "c7333308442361"
-"a231672339824773" "b231672339824773" "c231672339824773"
-"a21861659425567" "b21861659425567" "c21861659425567"
-"a1418513504240" "b1418513504240" "c1418513504240"
-"a8772081611264" "b8772081611264" "c8772081611264"
-"a22262048821926" "b22262048821926" "c22262048821926"
-"a885147814645" "b885147814645" "c885147814645"
-"a128521932510447" "b128521932510447" "c128521932510447"
-"a3426106613104" "b3426106613104" "c3426106613104"
-"a106211060830660" "b106211060830660" "c106211060830660"
-"a40241794128736" "b40241794128736" "c40241794128736"
-"a6385834119366" "b6385834119366" "c6385834119366"
-"a31158105273193" "b31158105273193" "c31158105273193"
-"a239572471316697" "b239572471316697" "c239572471316697"
-"a24198255904745" "b24198255904745" "c24198255904745"
-"a26942781625233" "b26942781625233" "c26942781625233"
-"a24621389925711" "b24621389925711" "c24621389925711"
-"a64981675112268" "b64981675112268" "c64981675112268"
-"a169452017722930" "b169452017722930" "c169452017722930"
-"a2004930798770" "b2004930798770" "c2004930798770"
-"a17941205418711" "b17941205418711" "c17941205418711"
-"a13909843927052" "b13909843927052" "c13909843927052"
-"a50868304812" "b50868304812" "c50868304812"
-"a37013078729525" "b37013078729525" "c37013078729525"
-"a203982221722347" "b203982221722347" "c203982221722347"
-"a251442491217395" "b251442491217395" "c251442491217395"
-"a176091676521294" "b176091676521294" "c176091676521294"
-"a10553232635277" "b10553232635277" "c10553232635277"
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list