Iran does this periodically, the fact that they can disrupt commercial shipping (oil) in the SoH is their claim to fame and lever to get attention.
They also know if they ever actually do it they wouldn't have a navy or much of an air force left afterwards.