On Thu, Jan 9, 2014 at 12:34 PM, Mark Dilger <markdil...@yahoo.com> wrote: > Michael Paquier wrote: >> A possible input for a test that users could provide would be something> >> like that: >> >> # Node information for tests >> nodes> { >> {node1, postgresql.conf params, recovery.conf params} >> {node2, postgresql.conf params, recovery.conf params, slave of node1} >> } >> # Run test >> init node1 >> run_sql node1 file1.sql >> # Check output >> init node2 >> run_sql node2 file2.sql >> # Check that results are fine >> # Process >> >> The main problem is actually how to do that. Having some smart shell >> infrastructure would be simple and would facilitate (?) the maintenance >> of code used to run the tests. On the contrary having a C program would >> make the maintenance of code to run the tests more difficult (?) for a >> trade with more readable test suite input like the one I wrote above. >> This might also make the test input more readable for a human eye, in >> the shape of what is already available in src/test/isolation. > > I like making this part of src/test/isolation, if folks do not object. > The core infrastructure in src/test/isolation seems applicable to > replication testing, and I'd hate to duplicate that code. > > As for the node setup in your example above, I don't think it can be as > simple as defining nodes first, then running tests. The configurations > themselves may need to be changed during the execution of a test, and > services stopped and started, all under test control and specified in > the same easy format. Yes, my example was very basic :). What you actually need is the possibility to perform actions on nodes during a test run, basically: stop, start, init, reload, run SQL, change params/create new conf files (like putting a node in recovery could be = create recovery.conf + restart). The place of the code does not matter much, but don't think that it should be part of isolation as clustering and isolation are too different test suites. I would have for example seen that as src/test/cluster, with src/test/common for things that are shared between test infrastructures.
As mentioned by Steve, the test suite of Slony might be interesting to look at to get some ideas. Regards, -- Michael -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers