Beispiel #1
0
o.write_opk()
o.write_list()

opkgcl.update()

opkgcl.install("a")
if not opkgcl.is_installed("a"):
        opk.fail("Package 'a' installed but does not report as installed.")
if not opkgcl.is_installed("b"):
        opk.fail("Package 'b' should be installed as a dependency of 'a' but does not report as installed.")
if not opkgcl.is_installed("c"):
        opk.fail("Package 'c' should be installed as a dependency of 'a' but does not report as installed.")

# Check the packages are marked correctly
if opkgcl.is_autoinstalled("a"):
	opk.fail("Package 'a' explicitly installed by user but reports as auto installed.")
if not opkgcl.is_autoinstalled("b"):
	opk.fail("Package 'b' installed as a dependency but does not report as auto installed.")
if not opkgcl.is_autoinstalled("c"):
	opk.fail("Package 'c' installed as a dependency but does not report as auto installed.")

# Check that autoinstalled packages are removed properly
opkgcl.remove("a","--autoremove")
if opkgcl.is_installed("a"):
        opk.fail("Package 'a' removed but reports as installed.")
if opkgcl.is_installed("b"):
        opk.xfail("Package 'b' not removed from --autoremove.")
if opkgcl.is_installed("c"):
        opk.fail("Package 'c' not removed from --autoremove.")
Beispiel #2
0
# Open
#

import os
import opk, cfg, opkgcl

opk.regress_init()

o = opk.OpkGroup()

o.add(Package="x")
o.add(Package="a", Recommends="b")
o.add(Package="b", Conflicts="x")

o.write_opk()
o.write_list()

opkgcl.update()

opkgcl.install("x");
if not opkgcl.is_installed("x"):
    opk.fail("Package 'x' installed but reports as not installed")

opkgcl.install("a");
if not opkgcl.is_installed("x"):
    opk.fail("Package 'x' removed when 'a' installed, but should not be removed.")
if opkgcl.is_installed("b"):
    opk.fail("Package 'b' installed but conflicts with x.")
if not opkgcl.is_installed("a"):
    opk.xfail("Package 'a' not installed even though 'b' is not an absolute dependency of 'a'.")
Beispiel #3
0
# Open
#

import os
import opk, cfg, opkgcl

opk.regress_init()

o = opk.OpkGroup()
o.add(Package="a", Depends="b")
o.add(Package="b")

o.write_opk()
o.write_list()

opkgcl.update()

opkgcl.install("a")
if not opkgcl.is_installed("a"):
        opk.fail("Package 'a' installed but reports as not installed")
if not opkgcl.is_installed("b"):
        opk.fail("Package 'b' should be installed as a dependency of 'a' "
                 "but reports as not installed")

opkgcl.remove("b","--force-removal-of-dependent-packages")
if opkgcl.is_installed("b"):
        opk.fail("Package 'b' removed but reports as installed.")
if opkgcl.is_installed("a"):
        opk.xfail("Package 'b' removed with --force-removal-of-dependent-packages "
                  "but 'a' which depends on 'b' still installed.")
Beispiel #4
0
import os
import opk, cfg, opkgcl

opk.regress_init()

o = opk.OpkGroup()
o.add(Package="a", Version="1.0")
o.add(Package="b", Version="1.0", Recommends="a")
o.write_opk()
o.write_list()

opkgcl.update()

opkgcl.install("b")
if not opkgcl.is_installed("a"):
    opk.fail("Package a should have been auto-installed")
if not opkgcl.is_autoinstalled("a"):
    opk.fail("Package a should have been marked as auto-installed")

o = opk.OpkGroup()
o.add(Package="a", Version="2.0")
o.add(Package="b", Version="2.0")
o.write_opk()
o.write_list()

opkgcl.update()
opkgcl.upgrade("--autoremove")

if opkgcl.is_installed("a"):
    opk.xfail("Package a should have been auto-removed")
Beispiel #5
0
# 4.- Install 'a'
# 5.- Install 'b'
#
# What is the expected output? What do you see instead?
# ======================================
#
# Installation of b fails (it shouldn't)
#

import os
import opk, opkgcl

opk.regress_init()

o = opk.OpkGroup()
o.add(Package="a", Provides="x", Conflicts="x")
o.add(Package="b", Depends="x")
o.add(Package="x")
o.write_opk()
o.write_list()

opkgcl.update()

opkgcl.install("a")
if not opkgcl.is_installed("a"):
	opk.fail("Package 'a' installed but reports as not installed.")

opkgcl.install("b")
if not opkgcl.is_installed("b"):
        opk.xfail("Package 'b' installed but reports as not installed.")
Beispiel #6
0
#

import os
import opk, cfg, opkgcl

opk.regress_init()

o = opk.OpkGroup()
o.add(Package="a", Depends="b")
o.add(Package="b")

o.write_opk()
o.write_list()

opkgcl.update()

