runcible 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +18 -0
- data/Gemfile +19 -0
- data/LICENSE +22 -0
- data/README.md +29 -0
- data/Rakefile +37 -0
- data/lib/runcible.rb +25 -0
- data/lib/runcible/base.rb +113 -0
- data/lib/runcible/extensions/repository.rb +67 -0
- data/lib/runcible/oauth_setup.rb +29 -0
- data/lib/runcible/resources/repository.rb +82 -0
- data/lib/runcible/resources/role.rb +46 -0
- data/lib/runcible/resources/task.rb +49 -0
- data/lib/runcible/resources/user.rb +50 -0
- data/lib/runcible/version.rb +3 -0
- data/rel-eng/packages/.readme +3 -0
- data/rel-eng/tito.props +5 -0
- data/runcible.gemspec +17 -0
- data/runcible.spec +48 -0
- data/test/.gitkeep +0 -0
- data/test/integration/extensions/repository_test.rb +117 -0
- data/test/integration/fixtures/repositories/zoo5/.treeinfo +12 -0
- data/test/integration/fixtures/repositories/zoo5/CHANGESET +11 -0
- data/test/integration/fixtures/repositories/zoo5/PULP_MANIFEST +1 -0
- data/test/integration/fixtures/repositories/zoo5/cheetah-0.3-0.8.noarch.rpm +0 -0
- data/test/integration/fixtures/repositories/zoo5/create.sh +20 -0
- data/test/integration/fixtures/repositories/zoo5/elephant-0.3-0.8.noarch.rpm +0 -0
- data/test/integration/fixtures/repositories/zoo5/empty.iso +0 -0
- data/test/integration/fixtures/repositories/zoo5/giraffe-0.3-0.8.noarch.rpm +0 -0
- data/test/integration/fixtures/repositories/zoo5/images/test1.img +0 -0
- data/test/integration/fixtures/repositories/zoo5/images/test2.img +0 -0
- data/test/integration/fixtures/repositories/zoo5/lion-0.3-0.8.noarch.rpm +0 -0
- data/test/integration/fixtures/repositories/zoo5/monkey-0.3-0.8.noarch.rpm +0 -0
- data/test/integration/fixtures/repositories/zoo5/penguin-0.3-0.8.noarch.rpm +0 -0
- data/test/integration/fixtures/repositories/zoo5/repodata/06661e2a9839cf0beebcf409410ca4f93c09081f4e772fd0d03e1faf62705a11-comps.xml +39 -0
- data/test/integration/fixtures/repositories/zoo5/repodata/0c4d57a68f9a3b13dabc6f8b01ca8958aa796167cececee04717edfc26d02f2d-other.xml.gz +0 -0
- data/test/integration/fixtures/repositories/zoo5/repodata/298ce23f48b3613e030d19f3d9c2ff2df31c2f08479bdf94cebb87c208e48c0e-filelists.xml.gz +0 -0
- data/test/integration/fixtures/repositories/zoo5/repodata/32c0e38317aade0c057b173ff62344e912e1bd650409c6ac31aecee78e3413af-comps.xml.gz +0 -0
- data/test/integration/fixtures/repositories/zoo5/repodata/34d954906c7ce7aa2254e24d7be0a9049e0a2f436add023ca056123a2d48e30e-updateinfo.xml.gz +0 -0
- data/test/integration/fixtures/repositories/zoo5/repodata/63aedd074d9f0daf7c6be8c61f91d76a962bb6ceda86b9abd2140f154c320fa2-other.sqlite.bz2 +0 -0
- data/test/integration/fixtures/repositories/zoo5/repodata/69d65cdebffc6199d3adb3e38b06ca9abaae6c1c7366805099987b28f182178d-filelists.sqlite.bz2 +0 -0
- data/test/integration/fixtures/repositories/zoo5/repodata/799241a518a4a6b11a68f8e6fbdb719875f87832f60accc0851ced0d6a0497c6-updateinfo.xml.gz +0 -0
- data/test/integration/fixtures/repositories/zoo5/repodata/a4ea9fcdce31dc8673c7a9ba66c086bd6a16e1eff717e3896dd1cac444a1423c-primary.xml.gz +0 -0
- data/test/integration/fixtures/repositories/zoo5/repodata/fb9b9508e148368d0edf7e03dc905b343937fd958e6531cce6380933d18c3455-primary.sqlite.bz2 +0 -0
- data/test/integration/fixtures/repositories/zoo5/repodata/repomd.xml +75 -0
- data/test/integration/fixtures/repositories/zoo5/squirrel-0.3-0.8.noarch.rpm +0 -0
- data/test/integration/fixtures/repositories/zoo5/updateinfo.xml +26 -0
- data/test/integration/fixtures/repositories/zoo5/walrus-0.3-0.8.noarch.rpm +0 -0
- data/test/integration/fixtures/vcr_cassettes/extensions/pulp_repository_extensions.yml +137 -0
- data/test/integration/fixtures/vcr_cassettes/pulp_consumer.yml +1529 -0
- data/test/integration/fixtures/vcr_cassettes/pulp_consumer_group.yml +430 -0
- data/test/integration/fixtures/vcr_cassettes/pulp_consumer_helper.yml +120 -0
- data/test/integration/fixtures/vcr_cassettes/pulp_distribution.yml +77 -0
- data/test/integration/fixtures/vcr_cassettes/pulp_errata.yml +77 -0
- data/test/integration/fixtures/vcr_cassettes/pulp_filter.yml +233 -0
- data/test/integration/fixtures/vcr_cassettes/pulp_filter_helper.yml +81 -0
- data/test/integration/fixtures/vcr_cassettes/pulp_package.yml +155 -0
- data/test/integration/fixtures/vcr_cassettes/pulp_package_group.yml +40 -0
- data/test/integration/fixtures/vcr_cassettes/pulp_package_group_category.yml +40 -0
- data/test/integration/fixtures/vcr_cassettes/pulp_ping.yml +40 -0
- data/test/integration/fixtures/vcr_cassettes/pulp_repository.yml +1196 -0
- data/test/integration/fixtures/vcr_cassettes/pulp_repository_helper.yml +8659 -0
- data/test/integration/fixtures/vcr_cassettes/pulp_repository_sync.yml +215 -0
- data/test/integration/fixtures/vcr_cassettes/pulp_role.yml +133 -0
- data/test/integration/fixtures/vcr_cassettes/pulp_roles.yml +120 -0
- data/test/integration/fixtures/vcr_cassettes/pulp_task.yml +943 -0
- data/test/integration/fixtures/vcr_cassettes/pulp_user.yml +288 -0
- data/test/integration/fixtures/vcr_cassettes/pulp_user_helper.yml +195 -0
- data/test/integration/resources/helpers/consumer_helper.rb +49 -0
- data/test/integration/resources/helpers/filter_helper.rb +44 -0
- data/test/integration/resources/helpers/repository_helper.rb +127 -0
- data/test/integration/resources/pulp_consumer_group_test.rb +182 -0
- data/test/integration/resources/pulp_consumer_test.rb +200 -0
- data/test/integration/resources/pulp_distribution_test.rb +55 -0
- data/test/integration/resources/pulp_errata_test.rb +60 -0
- data/test/integration/resources/pulp_filter_test.rb +92 -0
- data/test/integration/resources/pulp_package_group_category_test.rb +55 -0
- data/test/integration/resources/pulp_package_group_test.rb +56 -0
- data/test/integration/resources/pulp_package_test.rb +79 -0
- data/test/integration/resources/pulp_ping_test.rb +31 -0
- data/test/integration/resources/pulp_repository_test.rb +307 -0
- data/test/integration/resources/pulp_role_test.rb +62 -0
- data/test/integration/resources/pulp_task_test.rb +79 -0
- data/test/integration/resources/pulp_user_test.rb +105 -0
- data/test/integration/test_runner.rb +113 -0
- data/test/integration/vcr_setup.rb +22 -0
- data/test/unit/test_base.rb +62 -0
- metadata +218 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Copyright (c) 2012 Eric D Helms
|
|
2
|
+
#
|
|
3
|
+
# MIT License
|
|
4
|
+
#
|
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
+
# a copy of this software and associated documentation files (the
|
|
7
|
+
# "Software"), to deal in the Software without restriction, including
|
|
8
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
+
# the following conditions:
|
|
12
|
+
#
|
|
13
|
+
# The above copyright notice and this permission notice shall be
|
|
14
|
+
# included in all copies or substantial portions of the Software.
|
|
15
|
+
#
|
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
20
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
23
|
+
|
|
24
|
+
require 'lib/runcible/base'
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
module Runcible
|
|
28
|
+
module Pulp
|
|
29
|
+
class Role < Runcible::Base
|
|
30
|
+
|
|
31
|
+
def self.path(role=nil)
|
|
32
|
+
(role == nil) ? "roles/" : "roles/#{role}/"
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def self.add(id, login)
|
|
36
|
+
required = required_params(binding.send(:local_variables), binding, ["id"])
|
|
37
|
+
call(:post, "#{path(id)}/users/", :payload => { :required => required })
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def self.remove(id, login)
|
|
41
|
+
call(:delete, "#{path(id)}/users/#{login}/")
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Copyright (c) 2012 Eric D Helms
|
|
2
|
+
#
|
|
3
|
+
# MIT License
|
|
4
|
+
#
|
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
+
# a copy of this software and associated documentation files (the
|
|
7
|
+
# "Software"), to deal in the Software without restriction, including
|
|
8
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
+
# the following conditions:
|
|
12
|
+
#
|
|
13
|
+
# The above copyright notice and this permission notice shall be
|
|
14
|
+
# included in all copies or substantial portions of the Software.
|
|
15
|
+
#
|
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
20
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
23
|
+
|
|
24
|
+
require './lib/runcible/base'
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
module Runcible
|
|
28
|
+
module Pulp
|
|
29
|
+
class Task < Runcible::Base
|
|
30
|
+
|
|
31
|
+
def self.path(id=nil)
|
|
32
|
+
(id == nil) ? "tasks/" : "tasks/#{id}/"
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def self.poll(id)
|
|
36
|
+
call(:get, path(id))
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def self.cancel(id)
|
|
40
|
+
call(:delete, path(id))
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def self.list(params={})
|
|
44
|
+
call(:get, path, :params => params)
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Copyright (c) 2012 Eric D Helms
|
|
2
|
+
#
|
|
3
|
+
# MIT License
|
|
4
|
+
#
|
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
+
# a copy of this software and associated documentation files (the
|
|
7
|
+
# "Software"), to deal in the Software without restriction, including
|
|
8
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
+
# the following conditions:
|
|
12
|
+
#
|
|
13
|
+
# The above copyright notice and this permission notice shall be
|
|
14
|
+
# included in all copies or substantial portions of the Software.
|
|
15
|
+
#
|
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
20
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
23
|
+
|
|
24
|
+
require 'lib/runcible/base'
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
module Runcible
|
|
28
|
+
module Pulp
|
|
29
|
+
class User < Runcible::Base
|
|
30
|
+
|
|
31
|
+
def self.path(login=nil)
|
|
32
|
+
(login == nil) ? "users/" : "users/#{login}/"
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def self.create(login, optional={})
|
|
36
|
+
required = required_params(binding.send(:local_variables), binding)
|
|
37
|
+
call(:post, path, :payload => { :required => required, :optional => optional })
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def self.retrieve(id)
|
|
41
|
+
call(:get, path(id))
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def self.delete(id)
|
|
45
|
+
call(:delete, path(id))
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
data/rel-eng/tito.props
ADDED
data/runcible.gemspec
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
|
2
|
+
require File.expand_path('../lib/runcible/version', __FILE__)
|
|
3
|
+
|
|
4
|
+
Gem::Specification.new do |gem|
|
|
5
|
+
gem.authors = ["Eric D Helms"]
|
|
6
|
+
gem.email = ["ehelms@redhat.com"]
|
|
7
|
+
gem.description = "Exposing pulp's juiciest components to the Ruby world."
|
|
8
|
+
gem.summary = ""
|
|
9
|
+
gem.homepage = "https://github.com/Katello/runcible"
|
|
10
|
+
|
|
11
|
+
gem.files = `git ls-files`.split($\)
|
|
12
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
|
13
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
|
14
|
+
gem.name = "runcible"
|
|
15
|
+
gem.require_paths = ["lib"]
|
|
16
|
+
gem.version = Runcible::VERSION
|
|
17
|
+
end
|
data/runcible.spec
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# vim: sw=4:ts=4:et
|
|
2
|
+
#
|
|
3
|
+
# Copyright 2011 Red Hat, Inc.
|
|
4
|
+
#
|
|
5
|
+
# This software is licensed to you under the GNU General Public
|
|
6
|
+
# License as published by the Free Software Foundation; either version
|
|
7
|
+
# 2 of the License (GPLv2) or (at your option) any later version.
|
|
8
|
+
# There is NO WARRANTY for this software, express or implied,
|
|
9
|
+
# including the implied warranties of MERCHANTABILITY,
|
|
10
|
+
# NON-INFRINGEMENT, or FITNESS FOR A PARTICULAR PURPOSE. You should
|
|
11
|
+
# have received a copy of GPLv2 along with this software; if not, see
|
|
12
|
+
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
%global homedir %{_datarootdir}/%{name}
|
|
16
|
+
|
|
17
|
+
Name: runcible
|
|
18
|
+
Summary: A gem to expose Pulp's juiciest parts.
|
|
19
|
+
Group: Applications/System
|
|
20
|
+
License: MIT
|
|
21
|
+
Version: 0.1.0
|
|
22
|
+
Release: 1%{?dist}
|
|
23
|
+
Source0: %{name}-%{version}.tar.gz
|
|
24
|
+
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
|
25
|
+
|
|
26
|
+
BuildArch: noarch
|
|
27
|
+
|
|
28
|
+
%description
|
|
29
|
+
A gem to expose Pulp's juiciest parts.
|
|
30
|
+
|
|
31
|
+
%prep
|
|
32
|
+
%setup -q
|
|
33
|
+
|
|
34
|
+
%build
|
|
35
|
+
|
|
36
|
+
%install
|
|
37
|
+
rm -rf $RPM_BUILD_ROOT
|
|
38
|
+
install -m0755 -d %{buildroot}%{homedir}
|
|
39
|
+
|
|
40
|
+
%clean
|
|
41
|
+
rm -rf $RPM_BUILD_ROOT
|
|
42
|
+
|
|
43
|
+
%files
|
|
44
|
+
%defattr(755, root, root)
|
|
45
|
+
%{homedir}
|
|
46
|
+
%doc README.md LICENSE
|
|
47
|
+
|
|
48
|
+
%changelog
|
data/test/.gitkeep
ADDED
|
File without changes
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# Copyright 2012 Red Hat, Inc.
|
|
2
|
+
#
|
|
3
|
+
# This software is licensed to you under the GNU General Public
|
|
4
|
+
# License as published by the Free Software Foundation; either version
|
|
5
|
+
# 2 of the License (GPLv2) or (at your option) any later version.
|
|
6
|
+
# There is NO WARRANTY for this software, express or implied,
|
|
7
|
+
# including the implied warranties of MERCHANTABILITY,
|
|
8
|
+
# NON-INFRINGEMENT, or FITNESS FOR A PARTICULAR PURPOSE. You should
|
|
9
|
+
# have received a copy of GPLv2 along with this software; if not, see
|
|
10
|
+
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
|
11
|
+
|
|
12
|
+
require 'rubygems'
|
|
13
|
+
require 'minitest/autorun'
|
|
14
|
+
|
|
15
|
+
require './test/integration/resources/helpers/repository_helper'
|
|
16
|
+
require './lib/runcible/extensions/repository'
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
module TestPulpRepositoryExtensionBase
|
|
20
|
+
include RepositoryHelper
|
|
21
|
+
|
|
22
|
+
def setup
|
|
23
|
+
@extension = Runcible::Pulp::RepositoryExtension
|
|
24
|
+
VCR.insert_cassette('extensions/pulp_repository_extensions')
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def teardown
|
|
28
|
+
VCR.eject_cassette
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
class TestPulpRepositoryExtensionCreate < MiniTest::Unit::TestCase
|
|
34
|
+
include TestPulpRepositoryExtensionBase
|
|
35
|
+
|
|
36
|
+
def teardown
|
|
37
|
+
super
|
|
38
|
+
RepositoryHelper.destroy_repo
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def test_create_with_importer
|
|
42
|
+
response = @extension.create_with_importer(RepositoryHelper.repo_id, "yum_importer", {})
|
|
43
|
+
assert response.code == 201
|
|
44
|
+
|
|
45
|
+
response = @extension.retrieve(RepositoryHelper.repo_id, {:details => true})
|
|
46
|
+
assert response['id'] == RepositoryHelper.repo_id
|
|
47
|
+
assert response['importers'].first['importer_type_id'] == 'yum_importer'
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def test_create_with_distributors
|
|
51
|
+
distributors = [{:distributor_type_id => 'yum_distributor', :distributor_config => {"relative_url" => "/", "http" => true, "https" => true}}]
|
|
52
|
+
|
|
53
|
+
response = @extension.create_with_distributors(RepositoryHelper.repo_id, distributors)
|
|
54
|
+
assert response.code == 201
|
|
55
|
+
assert response['id'] == RepositoryHelper.repo_id
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def test_create_with_importer_and_distributors
|
|
59
|
+
distributors = [{:distributor_type_id => 'yum_distributor', :distributor_config => {"relative_url" => "/", "http" => true, "https" => true}}]
|
|
60
|
+
|
|
61
|
+
response = @extension.create_with_importer_and_distributors(RepositoryHelper.repo_id, "yum_importer", {}, distributors)
|
|
62
|
+
assert response.code == 201
|
|
63
|
+
|
|
64
|
+
response = @extension.retrieve(RepositoryHelper.repo_id, {:details => true})
|
|
65
|
+
assert response['id'] == RepositoryHelper.repo_id
|
|
66
|
+
assert response['importers']['importer_type_id'] == 'yum_importer'
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
class TestPulpRepositoryExtensionSearch < MiniTest::Unit::TestCase
|
|
72
|
+
include TestPulpRepositoryExtensionBase
|
|
73
|
+
|
|
74
|
+
def self.before_suite
|
|
75
|
+
RepositoryHelper.create_repo
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
def self.after_suite
|
|
79
|
+
RepositoryHelper.destroy_repo
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
def test_search_by_repository_ids
|
|
83
|
+
response = @extension.search_by_repository_ids([RepositoryHelper.repo_id])
|
|
84
|
+
assert response.code == 200
|
|
85
|
+
assert response.collect{ |repo| repo["display_name"] == RepositoryHelper.repo_id }.length > 0
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
class TestPulpRepositoryExtensionUnitCopy < MiniTest::Unit::TestCase
|
|
92
|
+
include TestPulpRepositoryExtensionBase
|
|
93
|
+
|
|
94
|
+
def setup
|
|
95
|
+
super
|
|
96
|
+
@clone_name = RepositoryHelper.repo_id + "_clone"
|
|
97
|
+
RepositoryHelper.destroy_repo(@clone_name)
|
|
98
|
+
RepositoryHelper.destroy_repo
|
|
99
|
+
RepositoryHelper.create_and_sync_repo(:importer => true)
|
|
100
|
+
@extension.create_with_importer(@clone_name, "yum_importer", {})
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
def teardown
|
|
104
|
+
RepositoryHelper.destroy_repo(@clone_name)
|
|
105
|
+
RepositoryHelper.destroy_repo
|
|
106
|
+
super
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
def test_package_copy
|
|
110
|
+
response = @extension.rpm_copy(@clone_name, RepositoryHelper.repo_id)
|
|
111
|
+
RepositoryHelper.task = response
|
|
112
|
+
assert response.code == 202
|
|
113
|
+
assert response['tags'].include?('pulp:action:associate')
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
end
|
|
117
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
[general]
|
|
2
|
+
family = Test Family
|
|
3
|
+
timestamp = 1323112153.09
|
|
4
|
+
variant = TestVariant
|
|
5
|
+
version = 16
|
|
6
|
+
packagedir =
|
|
7
|
+
arch = x86_64
|
|
8
|
+
|
|
9
|
+
[checksums]
|
|
10
|
+
empty.iso = sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
|
|
11
|
+
images/test1.img = sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
|
|
12
|
+
images/test2.img = sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
empty.iso,e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855,None
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
pulp-admin auth login --username admin --password admin
|
|
4
|
+
pulp-admin repo create --id zoo2
|
|
5
|
+
pulp-admin content upload -r zoo2 --nosig -v *rpm
|
|
6
|
+
touch empty.iso
|
|
7
|
+
pulp-admin content upload -r zoo2 --nosig -v empty.iso
|
|
8
|
+
pulp-admin packagegroup create --id=mammal -r zoo2 -n mammal
|
|
9
|
+
pulp-admin packagegroup add_package --id=mammal -r zoo2 -n elephant,giraffe,cheetah,lion,monkey,penguin,squirrel,walrus -t mandatory
|
|
10
|
+
pulp-admin packagegroup create --id=bird -r zoo2 -n bird
|
|
11
|
+
pulp-admin packagegroup add_package --id=bird -r zoo2 -n penguin -t mandatory
|
|
12
|
+
pulp-admin packagegroup create_category --categoryid=all -r zoo2 -n all
|
|
13
|
+
pulp-admin packagegroup add_group --id=mammal --categoryid=all -r zoo2
|
|
14
|
+
pulp-admin packagegroup add_group --id=bird --categoryid=all -r zoo2
|
|
15
|
+
pulp-admin errata create --id RHEA-2010:0001 --title "Empty errata" --version 1 --release 1 --type security --issued "2010-01-01 01:01:01" --status stable --fromstr "lzap+pub@redhat.com"
|
|
16
|
+
echo "elephant,0.3,0.8,0,noarch,elephant-0.3-0.8.noarch.rpm,b029ffa74171d1f60d58ad25a4822db2,md5,http://www.fedoraproject.org" > /tmp/erratum.csv
|
|
17
|
+
pulp-admin errata create --id RHEA-2010:0002 --title "One package errata" --version 1 --release 1 --type security --issued "2010-01-01 01:01:01" --status stable --fromstr "lzap+pub@redhat.com" --effected-packages /tmp/erratum.csv
|
|
18
|
+
pulp-admin repo add_errata --id zoo2 -e RHEA-2010:0001 -y
|
|
19
|
+
pulp-admin repo add_errata --id zoo2 -e RHEA-2010:0002 -y
|
|
20
|
+
pulp-admin repo generate_metadata --id zoo2
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
Binary file
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE comps PUBLIC "-//Red Hat, Inc.//DTD Comps info//EN" "comps.dtd">
|
|
3
|
+
<comps>
|
|
4
|
+
|
|
5
|
+
<group>
|
|
6
|
+
<id>bird</id>
|
|
7
|
+
<default>true</default>
|
|
8
|
+
<uservisible>true</uservisible>
|
|
9
|
+
<display_order>1024</display_order>
|
|
10
|
+
<name>bird</name>
|
|
11
|
+
<description></description>
|
|
12
|
+
<packagelist>
|
|
13
|
+
<packagereq type="mandatory">penguin</packagereq>
|
|
14
|
+
</packagelist>
|
|
15
|
+
</group>
|
|
16
|
+
<group>
|
|
17
|
+
<id>mammal</id>
|
|
18
|
+
<default>true</default>
|
|
19
|
+
<uservisible>true</uservisible>
|
|
20
|
+
<display_order>1024</display_order>
|
|
21
|
+
<name>mammal</name>
|
|
22
|
+
<description></description>
|
|
23
|
+
<packagelist>
|
|
24
|
+
<packagereq type="mandatory">elephant,giraffe,cheetah,lion,monkey,penguin,squirrel,walrus</packagereq>
|
|
25
|
+
<packagereq type="mandatory">penguin</packagereq>
|
|
26
|
+
</packagelist>
|
|
27
|
+
</group>
|
|
28
|
+
<category>
|
|
29
|
+
<id>all</id>
|
|
30
|
+
<display_order>99</display_order>
|
|
31
|
+
<name>all</name>
|
|
32
|
+
<description></description>
|
|
33
|
+
<grouplist>
|
|
34
|
+
<groupid>mammal</groupid>
|
|
35
|
+
<groupid>bird</groupid>
|
|
36
|
+
</grouplist>
|
|
37
|
+
</category>
|
|
38
|
+
|
|
39
|
+
</comps>
|