We can now test mount with testmodule.py: remove the test main()

This commit is contained in:
Aurélien Gâteau 2014-07-24 10:17:46 +02:00
parent 35d2a10177
commit aef2b7e9e7
2 changed files with 12 additions and 29 deletions

View File

@ -17,12 +17,12 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Calamares. If not, see <http://www.gnu.org/licenses/>. # along with Calamares. If not, see <http://www.gnu.org/licenses/>.
import libcalamares
import tempfile
import os import os
import subprocess import subprocess
import sys import sys
import tempfile
import libcalamares
def mount( devicePath, mountPoint, fs ): def mount( devicePath, mountPoint, fs ):
if not os.path.exists( mountPoint ): if not os.path.exists( mountPoint ):
@ -52,30 +52,3 @@ def calamares_main():
mountPartitions( rootMountPoint, libcalamares.global_storage.value( "partitions" ) ) mountPartitions( rootMountPoint, libcalamares.global_storage.value( "partitions" ) )
libcalamares.global_storage.insert( "rootMountPoint", rootMountPoint ) libcalamares.global_storage.insert( "rootMountPoint", rootMountPoint )
return "all done, mounted at {}".format( rootMountPoint ) return "all done, mounted at {}".format( rootMountPoint )
def main( args ):
partitions = (
{
"device": "/dev/sdb1",
"mountPoint": "/",
"fs": "ext4",
},
{
"device": "/dev/sdb2",
"mountPoint": "/home",
"fs": "ext4",
},
{
"device": "/dev/sdb3",
"mountPoint": "",
"fs": "linuxswap",
},
)
rootMountPoint = "/tmp/mount"
mountPartitions( rootMountPoint, partitions )
return 0
if __name__ == "__main__":
sys.exit( main( sys.argv ) )

View File

@ -0,0 +1,10 @@
partitions:
- device: "/dev/sdb1"
mountPoint: "/"
fs: "ext4"
- device: "/dev/sdb2"
mountPoint: "/home"
fs: "ext4"
- device: "/dev/sdb3"
mountPoint: ""
fs: "linuxswap"