opkgcl.install("a")
if not opkgcl.is_installed("a"):
    opk.fail("Package 'a' installed but reports as not installed")
if not opkgcl.is_installed("b"):
    opk.fail("Package 'b' should be installed as a dependency of 'a' "
             "but reports as not installed")

opkgcl.remove("b", "--force-removal-of-dependent-packages")
if opkgcl.is_installed("b"):
    opk.fail("Package 'b' removed but reports as installed.")
if opkgcl.is_installed("a"):
    opk.xfail(
        "[internalsolv] Package 'b' removed with --force-removal-of-dependent-packages "
        "but 'a' which depends on 'b' still installed.")
o.add(Package='a', Recommends='c, d', Version='1.0')
o.add(Package='b', Depends='c')
o.add(Package='c')
o.add(Package='d')
o.write_opk()
o.write_list()

opkgcl.update()

opkgcl.install('a', '--add-ignore-recommends c')

if not opkgcl.is_installed('a'):
    opk.fail("Package 'a' installed but reports as not installed.")

if opkgcl.is_installed('c'):
    opk.xfail("[libsolv<0.7.3] Package 'c' should not have been installed since it was in --add-ignore-recommends.")

if not opkgcl.is_installed('d'):
    opk.fail("Package 'd' installed but reports as not installed.")

opkgcl.remove('a')
opkgcl.remove('d')
opkgcl.install('a b', '--add-ignore-recommends c')

if not opkgcl.is_installed('a'):
    opk.fail("Package 'a' installed but reports as not installed.")

if not opkgcl.is_installed('b'):
    opk.fail("Package 'b' installed but reports as not installed.")

if not opkgcl.is_installed('c'):
Beispiel #8
0
opkgcl.install("x")
if not opkgcl.is_installed("x"):
	opk.fail("Package 'x' failed to install.")

opkgcl.install("y")
if not opkgcl.is_installed("y"):
	opk.fail("Package 'y' failed to install.")

if not opkgcl.is_installed("a"):
	opk.fail("Package 'a' not installed despite being a dependency of installed packages.")

o = opk.OpkGroup()
o.add(Package="a", Version="2.0", Depends="b")
o.add(Package="b")
o.add(Package="x", Depends="a")
o.add(Package="y", Depends="b")
o.write_opk()
o.write_list()

opkgcl.update()
opkgcl.upgrade()

if not opkgcl.is_installed("a", "2.0"):
	opk.fail("New version of package 'a' available during upgrade but was not installed")
if opkgcl.is_installed("a", "1.0"):
	opk.fail("Package 'a' upgraded but old version still installed.")

if not opkgcl.is_installed("b"):
	opk.xfail("Package 'b' not installed despite being a dependency of installed packages.")
Beispiel #9
0
# ======
#
# Open

import opk, cfg, opkgcl

def cleanup():
	opkgcl.remove("a")
	opkgcl.remove("b")
	opkgcl.remove('c')

opk.regress_init()

o = opk.OpkGroup()
o.add(Package="a", Provides="v")
o.add(Package="b", Provides="v", Depends="b_nonexistant")
o.add(Package="c", Depends="v")

o.write_opk()
o.write_list()

opkgcl.update()

# install ``c'' from repository
opkgcl.install("c")
if not opkgcl.is_installed("c"):
	cleanup()
	opk.xfail("package ``c'' not installed.")

cleanup()
Beispiel #10
0
o = opk.OpkGroup()
a2 = opk.Opk(Package="a", Version="2.0", Depends="b")
a2.write()
b1 = opk.Opk(Package="b", Version="1.0", Conflicts="a (<< 2.0)")
b1.write(data_files=["foo"])
o.opk_list.append(a2)
o.opk_list.append(b1)
o.write_list()

os.unlink("foo")

opkgcl.update()
status = opkgcl.upgrade()

if status != 0:
    opk.xfail("Upgrade operation failed (Return value was different than 0)")

if not opkgcl.is_installed("a", "2.0"):
    opk.fail("Package 'a_2.0' not installed.")

foo_fullpath = "{}/foo".format(cfg.offline_root)

if not os.path.exists(foo_fullpath):
    opk.fail("File 'foo' incorrectly orphaned.")

if not foo_fullpath in opkgcl.files("b"):
    opk.fail("Package 'b' does not own file 'foo'.")

opkgcl.remove("a")
opkgcl.remove("b")
Beispiel #11
0
opkgcl.install("a_1.0_all.opk")

o = opk.OpkGroup()
a2 = opk.Opk(Package="a", Version="2.0", Depends="b")
a2.write()
b1 = opk.Opk(Package="b", Version="1.0")
b1.write(data_files=["foo"])
o.opk_list.append(a2)
o.opk_list.append(b1)
o.write_list()

os.unlink("foo")

opkgcl.update()
opkgcl.upgrade()

if not opkgcl.is_installed("a", "2.0"):
	opk.fail("Package 'a_2.0' not installed.")

