add test cases for StorageDir
replace  dirIndex using StorageDir