Your two examples are correct. I think there are subtle differences between "take" and "do".
Wherever "perform" would be suitable, do can be substituted.
A chemist might do/perform a test to find out what kind of acid is
in the test tube.
A doctor might do/perform a blood test.
If they send you the equipment you can do/perform the Covid test
Notice how take doesn't work in those cases:
If the chemist takes a test, he sits it.
The doctor takes the blood, not the test.
If you take a Covid test at home it tests your knowledge of the disease.
When your ability is to be tested you take a test (or you sit an exam):
You take your driving test
You take a French language
A website where you can test your reflexes might say,
'Take the test!'
Note that perform wouldn't be suitable in these. So take is better than do.
You neither take nor do an eye test or a blood test. You simply have one or go for one. (Or undergo one!)
The trouble is we tend to use have/had/do/did informally for everything!