I believe all competitors in the Olympics must submit to a drug/doping test prior to competing, and during the games all medal-winning teams and athletes have to be drug-tested (right after their event is over), and random testing goes on throughout the games among all other competing athletes as well.
These were the anti-doping/drug testing policies during the beijing Olympics, it's similar for the winter games as well.