Add unittests for mkStateDir