linux-lxc 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +24 -0
- data/Gemfile +5 -1
- data/README.md +3 -1
- data/Rakefile +9 -0
- data/lib/linux/lxc/file.rb +1 -1
- data/lib/linux/lxc/version.rb +1 -1
- data/test/linux_lxc_test.rb +15 -4
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c1bb44b20b86ef39fa6a0c43452557de0ac1e54
|
4
|
+
data.tar.gz: 1b554ce075df89016060fb720089a6a3d7e2c648
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 634ad4c1457159634b02066122bcca935bcefad487cfbb6a0b7999482d7d23e994bf150f11c606960b0264e011582051f5057c3c713c79bc1bb29ccbb74843bc
|
7
|
+
data.tar.gz: de3b3ba0dbce9331930e69a02ebf7b4e1b5558852c3c6880661ed710b0392f45f11517fa37b6938381f7b0fb66209239cac7c2ba00beb89f628f5499088da5a4
|
data/.travis.yml
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
language: ruby
|
2
|
+
|
3
|
+
rvm:
|
4
|
+
- 1.9
|
5
|
+
- 2.0
|
6
|
+
- 2.1
|
7
|
+
- 2.2
|
8
|
+
- jruby
|
9
|
+
- rbx-2
|
10
|
+
|
11
|
+
#before_install:
|
12
|
+
# - sudo apt-get -qq update
|
13
|
+
# - sudo apt-get install -y ruby
|
14
|
+
#install:
|
15
|
+
# - rvm use ruby-2.0.0-p598
|
16
|
+
# - gem install construqt-ipaddress
|
17
|
+
|
18
|
+
#script:
|
19
|
+
# - rvm use ruby-2.0.0-p598
|
20
|
+
# - (cd ruby && ruby test/linux_ip_addr_test.rb)
|
21
|
+
# - (cd ruby && ruby test/linux_ip_route_test.rb)
|
22
|
+
# - (cd rust && cargo build --verbose)
|
23
|
+
# - (cd rust && cargo test --verbose)
|
24
|
+
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Linux::Lxc
|
2
2
|
|
3
|
+
[![Build Status](https://travis-ci.org/mabels/linux-lxc.svg?branch=master)](https://travis-ci.org/mabels/linux-lxc)
|
4
|
+
|
3
5
|
This gem is able to parse a lxc-config file and than
|
4
6
|
allow to modify the content of a lxc-config and write
|
5
7
|
the in-memory represation back to disc.
|
@@ -22,7 +24,7 @@ Or install it yourself as:
|
|
22
24
|
|
23
25
|
## Usage
|
24
26
|
|
25
|
-
|
27
|
+
look in the tests
|
26
28
|
|
27
29
|
## Contributing
|
28
30
|
|
data/Rakefile
CHANGED
data/lib/linux/lxc/file.rb
CHANGED
@@ -100,7 +100,7 @@ module Linux
|
|
100
100
|
elsif line.match(/^\s*#.*$/)
|
101
101
|
self.add('#', line)
|
102
102
|
else
|
103
|
-
match = line.match(/^\s*([a-
|
103
|
+
match = line.match(/^\s*([a-z0-9\-_\.]+)\s*=\s*(.*)\s*$/)
|
104
104
|
throw "illegal line in #{@file}:#{@lines.length}" unless match
|
105
105
|
if match[1] == 'lxc.include'
|
106
106
|
self.add(match[1], Lxc.parse(match[2], index))
|
data/lib/linux/lxc/version.rb
CHANGED
data/test/linux_lxc_test.rb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
require 'rubygems'
|
3
3
|
|
4
4
|
begin
|
5
|
-
require '
|
6
|
-
rescue
|
5
|
+
require 'pryx'
|
6
|
+
rescue Exception => e
|
7
7
|
# it would be cool but-:)
|
8
8
|
end
|
9
9
|
|
@@ -115,6 +115,17 @@ lxc.cgroup.devices.allow = c 10:232 rwm
|
|
115
115
|
## configuration file (uncommented).
|
116
116
|
#lxc.cgroup.devices.allow = b 7:* rwm
|
117
117
|
|
118
|
+
lxc.net.0.type = veth
|
119
|
+
lxc.net.0.flags = up
|
120
|
+
lxc.net.0.link = br-int
|
121
|
+
lxc.net.0.hwaddr = 00:16:4e:80:72:ab
|
122
|
+
lxc.net.0.name = br-int
|
123
|
+
|
124
|
+
lxc.net.1.type = phys
|
125
|
+
lxc.net.1.flags = up
|
126
|
+
lxc.net.1.link = eth1
|
127
|
+
lxc.net.1.name = lte
|
128
|
+
|
118
129
|
# Blacklist some syscalls which are not safe in privileged
|
119
130
|
# containers
|
120
131
|
lxc.seccomp = /usr/share/lxc/config/common.seccomp
|
@@ -139,7 +150,7 @@ SAMPLE
|
|
139
150
|
def test_reader
|
140
151
|
lxc = Linux::Lxc.parse(@lxc_config)
|
141
152
|
|
142
|
-
assert_equal lxc.get('lxc').length,
|
153
|
+
assert_equal lxc.get('lxc').length, 52
|
143
154
|
assert_equal lxc.get('lxc.network').length, 4
|
144
155
|
assert_equal lxc.get('lxc.network.hwaddr').length, 1
|
145
156
|
assert_equal lxc.get('lxc.network.murks'), nil
|
@@ -259,7 +270,7 @@ SAMPLE
|
|
259
270
|
lxc = Linux::Lxc.parse(@lxc_config)
|
260
271
|
cnt = 0
|
261
272
|
lxc.all_lines { |_line| cnt += 1 }
|
262
|
-
assert_equal cnt,
|
273
|
+
assert_equal cnt, 109
|
263
274
|
end
|
264
275
|
|
265
276
|
def test_files
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: linux-lxc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Meno Abels
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Parse the output of ip addr on a linux system
|
14
14
|
email:
|
@@ -18,6 +18,7 @@ extensions: []
|
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
20
|
- ".gitignore"
|
21
|
+
- ".travis.yml"
|
21
22
|
- Gemfile
|
22
23
|
- LICENSE.txt
|
23
24
|
- README.md
|
@@ -51,10 +52,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
51
52
|
version: '0'
|
52
53
|
requirements: []
|
53
54
|
rubyforge_project:
|
54
|
-
rubygems_version: 2.
|
55
|
+
rubygems_version: 2.5.2
|
55
56
|
signing_key:
|
56
57
|
specification_version: 4
|
57
58
|
summary: Parse the output of ip addr on a linux system
|
58
59
|
test_files:
|
59
60
|
- test/linux_lxc_test.rb
|
60
|
-
has_rdoc:
|