Added boolean argument to {create,delete}Volume() specifying whether or not the mount point shall be made/deleted.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2209 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2002-12-09 12:52:58 +00:00
parent 46ce5c12a3
commit 38ce9b085e
2 changed files with 10 additions and 6 deletions
+6 -4
View File
@@ -83,7 +83,8 @@ BasicTest::dumpStat(struct stat &st)
// createVolume // createVolume
void void
BasicTest::createVolume(string imageFile, string mountPoint, int32 megs) BasicTest::createVolume(string imageFile, string mountPoint, int32 megs,
bool makeMountPoint)
{ {
char megsString[16]; char megsString[16];
sprintf(megsString, "%ld", megs); sprintf(megsString, "%ld", megs);
@@ -93,17 +94,18 @@ BasicTest::createVolume(string imageFile, string mountPoint, int32 megs)
+ " ; mkbfs " + imageFile + " ; mkbfs " + imageFile
+ " > /dev/null" + " > /dev/null"
+ " ; sync" + " ; sync"
+ " ; mkdir " + mountPoint + (makeMountPoint ? " ; mkdir " + mountPoint : "")
+ " ; mount " + imageFile + " " + mountPoint); + " ; mount " + imageFile + " " + mountPoint);
} }
// deleteVolume // deleteVolume
void void
BasicTest::deleteVolume(string imageFile, string mountPoint) BasicTest::deleteVolume(string imageFile, string mountPoint,
bool deleteMountPoint)
{ {
execCommand(string("sync") execCommand(string("sync")
+ " ; unmount " + mountPoint + " ; unmount " + mountPoint
+ " ; rmdir " + mountPoint + (deleteMountPoint ? " ; rmdir " + mountPoint : "")
+ " ; rm " + imageFile); + " ; rm " + imageFile);
} }
+4 -2
View File
@@ -29,8 +29,10 @@ public:
static void dumpStat(struct stat &st); static void dumpStat(struct stat &st);
static void createVolume(string imageFile, string mountPoint, int32 megs); static void createVolume(string imageFile, string mountPoint, int32 megs,
static void deleteVolume(string imageFile, string mountPoint); bool makeMountPoint = true);
static void deleteVolume(string imageFile, string mountPoint,
bool deleteMountPoint = true);
protected: protected:
int32 fSubTestNumber; int32 fSubTestNumber;