set-default-roles: fix bug and add test script