foo_fullpath = "{}/foo".format(cfg.offline_root)

if not os.path.exists(foo_fullpath):
	opk.xfail("[libsolv] File 'foo' incorrectly orphaned.")

if not foo_fullpath in opkgcl.files("b"):
	opk.fail("Package 'b' does not own file 'foo'.")

opkgcl.remove("a")
opkgcl.remove("b")
Beispiel #12
0
open(x1, "w").close()
open(x2, "w").close()
a = opk.Opk(Package="a")
a.write(data_files=[x1, x2])
os.unlink(x1)
os.unlink(x2)
opkgcl.install("a_1.0_all.opk")

if not opkgcl.is_installed("a"):
    opk.fail("Package 'a' not installed.")

open(x2, "w").close()
open(x3, "w").close()
a = opk.Opk(Package="b", Replaces="a", Provides="a", Conflicts="a")
a.write(data_files=[x2, x3])
os.unlink(x2)
os.unlink(x3)
opkgcl.install("b_1.0_all.opk")

if not opkgcl.is_installed("b"):
    opk.fail("Package 'b' not installed.")
if opkgcl.is_installed("a"):
    opk.fail("Package 'a' was not replaced.")

x2fullpath = "{}/x2".format(cfg.offline_root)
if not x2fullpath in opkgcl.files("b"):
    opk.xfail("Package 'b' does not own file 'x2'.")

opkgcl.remove("b")
Beispiel #13
0
import os
import opk, cfg, opkgcl

opk.regress_init()

o = opk.OpkGroup()

o.add(Package="x")
o.add(Package="a", Recommends="b")
o.add(Package="b", Recommends="c")
o.add(Package="c", Conflicts="x")

o.write_opk()
o.write_list()

opkgcl.update()

opkgcl.install("x");
if not opkgcl.is_installed("x"):
    opk.fail("Package 'x' installed but reports as not installed")

opkgcl.install("a");
if not opkgcl.is_installed("x"):
    opk.fail("Package 'x' removed when 'a' installed, but should not be removed.")
if not opkgcl.is_installed("b"):
    opk.xfail("Package 'b' not installed, but should be installed as a recommended pkg of 'a'.")
if opkgcl.is_installed("c"):
    opk.fail("Package 'c' installed but conflicts with x.")
if not opkgcl.is_installed("a"):
    opk.fail("Package 'a' not installed even though 'c' is not an absolute dependency of 'b'.")
Beispiel #14
0
import os
import opk, cfg, opkgcl

opk.regress_init()

o = opk.OpkGroup()
o.add(Package="a", Version="1.0")
o.add(Package="b", Version="1.0", Recommends="a")
o.write_opk()
o.write_list()

opkgcl.update()

opkgcl.install("b")
if not opkgcl.is_installed("a"):
    opk.fail("Package a should have been auto-installed")
if not opkgcl.is_autoinstalled("a"):
    opk.fail("Package a should have been marked as auto-installed")

o = opk.OpkGroup()
o.add(Package="a", Version="2.0")
o.add(Package="b", Version="2.0")
o.write_opk()
o.write_list()

opkgcl.update()
opkgcl.upgrade("--autoremove")

if opkgcl.is_installed("a"):
    opk.xfail("[libsolv] Package a should have been auto-removed")
Beispiel #15
0
#! /usr/bin/env python
#
# Install a package 'x' which PROVIDES 'v'. Then try to install 'y' which
# PROVIDES and CONFLICTS 'v', indicating that no other provider of the virtual
# package 'v' should be installed at the same time as 'y'.

import os
import opk, cfg, opkgcl

opk.regress_init()

o = opk.OpkGroup()
o.add(Package="x", Provides="v")
o.add(Package="y", Provides="v", Conflicts="v")
o.write_opk()
o.write_list()

opkgcl.update()

opkgcl.install("x")
if not opkgcl.is_installed("x"):
    opk.fail("Package 'x' installed but reports as not installed.")

# Now try to install "y", which should fail

opkgcl.install("y")
if opkgcl.is_installed("y"):
    opk.xfail(
        "Package 'y' installed despite conflict with 'v' provided by 'x'.")
Beispiel #16
0
if not opkgcl.is_installed("y"):
    opk.fail("Package 'y' failed to install.")

if not opkgcl.is_installed("a"):
    opk.fail(
        "Package 'a' not installed despite being a dependency of installed packages."
    )

o = opk.OpkGroup()
o.add(Package="a", Version="2.0", Depends="b")
o.add(Package="b")
o.add(Package="x", Depends="a")
o.add(Package="y", Depends="b")
o.write_opk()
o.write_list()

opkgcl.update()
opkgcl.upgrade()

if not opkgcl.is_installed("a", "2.0"):
    opk.fail(
        "New version of package 'a' available during upgrade but was not installed"
    )
if opkgcl.is_installed("a", "1.0"):
    opk.fail("Package 'a' upgraded but old version still installed.")

