Re: invalid acl for ZOO_CREATOR_ALL_ACL

2010-10-18 Thread FANG Yang
2010/10/19 FANG Yang 

> hi, all
> I have a simple zk client written by c ,which is attachment  #1. When i
> use  ZOO_CREATOR_ALL_ACL, the ret code of zoo_create is -114((Invalid ACL
> specified definde in zookeeper.h)), but after i replace it with
> ZOO_OPEN_ACL_UNSAFE, it work. Zookeeper Programmer's Guide mention that
> CREATE_ALL_ACL grants all permissions to the creator of the node. The
> creator must have been authenticated by the server (for example, using
> “digest” scheme) before it can create nodes with this ACL. I call
> zoo_add_auth accroding to func testAuth of TestClient.cc in src/c/tests in
> my source code, but it doesn't work, ret code is still -114 . Would you guys
> do me a favor, plz?
>
> --
> 方阳 FANG Yang
> 开发工程师 Software Engineer
> Douban Inc.
> msn:franklin.f...@hotmail.com
> gtalk:franklin.f...@gmail.com
> skype:franklin.fang
> No.14 Jiuxianqiao Road, Area 51 A1-1-2016, Beijing 100016 , China
> 北京市酒仙桥路14号51楼A1区1门2016,100016
>
  And my zk version is 3.2.2, mode is standalone.


-- 
方阳 FANG Yang
开发工程师 Software Engineer
Douban Inc.
msn:franklin.f...@hotmail.com
gtalk:franklin.f...@gmail.com
skype:franklin.fang
No.14 Jiuxianqiao Road, Area 51 A1-1-2016, Beijing 100016 , China
北京市酒仙桥路14号51楼A1区1门2016,100016


invalid acl for ZOO_CREATOR_ALL_ACL

2010-10-18 Thread FANG Yang
hi, all
I have a simple zk client written by c ,which is attachment  #1. When i
use  ZOO_CREATOR_ALL_ACL, the ret code of zoo_create is -114((Invalid ACL
specified definde in zookeeper.h)), but after i replace it with
ZOO_OPEN_ACL_UNSAFE, it work. Zookeeper Programmer's Guide mention that
CREATE_ALL_ACL grants all permissions to the creator of the node. The
creator must have been authenticated by the server (for example, using
“digest” scheme) before it can create nodes with this ACL. I call
zoo_add_auth accroding to func testAuth of TestClient.cc in src/c/tests in
my source code, but it doesn't work, ret code is still -114 . Would you guys
do me a favor, plz?

-- 
方阳 FANG Yang
开发工程师 Software Engineer
Douban Inc.
msn:franklin.f...@hotmail.com
gtalk:franklin.f...@gmail.com
skype:franklin.fang
No.14 Jiuxianqiao Road, Area 51 A1-1-2016, Beijing 100016 , China
北京市酒仙桥路14号51楼A1区1门2016,100016


RE: Testing zookeeper outside the source distribution?

2010-10-18 Thread Fournier, Camille F. [Tech]
That would be incredibly useful, I keep meaning to just take the code I need 
for integration testing from the zk test source but it would be much nicer as a 
released jar. I created ZOOKEEPER-903 to track this:

https://issues.apache.org/jira/browse/ZOOKEEPER-903

C

-Original Message-
From: Benjamin Reed [mailto:br...@yahoo-inc.com] 
Sent: Monday, October 18, 2010 11:12 AM
To: zookeeper-user@hadoop.apache.org
Subject: Re: Testing zookeeper outside the source distribution?

  we should be exposing those classes and releasing them as a testing 
jar. do you want to open up a jira to track this issue?

ben

On 10/18/2010 05:17 AM, Anthony Urso wrote:
> Anyone have any pointers on how to test against ZK outside of the
> source distribution? All the fun classes (e.g. ClientBase) do not make
> it into the ZK release jar.
>
> Right now I am manually running a ZK node for the unit tests to
> connect to prior to running my test, but I would rather have something
> that ant could reliably
> automate starting and stopping for CI.
>
> Thanks,
> Anthony



Re: Testing zookeeper outside the source distribution?

2010-10-18 Thread Patrick Hunt
You might checkout a tool I built a while back to be used by operations
teams deploying ZooKeeper: http://bit.ly/a6tGVJ

It's really two tools actually, a smoketester and a latency tester, both of
which are important to verify when deploying a new cluster.

Patrick

On Mon, Oct 18, 2010 at 9:50 AM, Ted Dunning  wrote:

> Generally, I think a better way to do this is to use a standard mock object
> framework.  Then you don't have to fake up an interface.
>
> But the original poster probably has a need to do integration tests more
> than unit tests.  In such tests, they need to test against a real ZK to
> make
> sure that their assumptions about the semantics of ZK are valid.
>
> On Mon, Oct 18, 2010 at 8:53 AM, David Rosenstrauch  >wrote:
>
> > Consequently, the way I write my code for ZooKeeper is against a more
> > generic interface that provides operations for open, close, getData, and
> > setData.  When unit testing, I substitute in a "dummy" implementation
> that
> > just stores data in memory (i.e., a HashMap); when running live code I
> use
> > an implementation that talks to ZooKeeper.
> >
>


Re: Testing zookeeper outside the source distribution?

2010-10-18 Thread Patrick Hunt
You might checkout a tool I built a while back to be used by operations
teams deploying ZooKeeper: http://bit.ly/a6tGVJ

It's really two tools actually, a smoketester and a latency tester, both of
which are important to verify when deploying a new cluster.

Patrick

On Mon, Oct 18, 2010 at 9:50 AM, Ted Dunning  wrote:

> Generally, I think a better way to do this is to use a standard mock object
> framework.  Then you don't have to fake up an interface.
>
> But the original poster probably has a need to do integration tests more
> than unit tests.  In such tests, they need to test against a real ZK to
> make
> sure that their assumptions about the semantics of ZK are valid.
>
> On Mon, Oct 18, 2010 at 8:53 AM, David Rosenstrauch  >wrote:
>
> > Consequently, the way I write my code for ZooKeeper is against a more
> > generic interface that provides operations for open, close, getData, and
> > setData.  When unit testing, I substitute in a "dummy" implementation
> that
> > just stores data in memory (i.e., a HashMap); when running live code I
> use
> > an implementation that talks to ZooKeeper.
> >
>


Re: Testing zookeeper outside the source distribution?

2010-10-18 Thread Ted Dunning
Generally, I think a better way to do this is to use a standard mock object
framework.  Then you don't have to fake up an interface.

But the original poster probably has a need to do integration tests more
than unit tests.  In such tests, they need to test against a real ZK to make
sure that their assumptions about the semantics of ZK are valid.

On Mon, Oct 18, 2010 at 8:53 AM, David Rosenstrauch wrote:

> Consequently, the way I write my code for ZooKeeper is against a more
> generic interface that provides operations for open, close, getData, and
> setData.  When unit testing, I substitute in a "dummy" implementation that
> just stores data in memory (i.e., a HashMap); when running live code I use
> an implementation that talks to ZooKeeper.
>


Re: Testing zookeeper outside the source distribution?

2010-10-18 Thread David Rosenstrauch

On 10/18/2010 08:17 AM, Anthony Urso wrote:

Anyone have any pointers on how to test against ZK outside of the
source distribution? All the fun classes (e.g. ClientBase) do not make
it into the ZK release jar.

Right now I am manually running a ZK node for the unit tests to
connect to prior to running my test, but I would rather have something
that ant could reliably
automate starting and stopping for CI.

Thanks,
Anthony


The way I learned about unit testing is that a unit test should be 
"isolated", that is:  not need to depend on any external resource - most 
notably network resources, such as a database, a web server, or 
ZooKeeper.  (It's still OK to have a test that tests again a network 
resource, but that's really an integration test, not a unit test.)


Consequently, the way I write my code for ZooKeeper is against a more 
generic interface that provides operations for open, close, getData, and 
setData.  When unit testing, I substitute in a "dummy" implementation 
that just stores data in memory (i.e., a HashMap); when running live 
code I use an implementation that talks to ZooKeeper.


HTH,

DR


Re: Testing zookeeper outside the source distribution?

2010-10-18 Thread Benjamin Reed
 we should be exposing those classes and releasing them as a testing 
jar. do you want to open up a jira to track this issue?


ben

On 10/18/2010 05:17 AM, Anthony Urso wrote:

Anyone have any pointers on how to test against ZK outside of the
source distribution? All the fun classes (e.g. ClientBase) do not make
it into the ZK release jar.

Right now I am manually running a ZK node for the unit tests to
connect to prior to running my test, but I would rather have something
that ant could reliably
automate starting and stopping for CI.

Thanks,
Anthony




Testing zookeeper outside the source distribution?

2010-10-18 Thread Anthony Urso
Anyone have any pointers on how to test against ZK outside of the
source distribution? All the fun classes (e.g. ClientBase) do not make
it into the ZK release jar.

Right now I am manually running a ZK node for the unit tests to
connect to prior to running my test, but I would rather have something
that ant could reliably
automate starting and stopping for CI.

Thanks,
Anthony