From 14196221d82d1338ba3ac38f540100ac5569966f Mon Sep 17 00:00:00 2001 From: Rafael Fonseca Date: Mon, 29 Oct 2018 14:35:18 +0100 Subject: [PATCH] Add test for multilib modules/packages Signed-off-by: Rafael Fonseca --- tests.c | 1 + tests/multilib/expected | 8 ++++ tests/multilib/input | 1 + tests/multilib/modules.yaml | 86 ++++++++++++++++++++++++++++++++++++ tests/multilib/packages.repo | 23 ++++++++++ 5 files changed, 119 insertions(+) create mode 100644 tests/multilib/expected create mode 100644 tests/multilib/input create mode 100644 tests/multilib/modules.yaml create mode 100644 tests/multilib/packages.repo diff --git a/tests.c b/tests.c index 05e9461..9dfbef4 100644 --- a/tests.c +++ b/tests.c @@ -146,6 +146,7 @@ int main (int argc, char **argv) ADD_TEST ("/require/positive", "positive"); ADD_TEST ("/require/empty", "empty"); ADD_TEST ("/require/alternatives", "alternatives"); + ADD_TEST ("/require/multilib", "multilib"); ADD_TEST ("/module/empty", "empty-module"); g_test_add_func ("/fail/invalid-repo", test_invalid_repo); diff --git a/tests/multilib/expected b/tests/multilib/expected new file mode 100644 index 0000000..a26fed2 --- /dev/null +++ b/tests/multilib/expected @@ -0,0 +1,8 @@ +module:C:master:2018:deadbeef.x86_64@yaml +module:D:compat:2018:deadbeef.i686@yaml +module:E:master:2018:deadbeef.noarch@yaml +*C-1-1.x86_64@repo +*D-1-1.i686@repo +*E-1-1.noarch@repo +bar-1-1.i686@repo +foo-1-1.x86_64@repo diff --git a/tests/multilib/input b/tests/multilib/input new file mode 100644 index 0000000..0fff41f --- /dev/null +++ b/tests/multilib/input @@ -0,0 +1 @@ +module(C) diff --git a/tests/multilib/modules.yaml b/tests/multilib/modules.yaml new file mode 100644 index 0000000..acc3ed8 --- /dev/null +++ b/tests/multilib/modules.yaml @@ -0,0 +1,86 @@ +--- +document: modulemd +version: 2 +data: + name: C + stream: master + version: 2018 + context: deadbeef + arch: x86_64 + artifacts: + rpms: + - C-0:1-1.x86_64 + dependencies: + - requires: + D: [compat] +... +--- +document: modulemd +version: 2 +data: + name: D + stream: master + version: 2018 + context: deadbeef + arch: x86_64 + artifacts: + rpms: + - D-0:1-1.x86_64 + dependencies: + - requires: + E: [master] +... +--- +document: modulemd +version: 2 +data: + name: D + stream: compat + version: 2018 + context: deadbeef + arch: i686 + artifacts: + rpms: + - D-0:1-1.i686 + dependencies: + - requires: + E: [master] +... +--- +document: modulemd +version: 2 +data: + name: E + stream: master + version: 2018 + context: deadbeef + arch: noarch + artifacts: + rpms: + - E-0:1-1.noarch + dependencies: + - requires: + platform: [f29] +... +--- +document: modulemd-defaults +version: 1 +data: + module: C + stream: master +... +--- +document: modulemd-defaults +version: 1 +data: + module: D + stream: master +... +--- +document: modulemd-defaults +version: 1 +data: + module: E + stream: master +... + diff --git a/tests/multilib/packages.repo b/tests/multilib/packages.repo new file mode 100644 index 0000000..c7d4143 --- /dev/null +++ b/tests/multilib/packages.repo @@ -0,0 +1,23 @@ +=Ver: 2.0 + +# Belongs to module:C:master:2018:deadbeef.x86_64 +=Pkg: C 1 1 x86_64 +=Req: foo + +# Belongs to module:D:master:2018:deadbeef.x86_64 +=Pkg: D 1 1 x86_64 +=Req: bar + +# Belongs to module:D:compat:2018:deadbeef.i686 +=Pkg: D 1 1 i686 +=Req: bar + +# Belongs to module:E:master:2018:deadbeef.noarch +=Pkg: E 1 1 noarch + +# Ursine packages +=Pkg: foo 1 1 i686 +=Pkg: foo 1 1 ppc64 +=Pkg: foo 1 1 x86_64 +=Pkg: bar 1 1 i686 +=Pkg: bar 1 1 ppc64