if not opkgcl.is_installed("b"):
    opk.xfail(
        "Package 'b' not installed despite being a dependency of installed packages."
    )
Beispiel #17
0
open(x1, "w").close()
open(x2, "w").close()
a = opk.Opk(Package="a")
a.write(data_files=[x1, x2])
os.unlink(x1)
os.unlink(x2)
opkgcl.install("a_1.0_all.opk")

if not opkgcl.is_installed("a"):
    opk.fail("Package 'a' not installed.")

open(x2, "w").close()
open(x3, "w").close()
a = opk.Opk(Package="b", Replaces="a", Provides="a", Conflicts="a")
a.write(data_files=[x2, x3])
os.unlink(x2)
os.unlink(x3)
opkgcl.install("b_1.0_all.opk")

if not opkgcl.is_installed("b"):
    opk.fail("Package 'b' not installed.")
if opkgcl.is_installed("a"):
    opk.fail("Package 'a' was not replaced.")

x2fullpath = "{}/x2".format(cfg.offline_root)
if not x2fullpath in opkgcl.files("b"):
    opk.xfail("[libsolv] Package 'b' does not own file 'x2'.")

opkgcl.remove("b")
Beispiel #18
0
opk.regress_init()

o = opk.OpkGroup()
o.add(Package="x")
o.add(Package="a", Depends="b, c")
o.add(Package="b")
o.add(Package="c", Conflicts="x")

o.write_opk()
o.write_list()
opkgcl.update()

opkgcl.install("x")
if not opkgcl.is_installed("x"):
    opk.fail("Package 'x' installed but reports as not installed.")

opkgcl.install("a")
if opkgcl.is_installed("c"):
    opk.fail("Package 'c' installed but conflicts with x.")
if opkgcl.is_installed("a"):
    opk.fail(
        "Package 'a' installed but dependency 'c' is not installed due to a conflict."
    )
if opkgcl.is_installed("b"):
    opk.xfail("Package 'b' installed and orphaned.")

opkgcl.remove("x")
opkgcl.remove("a")
opkgcl.remove("b")
opkgcl.remove("c")
Beispiel #19
0
	opk.fail("Package 'b' not installed despite dependency from package 'a'.")

o = opk.OpkGroup()
o.add(Package="a", Version="1.1", Depends="b (= 1.1)")
o.add(Package="b", Version="1.1")
o.write_opk()
o.write_list()

opkgcl.update()

# 'opkg upgrade b' should fail as it won't upgrade a
opkgcl.upgrade("b")

# Check 'a' has not been upgraded
if opkgcl.is_installed("a", "1.1"):
	opk.xfail("[libsolv] Package 'a' upgraded despite not being listed in packages to upgrade.")
if not opkgcl.is_installed("a", "1.0"):
	opk.fail("Package 'a' version 1.0 removed.")

# Check 'b' has not been upgraded
if opkgcl.is_installed("b", "1.1"):
	opk.fail("Package 'b' upgraded despite breaking dependency of package 'a'.")
if not opkgcl.is_installed("b", "1.0"):
	opk.fail("Package 'b' version 1.0 removed.")

# 'opkg upgrade a' should succeed and upgrade both a and b
opkgcl.upgrade("a")

# Check 'a' has been upgraded
if not opkgcl.is_installed("a", "1.1"):
	opk.fail("Package 'a' failed to upgrade.")
Beispiel #20
0
    opk.fail(
        "Package 'b' should be installed as a dependency of 'a' but does not report as installed."
    )
if not opkgcl.is_installed("c"):
    opk.fail(
        "Package 'c' should be installed as a dependency of 'a' but does not report as installed."
    )

# Check the packages are marked correctly
if opkgcl.is_autoinstalled("a"):
    opk.fail(
        "Package 'a' explicitly installed by user but reports as auto installed."
    )
if not opkgcl.is_autoinstalled("b"):
    opk.fail(
        "Package 'b' installed as a dependency but does not report as auto installed."
    )
if not opkgcl.is_autoinstalled("c"):
    opk.fail(
        "Package 'c' installed as a dependency but does not report as auto installed."
    )

# Check that autoinstalled packages are removed properly
opkgcl.remove("a", "--autoremove")
if opkgcl.is_installed("a"):
    opk.fail("Package 'a' removed but reports as installed.")
if opkgcl.is_installed("b"):
    opk.xfail("[internalsolv] Package 'b' not removed from --autoremove.")
if opkgcl.is_installed("c"):
    opk.fail("Package 'c' not removed from --autoremove.")
Beispiel #21
0
# 4.- Install 'a'
# 5.- Install 'b'
#
# What is the expected output? What do you see instead?
# ======================================
#
# Installation of b fails (it shouldn't)
#

import os
import opk, opkgcl

opk.regress_init()

o = opk.OpkGroup()
o.add(Package="a", Provides="x", Conflicts="x")
o.add(Package="b", Depends="x")
o.add(Package="x")
o.write_opk()
o.write_list()

