To run bitcoin core testnet on Ubuntu 16.04
After having installed Bitcoin core on your machine, run the following command to start synchronising the testnet blockchain
bitcoind -testnet -daemon
The synchronisation starts as a daemon and runs in the background, you can issue the following the command to see the progress
tailf ~/.bitcoin/testnet3/debug.log
To access the command line apis , just add the -testnet parameter
bitcoin-cli -testnet getinfo
Update: The RPC getinfo is deprecated, use getblockchaininfo for it to work with the latest version
bitcoin-cli -testnet getblockchaininfo