@Test
public void testDeleteExpiredSSHCertRecords() throws Exception {

    
    // make sure the directory does not exist
    ZTSTestUtils.deleteDirectory(new File("/tmp/zts-ssh-tests"));
    FileSSHRecordStore store = new FileSSHRecordStore(new File("/tmp/zts-ssh-tests"));
    FileSSHRecordStoreConnection con = (FileSSHRecordStoreConnection) store.getConnection();
    assertNotNull(con);
    
    SSHCertRecord certRecord = new SSHCertRecord();
    certRecord.setInstanceId("instance-id");
    certRecord.setService("cn");
    certRecord.setPrincipals("host1,host2");
    certRecord.setClientIP("10.10.10.11");
    certRecord.setPrivateIP("10.10.10.12");
    assertTrue(con.insertSSHCertRecord(certRecord));
    SSHCertRecord certRecordCheck = con.getSSHCertRecord("instance-id", "cn");
    assertNotNull(certRecordCheck);
    
    Thread.sleep(1000);
    con.deleteExpiredSSHCertRecords(0);
    certRecordCheck = con.getSSHCertRecord("instance-id", "cn");
    assertNull(certRecordCheck);
    con.close();
}