opkgcl.update()

opkgcl.install("a")
if not opkgcl.is_installed("a"):
    opk.fail("Package 'a' installed but reports as not installed.")

opkgcl.install("b")
if not opkgcl.is_installed("b"):
    opk.xfail("Package 'b' installed but reports as not installed.")
import os
import opk, cfg, opkgcl

opk.regress_init()

o = opk.OpkGroup()
o.add(Package="a", Version="1.0")
o.add(Package="b", Version="1.0", Recommends="a")
o.write_opk()
o.write_list()

opkgcl.update()

opkgcl.install("b")
if not opkgcl.is_installed("a"):
	opk.fail("Package a should have been auto-installed")
if not opkgcl.is_autoinstalled("a"):
	opk.fail("Package a should have been marked as auto-installed")

o = opk.OpkGroup()
o.add(Package="a", Version="2.0")
o.add(Package="b", Version="2.0")
o.write_opk()
o.write_list()

opkgcl.update()
opkgcl.upgrade("--autoremove")

if opkgcl.is_installed("a"):
	opk.xfail("[libsolv] Package a should have been auto-removed")
Beispiel #23
0
o = opk.OpkGroup()

o.add(Package="x")
o.add(Package="a", Recommends="b, c")
o.add(Package="b")
o.add(Package="c", Conflicts="x")

o.write_opk()
o.write_list()

opkgcl.update()

opkgcl.install("x")
if not opkgcl.is_installed("x"):
    opk.fail("Package 'x' installed but reports as not installed")

opkgcl.install("a")
if not opkgcl.is_installed("x"):
    opk.fail(
        "Package 'x' removed when 'a' installed, but should not be removed.")
if not opkgcl.is_installed("b"):
    opk.xfail(
        "Package 'b' not installed, but should be installed as a recommended pkg of 'a'."
    )
if opkgcl.is_installed("c"):
    opk.fail("Package 'c' installed but conflicts with x.")
if not opkgcl.is_installed("a"):
    opk.fail(
        "Package 'a' not installed even though 'c' is not an absolute dependency of 'a'."
    )
Beispiel #24
0
import os
import opk, cfg, opkgcl

opk.regress_init()

o = opk.OpkGroup()
o.add(Package="a", Version="1.0")
o.add(Package="b", Version="1.0", Recommends="a")
o.write_opk()
o.write_list()

opkgcl.update()

opkgcl.install("b")
if not opkgcl.is_installed("a"):
	opk.fail("Package a should have been auto-installed")
if not opkgcl.is_autoinstalled("a"):
	opk.fail("Package a should have been marked as auto-installed")

o = opk.OpkGroup()
o.add(Package="a", Version="2.0")
o.add(Package="b", Version="2.0")
o.write_opk()
o.write_list()

opkgcl.update()
opkgcl.upgrade("--autoremove")

if opkgcl.is_installed("a"):
	opk.xfail("Package a should have been auto-removed")
# SPDX-License-Identifier: GPL-2.0-only
#
# Install a package 'x' which PROVIDES 'v'. Then try to install 'y' which
# PROVIDES and CONFLICTS 'v', indicating that no other provider of the virtual
# package 'v' should be installed at the same time as 'y'.

import os
import opk, cfg, opkgcl

opk.regress_init()

o = opk.OpkGroup()
o.add(Package="x", Provides="v")
o.add(Package="y", Provides="v", Conflicts="v")
o.write_opk()
o.write_list()

opkgcl.update()

opkgcl.install("x")
if not opkgcl.is_installed("x"):
    opk.fail("Package 'x' installed but reports as not installed.")

# Now try to install "y", which should fail

opkgcl.install("y")
if opkgcl.is_installed("y"):
    opk.xfail(
        "[internalsolv] Package 'y' installed despite conflict with 'v' provided by 'x'."
    )
Beispiel #26
0
open(x1, "w").close()
open(x2, "w").close()
a = opk.Opk(Package="a")
a.write(data_files=[x1, x2])
os.unlink(x1)
os.unlink(x2)
opkgcl.install("a_1.0_all.opk")

if not opkgcl.is_installed("a"):
    opk.fail("Package 'a' not installed.")

open(x2, "w").close()
open(x3, "w").close()
a = opk.Opk(Package="b", Replaces="a", Provides="a", Conflicts="a")
a.write(data_files=[x2, x3])
os.unlink(x2)
os.unlink(x3)
opkgcl.install("b_1.0_all.opk")

if not opkgcl.is_installed("b"):
        opk.fail("Package 'b' not installed.")
if opkgcl.is_installed("a"):
        opk.fail("Package 'a' was not replaced.")

x2fullpath = "{}/x2".format(cfg.offline_root)
if not x2fullpath in opkgcl.files("b"):
        opk.xfail("[libsolv] Package 'b' does not own file 'x2'.")

