The German parliament has passed a legislation that imposes drug and alcohol tests on airline pilots.