summaryrefslogtreecommitdiffstats
path: root/perl-install/fs.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/fs.pm')
-rw-r--r--perl-install/fs.pm20
1 files changed, 12 insertions, 8 deletions
diff --git a/perl-install/fs.pm b/perl-install/fs.pm
index f2f3a48de..3920de74b 100644
--- a/perl-install/fs.pm
+++ b/perl-install/fs.pm
@@ -144,11 +144,13 @@ sub mount_part($;$$) {
$part->{isMounted} and return;
- if (isSwap($part)) {
- swap::swapon($part->{device});
- } else {
- $part->{mntpoint} or die "missing mount point";
- mount(devices::make($part->{device}), ($prefix || '') . $part->{mntpoint}, type2fs($part->{type}), $rdonly);
+ unless ($::testing) {
+ if (isSwap($part)) {
+ swap::swapon($part->{device});
+ } else {
+ $part->{mntpoint} or die "missing mount point";
+ mount(devices::make($part->{device}), ($prefix || '') . $part->{mntpoint}, type2fs($part->{type}), $rdonly);
+ }
}
$part->{isMounted} = $part->{isFormatted} = 1; #- assume that if mount works, partition is formatted
}
@@ -158,9 +160,11 @@ sub umount_part($;$) {
$part->{isMounted} or return;
- isSwap($part) ?
- swap::swapoff($part->{device}) :
- umount(($prefix || '') . ($part->{mntpoint} || devices::make($part->{device})));
+ unless ($::testing) {
+ isSwap($part) ?
+ swap::swapoff($part->{device}) :
+ umount(($prefix || '') . ($part->{mntpoint} || devices::make($part->{device})));
+ }
$part->{isMounted} = 0;
}