opkgcl.remove("b")
Beispiel #27
0
opk.regress_init()

o = opk.OpkGroup()
o.add(Package='a-b', Version='1.0')
o.add(Package='a-c', Version='1.0')
o.add(Package='b-a', Version='1.0')
o.write_opk()
o.write_list()

opkgcl.update()

opkgcl.install("'a*'")
if not opkgcl.is_installed('a-b'):
    opk.xfail(
        "[internalsolv] Package 'a-b' not installed but reports as being installed."
    )
if not opkgcl.is_installed('a-c'):
    opk.fail("Package 'a-c' not installed but reports as being installed.")
if opkgcl.is_installed('b-a'):
    opk.fail("Package 'b-a' was incorrectly installed")

opkgcl.remove("'a*'")
if opkgcl.is_installed('a-b'):
    opk.fail("Package 'a-b' failed to remove")
if opkgcl.is_installed('a-c'):
    opk.fail("Package 'a-c' failed to remove")

opkgcl.install("'?-b'")
if not opkgcl.is_installed('a-b'):
    opk.fail("Package 'a-b' not installed but reports as being installed.")
#! /usr/bin/env python
#
# Install a package 'x' which PROVIDES 'v'. Then try to install 'y' which
# PROVIDES and CONFLICTS 'v', indicating that no other provider of the virtual
# package 'v' should be installed at the same time as 'y'.

import os
import opk, cfg, opkgcl

opk.regress_init()

o = opk.OpkGroup()
o.add(Package="x", Provides="v")
o.add(Package="y", Provides="v", Conflicts="v")
o.write_opk()
o.write_list()

opkgcl.update()

opkgcl.install("x")
if not opkgcl.is_installed("x"):
	opk.fail("Package 'x' installed but reports as not installed.")

# Now try to install "y", which should fail

opkgcl.install("y")
if opkgcl.is_installed("y"):
	opk.xfail("Package 'y' installed despite conflict with 'v' provided by 'x'.")
	b = opk.Opk(Package="b", Version="2.0")
	b.write(data_files=["asdf"])

	o = opk.OpkGroup()
	o.addOpk(a)
	o.addOpk(b)
	o.write_list()

	opkgcl.update()
	opkgcl.upgrade();

	if not opkgcl.is_autoinstalled("b"):
		opk.fail("b is not autoinstalled anymore")

a = opk.Opk(Package="a", Version="3.0")
a.write(data_files=["asdf"])
os.unlink("asdf")

o = opk.OpkGroup()
o.addOpk(a)
o.write_list()

opkgcl.update()
opkgcl.upgrade();

if opkgcl.is_installed("b", "2.0"):
	opk.xfail("[libsolv] b is still installed")

if not opkgcl.is_installed("a", "3.0"):
	opk.fail("a is not installed")
#! /usr/bin/env python
#
# Install a package 'x' which PROVIDES 'v' and ensure that we can install
# another package 'y' which also PROVIDES 'v'.

import os
import opk, cfg, opkgcl

opk.regress_init()

o = opk.OpkGroup()
o.add(Package="x", Provides="v")
o.add(Package="y", Provides="v")
o.write_opk()
o.write_list()

opkgcl.update()

opkgcl.install("x")
if not opkgcl.is_installed("x"):
	opk.fail("Package 'x' installed but reports as not installed.")

# Now try to install "y", which should succeed

opkgcl.install("y")
if not opkgcl.is_installed("y"):
	opk.xfail("Package 'y' not installed despite lack of conflicts.")
Beispiel #31
0
#
# Within the function `pkg_hash_fetch_best_installation_candidate`, we wish to
# test the condition where `(held_pkg && good_pkg_by_name) == true`. So install
# a 1.0, mark it as on hold and explicitly install 'a_2.0_all.opk'. This
# installation should be blocked.
#

import os
import opk, cfg, opkgcl

opk.regress_init()

a_10 = opk.Opk(Package="a", Version="1.0")
a_10.write()
a_20 = opk.Opk(Package="a", Version="2.0")
a_20.write()

opkgcl.install("a_1.0_all.opk")
if not opkgcl.is_installed("a"):
	opk.fail("Package 'a' installed but reports as not installed.")

opkgcl.flag_hold("a")

# Try to explicitly install a version 2.0
opkgcl.install("a_2.0_all.opk")

if opkgcl.is_installed("a", "2.0"):
	opk.xfail("Old version of package 'a' flagged as on hold but was upgraded.")
if not opkgcl.is_installed("a", "1.0"):
	opk.fail("Package 'a' not upgraded but old version was removed.")
Beispiel #32
0
	opk.fail("Package 'b' not installed despite dependency from package 'a'.")

o = opk.OpkGroup()
o.add(Package="a", Version="1.1", Depends="b (= 1.1)")
o.add(Package="b", Version="1.1")
o.write_opk()
o.write_list()

opkgcl.update()

# 'opkg upgrade b' should fail as it won't upgrade a
opkgcl.upgrade("b")

