getblocktemplate fails in regtest mode even when it is connected to the other node
You need to mine a block so that the software thinks that the blockchain is fully synced. The most recent block in the regtest blockchain is probably old so you just need to mine one more block to make the blockchain "recent".

Just use the generate command. You can do:

./src/bitcoin-cli -regtest -port=8333 -rpcport=8332 -rpcuser=test -rpcpassword=test generate 1


to mine one block.