Test for generatesecret