Skip to content

Commit

Permalink
rename addzone -> acra_addzone
Browse files Browse the repository at this point in the history
  • Loading branch information
Lagovas committed Nov 23, 2016
1 parent 31a843a commit b3968f8
Showing 6 changed files with 10 additions and 10 deletions.
File renamed without changes.
4 changes: 2 additions & 2 deletions cmd/poisonrecord/Description.md
Original file line number Diff line number Diff line change
@@ -3,8 +3,8 @@
The same like for correct acra structs:
* add zone like
```
[acra]$ go build addzone
[acra]$ ./addzone
[acra]$ go build acra_addzone
[acra]$ ./acra_addzone
{"id":"ZXChVYmCtQgasDlqtrz","public_key":"VUVDMgAAAC3e8NhhAjK+wyOntdyqlPg3c89Vu5z3JskxuxgAQVynNOLnel4c"}
```
* save decoded from base64 public key in file (for example ZXChVYmCtQgasDlqtrz.pub). For example:
2 changes: 1 addition & 1 deletion examples/ruby/Readme.md
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@ XUFCEDTO | XUFCEDTO
* запустите acra и укажите ip postgresql ((в моем случае запускаю акру, ssproxy и postgresql локально на одной машине) `go run src/acra/main/main.go -db_host=127.0.0.1 -z`
* запустите ssproxy указав ip акры и client_id `go run src/ssproxy/ssproxy.go -client_id=client -acra_host=127.0.0.1`
* в examples/ruby/example_with_zone.rb задайте свои параметры в `PG.connect(...)`
* добавьте зону `go run src/addzone/addzone.go`. Получите json строку с
* добавьте зону `go run src/acra_addzone/acra_addzone.go`. Получите json строку с
данными зоны. Подставьте в examples/ruby/example_with_zone.rb в строке `zone_data = JSON.parse('{...}')`

Запуск:
2 changes: 1 addition & 1 deletion examples/ruby/example_with_zone.rb
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
require 'pg'
require 'acra'

# output from ./addzone. you should assign your values
# output from ./acra_addzone. you should assign your values
zone_data = JSON.parse('{"id":"ZXCfelcOOnfYWkVphBn","public_key":"VUVDMgAAAC1YtTViA+VtaV0qh/OB7Rr3h0U04iQ0pTfPTh9gur62nerv4fsx"}')

conn = PG.connect( dbname: 'acra', host: '127.0.0.1', port: '9494', user: 'postgres', password: 'postgres' )
10 changes: 5 additions & 5 deletions tests/test.py
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@ def setUpModule():
global zones
# build binaries
assert subprocess.call(['go', 'build', 'github.com/cossacklabs/acra/cmd/acraproxy'], cwd=os.getcwd()) == 0
assert subprocess.call(['go', 'build', 'github.com/cossacklabs/acra/cmd/addzone'], cwd=os.getcwd()) == 0
assert subprocess.call(['go', 'build', 'github.com/cossacklabs/acra/cmd/acra_addzone'], cwd=os.getcwd()) == 0
assert subprocess.call(
['go', 'build', 'github.com/cossacklabs/acra/cmd/acra_genkeys'], cwd=os.getcwd()) == 0
assert subprocess.call(['go', 'build', 'github.com/cossacklabs/acra/cmd/acraserver'], cwd=os.getcwd()) == 0
@@ -50,9 +50,9 @@ def setUpModule():
assert create_client_keypair('keypair2', server_pair=True) == 0
# add two zones
zones.append(json.loads(subprocess.check_output(
['./addzone'], cwd=os.getcwd()).decode('utf-8')))
['./acra_addzone'], cwd=os.getcwd()).decode('utf-8')))
zones.append(json.loads(subprocess.check_output(
['./addzone'], cwd=os.getcwd()).decode('utf-8')))
['./acra_addzone'], cwd=os.getcwd()).decode('utf-8')))


def tearDownModule():
@@ -68,15 +68,15 @@ def tearDownModule():
files.append('.acrakeys/{}_zone'.format(zone['id']))
files.append('.acrakeys/{}_zone.pub'.format(zone['id']))

for i in ['acraproxy', 'acraserver', 'addzone', 'acra_genkeys'] + files:
for i in ['acraproxy', 'acraserver', 'acra_addzone', 'acra_genkeys'] + files:
os.remove(i)


class TestCompilation(unittest.TestCase):
def testCompileAll(self):
self.assertFalse(subprocess.call(['go', 'build', 'github.com/cossacklabs/acra/cmd/acraproxy'], cwd=os.getcwd()))
self.assertFalse(subprocess.call(['go', 'build', 'github.com/cossacklabs/acra/cmd/acraserver'], cwd=os.getcwd()))
self.assertFalse(subprocess.call(['go', 'build', 'github.com/cossacklabs/acra/cmd/addzone'], cwd=os.getcwd()))
self.assertFalse(subprocess.call(['go', 'build', 'github.com/cossacklabs/acra/cmd/acra_addzone'], cwd=os.getcwd()))
self.assertFalse(subprocess.call(['go', 'build', 'github.com/cossacklabs/acra/cmd/acra_genkeys'], cwd=os.getcwd()))
self.assertFalse(subprocess.call(['go', 'build', 'github.com/cossacklabs/acra/cmd/poisonrecord'], cwd=os.getcwd()))

2 changes: 1 addition & 1 deletion wrappers/python/scripts/save_with_zone.py
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@


def add_zone():
output = subprocess.check_output(["../../addzone"])
output = subprocess.check_output(["../../acra_addzone"])
parsed = json.loads(output.decode('utf-8'))
return parsed['id'], b64decode(parsed['public_key'])

0 comments on commit b3968f8

Please sign in to comment.