Commit Graph

15 Commits

Author SHA1 Message Date
Alexandre Detiste
fb69627ad3
Use unittest.mock from core python everywhere
mock was an independent module that has been merged into the Python standard library.
2024-02-18 22:15:30 +01:00
Marcus Schäfer
c39b7396b8
Support URIs with credentials in solver plugin
check if the URI string contains credentials and
extract/trim them from the uri object. The urlparse
class does not recognize this information as a valid
URI and throws an exception
2022-08-09 15:43:44 +02:00
Marcus Schäfer
9c9250ebc4
Support nose and xunit style tests
The modifications in this commit allows the unit tests
to run on both, pytest 6.x (nose test layout) and the new
pytest 7.x (xunit test layout). This Fixes #2072 in a
much nicer way. Thanks much to @smarlowucf
2022-02-26 20:26:18 +01:00
Marcus Schäfer
1f869e7ca8
Revert "Unit test adaptions to pytest v7"
This reverts commit 0dc2e803e0.
The pytest interface from version v6 to v7 has received
changes which requires the tests to be adapted to work for
either the old or the new interface. As there are still many
distributions which uses v6 as the standard we decided to
revert back the adaptions done to support v7 and create
a version requirement to v6 in .virtualenv.dev-requirements.txt
This Fixes #2072
2022-02-26 20:19:42 +01:00
Marcus Schäfer
0dc2e803e0
Fixed unit tests
The pytest interface setup() method call has changed
in a way that an additional parameter is passed to
the method which leads to a python error at invocation
time if the setup method does not define it.
2022-02-07 21:27:39 +01:00
Marcus Schäfer
fc2446dfea
Moving temp data handling to its own namespace
Moving use of mkdtemp, NamedTemporaryFile and TemporaryDirectory
into its own class called Temporary: By default all temporary
data is created below /var/tmp but can be changed via the
global commandline option --temp-dir. This Fixes #1870
2021-07-22 13:31:44 +02:00
Marcus Schäfer
ce9b1ccc08
Added option to set the image target architecture
The option --target-arch allows to set the architecture
used to build the image. By default this is the host
architecture. Please note, if the specified architecture
name does not match the host architecture and is therefore
requesting a cross architecture image build, it's important
to understand that for this process to work a preparatory
step to support the image architecture and binary format
on the building host is required and is not considered a
responsibility of kiwi. There will be a followup effort
on providing a plugin for kiwi which should be used to
manage the needed binfmt settings for cross arch image
builds
2021-04-14 12:53:28 +02:00
Marcus Schäfer
93d72e78dc
Change packagemanager setting from apt-get to apt
In kiwi we use the name of the section as package name to install this
package manager capability. However on Debian based distros there is
no package named apt-get. There is only a package named apt which
provides a tool named apt-get. To avoid inconsistencies like we had it
in Issue #1735 and to bring this setting in line with all other
packagemanager settings the setting was moved to just apt.
This Fixes #1738
2021-03-15 16:13:02 +01:00
Marcus Schäfer
aae7da639d
Added deb support to sat solver module
Add support to create SAT solvables from Debian repos via
deb2solv tool from libsolv. This allows image info --resolve-package-list
to work with Debian/Ubuntu image descriptions. Please note
by default libsolv is not compiled with support for Debian.
Therefore the following compile flags must be set on libsolv

* -DENABLE_DEBIAN=1
* -DMULTI_SEMANTICS=1

If libsolv does not provide the needed capabilities kiwi will
fail on either the repository solvable creation due to missing
deb2solv or on call of setdisttype() due to missing MULTI_SEMANTICS
feature in libsolv
2021-02-21 18:50:16 +01:00
Marcus Schäfer
a9c0f367cc
Fixed detection for pacman repo type
grep the directory listing for a .db.sig metadata file
to identify a pacman repo
2021-02-05 16:51:13 +01:00
Marcus Schäfer
e4a992e1aa
Added get_repo_type method to SolverRepository
In preparation of a plugin to handle external service
repositories a method to check for the repository type
was added. The detection is based on a search for a
specific metadata file which is an indicator for the
type of a repository.
2021-02-05 11:36:48 +01:00
Marcus Schäfer
ff213dfdd5
Refactor SolverRepository
This commit refactors SolverRepository to turn it into a proper
factory class and to also include type hints to facilitate it's
use from an API POV. Related to #1498
2020-11-02 10:43:26 +01:00
Marcus Schäfer
25f75f1f8d
Fixed sat solver flags validation
The sat library from the python3-solv plugin does not expose
the flags information as method. Instead the flags value is
a variable pointing to an integer that has a name mapping
in self.solv.Selection from the library.
2020-01-27 17:11:36 +01:00
Marcus Schäfer
bdb7123fa1
Refactor use of logging facility
Use getLogger method instead of a global log object
Also use caplog fixture to capture log messages in
unit tests. This Fixes #1244
2019-10-23 17:54:27 +02:00
David Cassany
4b3a105026
Re-structure unit tests folders
This commit relocates unit tests to a folder structure that matches
the source code structure.

Fixes #1128
2019-10-21 14:00:05 +02:00