The attack is seen as the first major test of the US-Iran agreement signed last week to end hostilities and reopen the strategically vital shipping lane.