A shaky ceasefire has been tested after two rockets were fired towards an Israeli town and Israeli warplanes struck Hamas targets in Gaza in response.