Exemplo n.º 1
0
    def pick_install_location_error_test(self):
        """No suitable location is found."""
        df_map = {"/mnt/sysimage/not_used" : Size("20 G"),
                  "/mnt/sysimage/home"     : Size("1 G"),
                  "/mnt/sysimage"         : Size("4 G")}
        download_size = Size("1.5 G")
        install_size = Size("3.0 G")

        mpoint = dnfpayload._pick_mpoint(df_map, download_size, install_size, False)

        self.assertEqual(mpoint, None)
Exemplo n.º 2
0
    def pick_install_location_error_test(self):
        """No suitable location is found."""
        df_map = {os.path.join(conf.target.system_root, "not_used"): Size("20 G"),
                  os.path.join(conf.target.system_root, "home"): Size("1 G"),
                  os.path.join(conf.target.system_root): Size("4 G")}
        download_size = Size("1.5 G")
        install_size = Size("3.0 G")

        mpoint = dnfpayload._pick_mpoint(df_map, download_size, install_size, False)

        self.assertEqual(mpoint, None)
Exemplo n.º 3
0
    def pick_install_location_test(self):
        """Take the root for download and install."""
        df_map = {"/mnt/sysimage/not_used" : Size("20 G"),
                  "/mnt/sysimage/home"     : Size("2 G"),
                  "/mnt/sysimage"         : Size("6 G")}
        download_size = Size("1.5 G")
        install_size = Size("3.0 G")

        mpoint = dnfpayload._pick_mpoint(df_map, download_size, install_size, False)

        self.assertEqual(mpoint, "/mnt/sysimage")
Exemplo n.º 4
0
    def pick_download_location_test(self):
        """Take the biggest mountpoint which can be used for download"""
        df_map = {"/mnt/sysimage/not_used" : Size("20 G"),
                  "/mnt/sysimage/home"     : Size("2 G"),
                  "/mnt/sysimage/"         : Size("5 G")}
        download_size = Size("1.5 G")
        install_size = Size("1.8 G")

        mpoint = dnfpayload._pick_mpoint(df_map, download_size, install_size, True)

        self.assertEqual(mpoint, "/mnt/sysimage/home")
Exemplo n.º 5
0
    def pick_download_location_test(self):
        """Take the biggest mountpoint which can be used for download"""
        df_map = {os.path.join(conf.target.system_root, "not_used"): Size("20 G"),
                  os.path.join(conf.target.system_root, "home"): Size("2 G"),
                  os.path.join(conf.target.system_root): Size("5 G")}
        download_size = Size("1.5 G")
        install_size = Size("1.8 G")

        mpoint = dnfpayload._pick_mpoint(df_map, download_size, install_size, True)

        self.assertEqual(mpoint, os.path.join(conf.target.system_root, "home"))
Exemplo n.º 6
0
    def pick_install_location_test(self):
        """Take the root for download and install."""
        df_map = {os.path.join(conf.target.system_root, "not_used"): Size("20 G"),
                  os.path.join(conf.target.system_root, "home"): Size("2 G"),
                  os.path.join(conf.target.system_root): Size("6 G")}
        download_size = Size("1.5 G")
        install_size = Size("3.0 G")

        mpoint = dnfpayload._pick_mpoint(df_map, download_size, install_size, False)

        self.assertEqual(mpoint, conf.target.system_root)
Exemplo n.º 7
0
    def pick_install_location_error_test(self):
        """No suitable location is found."""
        df_map = {"/mnt/sysimage/not_used" : Size("20 G"),
                  "/mnt/sysimage/home"     : Size("1 G"),
                  "/mnt/sysimage"         : Size("4 G")}
        download_size = Size("1.5 G")
        install_size = Size("3.0 G")

        mpoint = dnfpayload._pick_mpoint(df_map, download_size, install_size, False)

        self.assertEqual(mpoint, None)
Exemplo n.º 8
0
    def pick_install_location_test(self):
        """Take the root for download and install."""
        df_map = {"/mnt/sysimage/not_used" : Size("20 G"),
                  "/mnt/sysimage/home"     : Size("2 G"),
                  "/mnt/sysimage"         : Size("6 G")}
        download_size = Size("1.5 G")
        install_size = Size("3.0 G")

        mpoint = dnfpayload._pick_mpoint(df_map, download_size, install_size, False)

        self.assertEqual(mpoint, "/mnt/sysimage")
Exemplo n.º 9
0
    def pick_download_location_test(self):
        """Take the biggest mountpoint which can be used for download"""
        df_map = {"/mnt/sysimage/not_used" : Size("20 G"),
                  "/mnt/sysimage/home"     : Size("2 G"),
                  "/mnt/sysimage/"         : Size("5 G")}
        download_size = Size("1.5 G")
        install_size = Size("1.8 G")

        mpoint = dnfpayload._pick_mpoint(df_map, download_size, install_size, True)

        self.assertEqual(mpoint, "/mnt/sysimage/home")
Exemplo n.º 10
0
    def pick_download_root_test(self):
        """Take the root for download because there are no other available mountpoints
           even when the root isn't big enough.

           This is required when user skipped the space check.
        """
        df_map = {"/mnt/sysimage/not_used" : Size("20 G"),
                  "/mnt/sysimage/home"     : Size("2 G"),
                  "/mnt/sysimage"         : Size("5 G")}
        download_size = Size("2.5 G")
        install_size = Size("3.0 G")

        mpoint = dnfpayload._pick_mpoint(df_map, download_size, install_size, True)

        self.assertEqual(mpoint, "/mnt/sysimage")
Exemplo n.º 11
0
    def pick_download_root_test(self):
        """Take the root for download because there are no other available mountpoints
           even when the root isn't big enough.

           This is required when user skipped the space check.
        """
        df_map = {os.path.join(conf.target.system_root, "not_used"): Size("20 G"),
                  os.path.join(conf.target.system_root, "home"): Size("2 G"),
                  os.path.join(conf.target.system_root): Size("5 G")}
        download_size = Size("2.5 G")
        install_size = Size("3.0 G")

        mpoint = dnfpayload._pick_mpoint(df_map, download_size, install_size, True)

        self.assertEqual(mpoint, os.path.join(conf.target.system_root))
Exemplo n.º 12
0
    def pick_download_root_test(self):
        """Take the root for download because there are no other available mountpoints
           even when the root isn't big enough.

           This is required when user skipped the space check.
        """
        df_map = {"/mnt/sysimage/not_used" : Size("20 G"),
                  "/mnt/sysimage/home"     : Size("2 G"),
                  "/mnt/sysimage"         : Size("5 G")}
        download_size = Size("2.5 G")
        install_size = Size("3.0 G")

        mpoint = dnfpayload._pick_mpoint(df_map, download_size, install_size, True)

        self.assertEqual(mpoint, "/mnt/sysimage")