main: add basic functional test

wait on #1315 
what is the difference between stop and terminate? 
how about rename stop -> pause; terminate -> stop?