# # patch "ChangeLog" # from [0966f4abb29bc155f9b0040d0533d5db076969c9] # to [91831d0929ca5b895ee1be65476ff99b7b59d881] # # patch "tests/t_netsync_checks_server_key.at" # from [14c7efed280e3f598e40729561fcb4621eb493c8] # to [d0b81a3711d138c0418540547bbf4b7daa756e63] # # patch "testsuite.at" # from [a8e59356e5b6b21a15062eab16251b1dea9b2f42] # to [eec81673ce3fb8bbe0f2dc879007f2fe9f15b518] # =============================================== --- ChangeLog 0966f4abb29bc155f9b0040d0533d5db076969c9 +++ ChangeLog 91831d0929ca5b895ee1be65476ff99b7b59d881 @@ -1,3 +1,12 @@ +2005-08-03 Nathaniel Smith + + * testsuite.at (NETSYNC_ADDRESS): New macro. + (NETSYNC_SERVE_N_START, NETSYNC_SERVE_START) + (NETSYNC_CLIENT_N_RUN): Use it. + + * tests/t_netsync_checks_server_key.at: Make sure can unset the + known-servers entry. + 2005-08-03 Matthew A. Nicholson * std_hooks.lua (get_preferred_merge2_command) =============================================== --- tests/t_netsync_checks_server_key.at 14c7efed280e3f598e40729561fcb4621eb493c8 +++ tests/t_netsync_checks_server_key.at d0b81a3711d138c0418540547bbf4b7daa756e63 @@ -30,10 +30,19 @@ # Then again with a different key; should fail. NETSYNC_SERVE_START(address@hidden testbranch) + NETSYNC_CLIENT_RUN(pull, testbranch, 1) -NETSYNC_SERVE_STOP - # It shouldn't have absorbed the key, either. AT_CHECK(MONOTONE2 pubkey address@hidden, [1], [stdout], [ignore]) +# But if we then clear the client's known_hosts entry, it should be fine +AT_CHECK(MONOTONE2 unset known-servers NETSYNC_ADDRESS, [], [ignore], [ignore]) + +# Now it should succeed +NETSYNC_CLIENT_RUN(pull, testbranch) +# And have absorbed the key +AT_CHECK(MONOTONE2 pubkey address@hidden, [], [stdout], [ignore]) + +NETSYNC_SERVE_STOP + AT_CLEANUP =============================================== --- testsuite.at a8e59356e5b6b21a15062eab16251b1dea9b2f42 +++ testsuite.at eec81673ce3fb8bbe0f2dc879007f2fe9f15b518 @@ -375,17 +375,19 @@ rm -f monotone_at.pid 2>/dev/null ]) +m4_define([NETSYNC_ADDRESS], [localhost:$_PORT]) + # run as NETSYNC_SERVE_N_START(2|3, pattern) # note that NETSYNC_SERVE_START is _not_ a special case of this macro. m4_define([NETSYNC_SERVE_N_START], [ NETSYNC_KILLHARD -MONOTONE --db=test$1.db --rcfile=netsync.lua --pid-file=monotone_at.pid serve localhost:$_PORT m4_if($2, [], "*", $2) & +MONOTONE --db=test$1.db --rcfile=netsync.lua --pid-file=monotone_at.pid serve NETSYNC_ADDRESS m4_if($2, [], "*", $2) & sleep 4 ]) # run as NETSYNC_SERVE_START(pattern) m4_define([NETSYNC_SERVE_START], [ NETSYNC_KILLHARD -MONOTONE --rcfile=netsync.lua --pid-file=monotone_at.pid serve localhost:$_PORT m4_if($1, [], "*", $1) & +MONOTONE --rcfile=netsync.lua --pid-file=monotone_at.pid serve NETSYNC_ADDRESS m4_if($1, [], "*", $1) & sleep 4 ]) # run as NETSYNC_SERVE_STOP @@ -397,7 +399,7 @@ # run as NETSYNC_CLIENT_N_RUN(2|3, push|pull|sync, pattern[, expected result]) # first argument chooses whether to use the 2nd or 3rd database m4_define([NETSYNC_CLIENT_N_RUN], [ -AT_CHECK(MONOTONE --db=test$1.db --rcfile=netsync.lua $2 localhost:$_PORT $3, [$4], [ignore], [ignore]) +AT_CHECK(MONOTONE --db=test$1.db --rcfile=netsync.lua $2 NETSYNC_ADDRESS $3, [$4], [ignore], [ignore]) ]) # run as NETSYNC_CLIENT_RUN(push|pull|sync, pattern[, expected result]) m4_define([NETSYNC_CLIENT_RUN], [