ruby-libvirt 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/NEWS +3 -0
- data/Rakefile +2 -2
- data/ext/libvirt/connect.c +2 -2
- data/ext/libvirt/domain.c +1 -1
- data/ext/libvirt/nodedevice.c +1 -1
- data/ext/libvirt/storage.c +1 -1
- data/tests/test_nodedevice.rb +1 -1
- data/tests/test_open.rb +18 -18
- data/tests/test_stream.rb +1 -1
- data/tests/test_utils.rb +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fbcf087680f4524b1c5e1faba3dfad5bbc22f281
|
4
|
+
data.tar.gz: 298b6f117bd8b15acc809c70954b38341d7ace4c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d8508cf6a4033efb7d0fb19451f19ed8efc79ebfd4ecfd6e601f7c1504d1007ce729da33245aab5d6563ae85e42cb98656f5b83091c049392af12f4d80eee4f
|
7
|
+
data.tar.gz: 0151aa217bfa464c7f08755b8d586e262b89ce196ac26c0024b0c8741cc1043a93c8ed70eb2ec082fd21dea3bdea5899cf5766c4ae86dbb478841bbe8c18c58a
|
data/NEWS
CHANGED
data/Rakefile
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
# Rakefile: build ruby libvirt bindings
|
3
3
|
#
|
4
4
|
# Copyright (C) 2007,2010 Red Hat, Inc.
|
5
|
-
# Copyright (C) 2013 Chris Lalancette <clalancette@gmail.com>
|
5
|
+
# Copyright (C) 2013,2014 Chris Lalancette <clalancette@gmail.com>
|
6
6
|
#
|
7
7
|
# Distributed under the GNU Lesser General Public License v2.1 or later.
|
8
8
|
# See COPYING for details
|
@@ -21,7 +21,7 @@ require 'rubygems/package_task'
|
|
21
21
|
require 'rbconfig'
|
22
22
|
|
23
23
|
PKG_NAME='ruby-libvirt'
|
24
|
-
PKG_VERSION='0.5.
|
24
|
+
PKG_VERSION='0.5.2'
|
25
25
|
|
26
26
|
EXT_CONF='ext/libvirt/extconf.rb'
|
27
27
|
MAKEFILE="ext/libvirt/Makefile"
|
data/ext/libvirt/connect.c
CHANGED
@@ -67,7 +67,7 @@
|
|
67
67
|
names = alloca(sizeof(char *) * num); \
|
68
68
|
r = virConnectList##objs(ruby_libvirt_connect_get(c), names, num); \
|
69
69
|
ruby_libvirt_raise_error_if(r < 0, e_RetrieveError, "virConnectList" # objs, ruby_libvirt_connect_get(c)); \
|
70
|
-
return ruby_libvirt_generate_list(
|
70
|
+
return ruby_libvirt_generate_list(r, names); \
|
71
71
|
} while(0)
|
72
72
|
|
73
73
|
static VALUE c_connect;
|
@@ -1508,7 +1508,7 @@ static VALUE libvirt_connect_list_nodedevices(int argc, VALUE *argv, VALUE c)
|
|
1508
1508
|
ruby_libvirt_raise_error_if(r < 0, e_RetrieveError, "virNodeListDevices",
|
1509
1509
|
ruby_libvirt_connect_get(c));
|
1510
1510
|
|
1511
|
-
return ruby_libvirt_generate_list(
|
1511
|
+
return ruby_libvirt_generate_list(r, names);
|
1512
1512
|
}
|
1513
1513
|
|
1514
1514
|
/*
|
data/ext/libvirt/domain.c
CHANGED
@@ -1532,7 +1532,7 @@ static VALUE libvirt_domain_list_snapshots(int argc, VALUE *argv, VALUE d)
|
|
1532
1532
|
"virDomainSnapshotListNames",
|
1533
1533
|
ruby_libvirt_connect_get(d));
|
1534
1534
|
|
1535
|
-
return ruby_libvirt_generate_list(
|
1535
|
+
return ruby_libvirt_generate_list(r, names);
|
1536
1536
|
}
|
1537
1537
|
|
1538
1538
|
/*
|
data/ext/libvirt/nodedevice.c
CHANGED
data/ext/libvirt/storage.c
CHANGED
data/tests/test_nodedevice.rb
CHANGED
data/tests/test_open.rb
CHANGED
@@ -21,49 +21,49 @@ expect_success(Libvirt, "nil arg", "version", nil) {|x| x.class == Array and x.l
|
|
21
21
|
expect_success(Libvirt, "Test arg", "version", "Test") {|x| x.class == Array and x.length == 2}
|
22
22
|
|
23
23
|
# TESTGROUP: Libvirt::open
|
24
|
-
expect_too_many_args(Libvirt, "open",
|
24
|
+
expect_too_many_args(Libvirt, "open", URI, 1)
|
25
25
|
expect_connect_error("open", "foo:///system")
|
26
26
|
conn = expect_success(Libvirt, "no args", "open") {|x| x.class == Libvirt::Connect }
|
27
27
|
conn.close
|
28
|
-
conn = expect_success(Libvirt,
|
28
|
+
conn = expect_success(Libvirt, URI, "open", URI) {|x| x.class == Libvirt::Connect }
|
29
29
|
conn.close
|
30
30
|
conn = expect_success(Libvirt, "nil arg", "open", nil) {|x| x.class == Libvirt::Connect }
|
31
31
|
conn.close
|
32
32
|
|
33
33
|
# TESTGROUP: Libvirt::open_read_only
|
34
|
-
expect_too_many_args(Libvirt, "open_read_only",
|
34
|
+
expect_too_many_args(Libvirt, "open_read_only", URI, 1)
|
35
35
|
expect_connect_error("open_read_only", "foo:///system")
|
36
36
|
conn = expect_success(Libvirt, "no args", "open_read_only") {|x| x.class == Libvirt::Connect }
|
37
37
|
conn.close
|
38
|
-
conn = expect_success(Libvirt,
|
38
|
+
conn = expect_success(Libvirt, URI, "open_read_only", URI) {|x| x.class == Libvirt::Connect }
|
39
39
|
conn.close
|
40
40
|
conn = expect_success(Libvirt, "nil arg", "open_read_only", nil) {|x| x.class == Libvirt::Connect }
|
41
41
|
conn.close
|
42
42
|
|
43
43
|
# TESTGROUP: Libvirt::open_auth
|
44
|
-
expect_too_many_args(Libvirt, "open_auth",
|
44
|
+
expect_too_many_args(Libvirt, "open_auth", URI, [], "hello there", 1, 2)
|
45
45
|
expect_connect_error("open_auth", "foo:///system")
|
46
46
|
expect_invalid_arg_type(Libvirt, "open_auth", 1)
|
47
|
-
expect_invalid_arg_type(Libvirt, "open_auth",
|
47
|
+
expect_invalid_arg_type(Libvirt, "open_auth", URI, [], "hello", "foo")
|
48
48
|
|
49
49
|
conn = expect_success(Libvirt, "no args", "open_auth") {|x| x.class == Libvirt::Connect }
|
50
50
|
conn.close
|
51
51
|
|
52
|
-
conn = expect_success(Libvirt, "uri arg", "open_auth",
|
52
|
+
conn = expect_success(Libvirt, "uri arg", "open_auth", URI) {|x| x.class == Libvirt::Connect }
|
53
53
|
conn.close
|
54
54
|
|
55
|
-
conn = expect_success(Libvirt, "uri and empty cred args", "open_auth",
|
55
|
+
conn = expect_success(Libvirt, "uri and empty cred args", "open_auth", URI, []) {|x| x.class == Libvirt::Connect }
|
56
56
|
conn.close
|
57
57
|
|
58
|
-
conn = expect_success(Libvirt, "uri and full cred args", "open_auth",
|
58
|
+
conn = expect_success(Libvirt, "uri and full cred args", "open_auth", URI, [Libvirt::CRED_AUTHNAME, Libvirt::CRED_PASSPHRASE]) {|x| x.class == Libvirt::Connect }
|
59
59
|
conn.close
|
60
60
|
|
61
|
-
conn = expect_success(Libvirt, "uri, full cred, and user args", "open_auth",
|
61
|
+
conn = expect_success(Libvirt, "uri, full cred, and user args", "open_auth", URI, [Libvirt::CRED_AUTHNAME, Libvirt::CRED_PASSPHRASE], "hello") {|x| x.class == Libvirt::Connect }
|
62
62
|
conn.close
|
63
63
|
|
64
64
|
# equivalent to expect_invalid_arg_type
|
65
65
|
begin
|
66
|
-
conn = Libvirt::open_auth(
|
66
|
+
conn = Libvirt::open_auth(URI, {}) do |cred|
|
67
67
|
end
|
68
68
|
rescue TypeError => e
|
69
69
|
puts_ok "#{$test_object}.open_auth invalid arg type threw #{TypeError.to_s}"
|
@@ -73,7 +73,7 @@ end
|
|
73
73
|
|
74
74
|
# equivalent to expect_invalid_arg_type
|
75
75
|
begin
|
76
|
-
conn = Libvirt::open_auth(
|
76
|
+
conn = Libvirt::open_auth(URI, 1) do |cred|
|
77
77
|
end
|
78
78
|
rescue TypeError => e
|
79
79
|
puts_ok "#{$test_object}.open_auth invalid arg type threw #{TypeError.to_s}"
|
@@ -83,7 +83,7 @@ end
|
|
83
83
|
|
84
84
|
# equivalent to expect_invalid_arg_type
|
85
85
|
begin
|
86
|
-
conn = Libvirt::open_auth(
|
86
|
+
conn = Libvirt::open_auth(URI, 'foo') do |cred|
|
87
87
|
end
|
88
88
|
rescue TypeError => e
|
89
89
|
puts_ok "#{$test_object}.open_auth invalid arg type threw #{TypeError.to_s}"
|
@@ -93,7 +93,7 @@ end
|
|
93
93
|
|
94
94
|
# equivalent to "expect_success"
|
95
95
|
begin
|
96
|
-
conn = Libvirt::open_auth(
|
96
|
+
conn = Libvirt::open_auth(URI, [Libvirt::CRED_AUTHNAME, Libvirt::CRED_PASSPHRASE], "hello") do |cred|
|
97
97
|
if not cred["userdata"].nil?
|
98
98
|
puts "userdata is #{cred["userdata"]}"
|
99
99
|
end
|
@@ -122,7 +122,7 @@ end
|
|
122
122
|
|
123
123
|
# equivalent to "expect_success"
|
124
124
|
begin
|
125
|
-
conn = Libvirt::open_auth(
|
125
|
+
conn = Libvirt::open_auth(URI) do |cred|
|
126
126
|
end
|
127
127
|
|
128
128
|
puts_ok "Libvirt.open_auth uri, succeeded"
|
@@ -135,7 +135,7 @@ end
|
|
135
135
|
|
136
136
|
# equivalent to "expect_success"
|
137
137
|
begin
|
138
|
-
conn = Libvirt::open_auth(
|
138
|
+
conn = Libvirt::open_auth(URI, [Libvirt::CRED_AUTHNAME, Libvirt::CRED_PASSPHRASE], "hello", Libvirt::CONNECT_RO) do |cred|
|
139
139
|
if not cred["userdata"].nil?
|
140
140
|
puts "userdata is #{cred["userdata"]}"
|
141
141
|
end
|
@@ -163,7 +163,7 @@ rescue => e
|
|
163
163
|
end
|
164
164
|
|
165
165
|
# TESTGROUP: Libvirt::event_invoke_handle_callback
|
166
|
-
conn = Libvirt::open(
|
166
|
+
conn = Libvirt::open(URI)
|
167
167
|
|
168
168
|
expect_too_many_args(Libvirt, "event_invoke_handle_callback", 1, 2, 3, 4, 5)
|
169
169
|
expect_too_few_args(Libvirt, "event_invoke_handle_callback")
|
@@ -188,7 +188,7 @@ expect_invalid_arg_type(Libvirt, "event_invoke_handle_callback", 1, 1, 1, { "lib
|
|
188
188
|
conn.close
|
189
189
|
|
190
190
|
# TESTGROUP: Libvirt::event_invoke_timeout_callback
|
191
|
-
conn = Libvirt::open(
|
191
|
+
conn = Libvirt::open(URI)
|
192
192
|
|
193
193
|
expect_too_many_args(Libvirt, "event_invoke_timeout_callback", 1, 2, 3)
|
194
194
|
expect_too_few_args(Libvirt, "event_invoke_timeout_callback")
|
data/tests/test_stream.rb
CHANGED
data/tests/test_utils.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-libvirt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Lutterkort, Chris Lalancette
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Ruby bindings for libvirt.
|
14
14
|
email: libvir-list@redhat.com
|