Have examples run in the py27 environment and make them work
It is great to ensure that the examples that tooz has actually run during testing time, so enable this as well as adjust the examples to create unique group ids and run for a limited amount of time instead of running forever (and fix a few other brokeness)... Change-Id: I573cf5946a1d3f13862c0c28cf3a5d7fc6178873changes/71/122571/5
parent
0df6d848ea
commit
fd730c42a3
@ -1,5 +1,5 @@
|
||||
from tooz import coordination
|
||||
|
||||
coordinator = coordination.get_coordinator('zookeeper://localhost', b'host-1')
|
||||
coordinator = coordination.get_coordinator('kazoo://localhost', b'host-1')
|
||||
coordinator.start()
|
||||
coordinator.stop()
|
||||
|
@ -1,14 +1,19 @@
|
||||
import uuid
|
||||
|
||||
import six
|
||||
|
||||
from tooz import coordination
|
||||
|
||||
coordinator = coordination.get_coordinator('zookeeper://localhost', b'host-1')
|
||||
coordinator = coordination.get_coordinator('kazoo://localhost', b'host-1')
|
||||
coordinator.start()
|
||||
|
||||
# Create a group
|
||||
request = coordinator.create_group(b"my group")
|
||||
group = six.binary_type(six.text_type(uuid.uuid4()).encode('ascii'))
|
||||
request = coordinator.create_group(group)
|
||||
request.get()
|
||||
|
||||
# Join a group
|
||||
request = coordinator.join_group(b"my group")
|
||||
request = coordinator.join_group(group)
|
||||
request.get()
|
||||
|
||||
coordinator.stop()
|
||||
|
@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
python_version=$(python --version 2>&1)
|
||||
echo "Running using '$python_version'"
|
||||
for filename in examples/*.py; do
|
||||
echo "Activating '$filename'"
|
||||
python $filename
|
||||
done
|
Loading…
Reference in New Issue