# Check 'a' has not been upgraded
if opkgcl.is_installed("a", "1.1"):
	opk.xfail("[ok for libsolv] Package 'a' upgraded despite not being listed in packages to upgrade.")
if not opkgcl.is_installed("a", "1.0"):
	opk.fail("Package 'a' version 1.0 removed.")

# Check 'b' has not been upgraded
if opkgcl.is_installed("b", "1.1"):
	opk.fail("Package 'b' upgraded despite breaking dependency of package 'a'.")
if not opkgcl.is_installed("b", "1.0"):
	opk.fail("Package 'b' version 1.0 removed.")

# 'opkg upgrade a' should succeed and upgrade both a and b
opkgcl.upgrade("a")

# Check 'a' has been upgraded
if not opkgcl.is_installed("a", "1.1"):
	opk.fail("Package 'a' failed to upgrade.")
Beispiel #33
0
import os
import opk, cfg, opkgcl

opk.regress_init()

o = opk.OpkGroup()
o.add(Package="a", Version="1.0", Depends="b")
o.add(Package="b")
o.write_opk()
o.write_list()
opkgcl.update()
opkgcl.install("a")

o = opk.OpkGroup()
o.add(Package="a", Version="2.0", Depends="c")
o.add(Package="c", Conflicts="b")
o.write_opk()
o.write_list()

opkgcl.update()
status = opkgcl.upgrade("--autoremove")

if not opkgcl.is_installed("a", "2.0"):
    opk.xfail("New version of package 'a' available during upgrade but was not installed")
if status != 0:
    opk.xfail("Return value was different than 0")

opkgcl.remove("a")
opkgcl.remove("b")
opkgcl.remove("c")
Beispiel #34
0
import os
import opk, cfg, opkgcl

opk.regress_init()

o = opk.OpkGroup()

o.add(Package="x")
o.add(Package="a", Recommends="b, c")
o.add(Package="b")
o.add(Package="c", Conflicts="x")

o.write_opk()
o.write_list()

opkgcl.update()

opkgcl.install("x");
if not opkgcl.is_installed("x"):
    opk.fail("Package 'x' installed but reports as not installed")

opkgcl.install("a");
if not opkgcl.is_installed("x"):
    opk.fail("Package 'x' removed when 'a' installed, but should not be removed.")
if not opkgcl.is_installed("b"):
    opk.xfail("[internalsolv] Package 'b' not installed, but should be installed as a recommended pkg of 'a'.")
if opkgcl.is_installed("c"):
    opk.fail("Package 'c' installed but conflicts with x.")
if not opkgcl.is_installed("a"):
    opk.fail("Package 'a' not installed even though 'c' is not an absolute dependency of 'a'.")
Beispiel #35
0
# Open

import opk, cfg, opkgcl


def cleanup():
    opkgcl.remove("a")
    opkgcl.remove("b")
    opkgcl.remove('c')


opk.regress_init()

o = opk.OpkGroup()
o.add(Package="a", Provides="v")
o.add(Package="b", Provides="v", Depends="b_nonexistant")
o.add(Package="c", Depends="v")

o.write_opk()
o.write_list()

opkgcl.update()

# install ``c'' from repository
opkgcl.install("c")
if not opkgcl.is_installed("c"):
    cleanup()
    opk.xfail("package ``c'' not installed.")

cleanup()
Beispiel #36
0
open(x1, "w").close()
open(x2, "w").close()
a = opk.Opk(Package="a")
a.write(data_files=[x1, x2])
os.unlink(x1)
os.unlink(x2)
opkgcl.install("a_1.0_all.opk")

if not opkgcl.is_installed("a"):
    opk.fail("Package 'a' not installed.")

open(x2, "w").close()
open(x3, "w").close()
a = opk.Opk(Package="b", Replaces="a", Provides="a", Conflicts="a")
a.write(data_files=[x2, x3])
os.unlink(x2)
os.unlink(x3)
opkgcl.install("b_1.0_all.opk")

if not opkgcl.is_installed("b"):
        opk.fail("Package 'b' not installed.")
if opkgcl.is_installed("a"):
        opk.fail("Package 'a' was not replaced.")

x2fullpath = "{}/x2".format(cfg.offline_root)
if not x2fullpath in opkgcl.files("b"):
        opk.xfail("Package 'b' does not own file 'x2'.")

opkgcl.remove("b")
Beispiel #37
0
opk.regress_init()

o = opk.OpkGroup()
o.add(Package="x")
o.add(Package="a", Depends="b, c")
o.add(Package="b")
o.add(Package="c", Conflicts="x");


o.write_opk()
o.write_list()
opkgcl.update()

opkgcl.install("x")
if not opkgcl.is_installed("x"):
    opk.fail("Package 'x' installed but reports as not installed.")

opkgcl.install("a")
if opkgcl.is_installed("c"):
    opk.fail("Package 'c' installed but conflicts with x.")
