leofs_manager_client 0.4.3 → 0.4.4

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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MWYzOTBiYzNjZWQzMDc2M2EyZThiZjkyMTNmMGZiNTQ3ZWJiMWU0MA==
4
+ NWY2MzYyZmEzNWExNDI5ZmMxNDE2YjcyODAyZTY0MDIwYWIzOWY1ZQ==
5
5
  data.tar.gz: !binary |-
6
- ZDA2MTQwOGU0MzVjY2UwMGNiNTRlNzhlNGYyNmNkM2M4NGQ1MmIyYw==
6
+ MjljZGJiOWNhMGVkODRjMjJjYWU0ZjE0ZDIzMmY4MDk4ZThkMmYxMg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NDIwNmU1NDM5ZjI4ZDk2MWJiYzFhMzY3YTE4OWI2YTI1ODliNzY0NzA4YTA5
10
- OWJlYTQ2ZjNiODdkN2U5NDgwZjVlZmU0NzAxZWQ0YzRiYWJjN2FjN2U5OTgz
11
- NWI0ZWU2ODJjNDFiNGZlMGQ2NTI5ZmU4MDFiMDU2OGUyMTQ2YmE=
9
+ ODk1MjY1MWJhYjA5NDlmY2QzYTJkZjNmZDJiYTMzNDdhN2FkZGRmMzcwYTJl
10
+ ODA4MzI2ZjhjNGY0NWRhOTIxOTQxNTIyNzJhNTdlNWVjYTYxNDE5MDQ3ZmNi
11
+ MWE3YzliMDMwMzI0ZGRlNzljZDE0MjM4MTZhMmE3NmYyOTdhODk=
12
12
  data.tar.gz: !binary |-
13
- ZWIwNDZkZjI1ZGVhYWFkMGU1NWU4NzA1MDVlNDMxZTY4YmZhMDJmYjBiNzg2
14
- YTcyNTYxNTFiMzFjMDM1ODYxYzgyZTNjYmQxMzdjNGExMDY4NGExMDYxMmE4
15
- ZTdkM2JhOWQ2N2MwZThhNDUwNTU4MzVkYzMxZmYzMjZjZjEyMmE=
13
+ YjI3YTJkYzg2NTAwZTMwYjAyMmVjOTM4NTFmYmI4ODRkYmMwODEyYjQwZThl
14
+ NDA2MjllNDM3ODQ1ZGVlNDBkOTE0ZTQ0ODZjMWQwZjk0ZDEyZTc2MmM2Zjdl
15
+ N2NlNjk3ZmQxMTkyYjJmMTdlNDYwMGFhMzgzZmY3NmUyMTdlM2I=
@@ -26,7 +26,7 @@ require "time"
26
26
  require_relative "leofs_manager_client/leofs_manager_models"
27
27
 
28
28
  module LeoFSManager
29
- VERSION = "0.4.3"
29
+ VERSION = "0.4.4"
30
30
 
31
31
  class Client
32
32
  CMD_VERSION = "version"
@@ -57,8 +57,9 @@ module LeoFSManager
57
57
  @w = Integer(h[:w])
58
58
  @d = Integer(h[:d])
59
59
  @ring_size = Integer(h[:ring_size])
60
- @ring_cur = h[:ring_cur]
61
- @ring_prev = h[:ring_prev]
60
+ #XXX: leo_manager returns ring_hash_(cur|prev) as decimal (not hex)
61
+ @ring_cur = Integer(h[:ring_hash_cur]).to_s(16)
62
+ @ring_prev = Integer(h[:ring_hash_prev]).to_s(16)
62
63
  end
63
64
  end
64
65
 
@@ -71,6 +72,7 @@ module LeoFSManager
71
72
  @node = h[:node]
72
73
  @when = Time.parse(h[:when])
73
74
  @state = h[:state]
75
+ #XXX: these are written in hex
74
76
  @ring_cur = h[:ring_cur]
75
77
  @ring_prev = h[:ring_prev]
76
78
  end
@@ -90,6 +90,34 @@ describe LeoFSManager do
90
90
  end
91
91
  end
92
92
 
93
+ describe Status do
94
+ describe Status::System do
95
+ let(:ring_hash) { "1679896365" }
96
+
97
+ subject do
98
+ Status::System.new({
99
+ :version => "0.14.0",
100
+ :n => "2",
101
+ :r => "1",
102
+ :w => "1",
103
+ :d => "1",
104
+ :ring_size => "128",
105
+ :ring_hash_cur => ring_hash,
106
+ :ring_hash_prev => ring_hash
107
+ })
108
+ end
109
+
110
+ [:n, :r, :w, :d, :ring_size].each do |property|
111
+ its(property) { should be_a Integer }
112
+ end
113
+
114
+ [:ring_cur, :ring_prev].each do |property|
115
+ its(property) { should be_a String }
116
+ its(property) { should == Integer(ring_hash).to_s(16) }
117
+ end
118
+ end
119
+ end
120
+
93
121
  describe Client do
94
122
  before(:all) do
95
123
  Dummy::Manager.new
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leofs_manager_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masaki Matsushita
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-03 00:00:00.000000000 Z
12
+ date: 2013-04-08 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Client for LeoFS Manager
15
15
  email: