Iran says it temporarily closed parts of the Strait of Hormuz, one of the world's most crucial shipping lanes, for a military drill and missile test.