The fitness test is called the FORCE test. I've noticed that some people have done this test during the recruiting process. This test is given during week 1 of BMQ. There seems to be an inconsistency in the information as to what the test entails and when you are tested.
https://www.cfmws.com/en/aboutus/psp/dfit/fitness/forceprogram/pages/about-the-force-program.aspx
The above link is to information on the FORCE test. The actual test may vary.
As for exercises to do to get in shape for it, I would recommend full body exercise and cardio.
From what I have read by the start of BMQ you should be able to run 5k.
Best to be in the best shape you can be before starting BMQ.
Just keep in mind the recruiting process can take time and a lot of it. Patience is an important thing to have