The fourth amendment of the constitution of the Unite States was meant to protect the people from forceful searches and warrants by the police officials without a definite cause and testing of the drug by the police is not counted in the fourth amendment and does not violate it.
It is counted as lawful if it serves the purpose of the government of the country but drug test without any suspicion is not considered to be constitutional.