if opkgcl.is_installed("a"):
    opk.fail("Package 'a' installed but dependency 'c' is not installed due to a conflict.")
if opkgcl.is_installed("b"):
    opk.xfail("Package 'b' installed and orphaned.")

opkgcl.remove("x")
opkgcl.remove("a")
opkgcl.remove("b")
opkgcl.remove("c")
Beispiel #38
0
# Open

import opk, cfg, opkgcl


def cleanup():
    opkgcl.remove("a")
    opkgcl.remove("b")
    opkgcl.remove('c')


opk.regress_init()

o = opk.OpkGroup()
o.add(Package="a", Provides="v")
o.add(Package="b", Provides="v", Depends="b_nonexistant")
o.add(Package="c", Depends="v")

o.write_opk()
o.write_list()

opkgcl.update()

# install ``c'' from repository
opkgcl.install("c")
if not opkgcl.is_installed("c"):
    cleanup()
    opk.xfail("[internalsolv] package ``c'' not installed.")

cleanup()
Beispiel #39
0
import opk, cfg, opkgcl

opk.regress_init()

o = opk.OpkGroup()
o.add(Package='a', Depends='b', Essential='yes')
o.add(Package='b', Depends='c')
o.add(Package='c')

o.write_opk()
o.write_list()
opkgcl.update()

opkgcl.install('a')
if not opkgcl.is_installed('a'):
    opk.fail("Package 'a' installed but does not report as installed.")
if not opkgcl.is_installed('b'):
    opk.fail("Package 'b' installed but does not report as installed.")
if not opkgcl.is_installed('c'):
    opk.fail("Package 'c' installed but does not report as installed.")

opkgcl.remove('c', '--force-removal-of-dependent-packages')
if not opkgcl.is_installed('b'):
    opk.xfail(
        "[internalsolv] Package 'b' was removed, but Essential package 'a' depends on it"
    )
if not opkgcl.is_installed('c'):
    opk.fail("Package 'c' was removed, which breaks Essential package 'a'")
if not opkgcl.is_installed('a'):
    opk.fail("Essential package 'a' was incorrectly removed")
Beispiel #40
0
import os
import opk, cfg, opkgcl

opk.regress_init()

o = opk.OpkGroup()

o.add(Package="x")
o.add(Package="a", Recommends="b")
o.add(Package="b", Conflicts="x")

o.write_opk()
o.write_list()

opkgcl.update()

opkgcl.install("x")
if not opkgcl.is_installed("x"):
    opk.fail("Package 'x' installed but reports as not installed")

opkgcl.install("a")
if not opkgcl.is_installed("x"):
    opk.fail(
        "Package 'x' removed when 'a' installed, but should not be removed.")
if opkgcl.is_installed("b"):
    opk.fail("Package 'b' installed but conflicts with x.")
if not opkgcl.is_installed("a"):
    opk.xfail(
        "Package 'a' not installed even though 'b' is not an absolute dependency of 'a'."
    )
Beispiel #41
0
opk.regress_init()

o = opk.OpkGroup()
o.add(Package="a", Version="1.0", Depends="b")
o.add(Package="b")
o.write_opk()
o.write_list()
opkgcl.update()
opkgcl.install("a")

o = opk.OpkGroup()
o.add(Package="a", Version="2.0", Depends="c")
o.add(Package="c", Conflicts="b")
o.write_opk()
o.write_list()

opkgcl.update()
status = opkgcl.upgrade("a", "--autoremove")

if not opkgcl.is_installed("a", "2.0"):
    opk.xfail(
        "[internalsolv] New version of package 'a' available during upgrade but was not installed"
    )
if status != 0:
    opk.fail("Return value was different than 0")

opkgcl.remove("a")
opkgcl.remove("b")
opkgcl.remove("c")
o.write_opk()
o.write_list()

opkgcl.update()

opkgcl.install("a=1.0")
if not opkgcl.is_installed("a", "1.0"):
    opk.fail("Package 'a', Version '1.0', failed to install.")

if opkgcl.is_upgradable("a", "2.0"):
    opk.fail(
        "Package 'a', is upgradable to version '2.0', though a better candidate is available."
    )

if not opkgcl.is_upgradable("a", "3.0"):
    opk.xfail("[libsolv] Package 'a', is not upgradable to version '3.0'.")

opkgcl.install("a=2.0")
if not opkgcl.is_installed("a", "2.0"):
    opk.fail("Package 'a', Version '2.0', failed to install.")

if not opkgcl.is_upgradable("a", "3.0"):
    opk.xfail("[libsolv] Package 'a', is not upgradable to version '3.0'.")

opkgcl.install("a=3.0")
if not opkgcl.is_installed("a", "3.0"):
    opk.fail("Package 'a', Version '3.0', failed to install.")

if opkgcl.is_upgradable("a"):
    opk.fail("Package 'a', is upgradable, but is already the latest.")