Did Vader ever know he was being used by Sidious prior to ROTJ when Luke defeated him ?
And did Sidous ever doubt and test Vader out and put him in a life and death sort of situation ? What does Canon say about this ?
Vader absolutely knew Palpatine's game. You should check out Lords of the Sith some time. It really goes a long way to help illustrate Vader and Palpatine's relationship.
As for if Sidious tested him, yes. Tarkin, Lords of the Sith, Thrawn: Alliances, and both of Charles Soule's Darth Vader comic runs all show Sidious finding new and creative ways to test Vader's commitment. Palpatine tests Vader at almost every chance he gets, and in almost every test, Vader comes out even more impressive. Palpatine has repeatedly praised Vader for being effectively a perfect Sith in Canon, due to how he has handled his many, many trials.
That's just how the Sith work. The Master is always in search of a more powerful apprentice. Vader knew this, and dominated every 'trial' that Palpatine put in front of him.