You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by rohit sinha <ta...@gmail.com> on 2017/07/19 20:27:54 UTC

Unit Test for Ranger Plugin

Hello,

I am working on developing integrating an external service with Apache
Ranger.
I am trying to figure out how to write unit tests which can test my
authorization plugin.
Is there any way to start ranger in memory?

I see that there are some tests for hive which uses a file based policy and
has a test client which reads from the file as a mock policy store. Is this
the way to go?
Also is there any generic RangerAdminClient for tests?

Thanks.

Re: Unit Test for Ranger Plugin

Posted by Colm O hEigeartaigh <co...@apache.org>.
I would start by getting your external service to start in a test-case and
plug in a mocked authorization plugin and write some tests. Once this is
working, then swap out the mocked plugin for the Ranger plugin. Start the
Ranger Admin service locally and create some policies. When this is
working, download the policies, and change the Ranger configuration to load
the policies from a local file. To see an example, the Kafka tests follow
this approach.

Colm.

On Wed, Jul 19, 2017 at 9:27 PM, rohit sinha <ta...@gmail.com>
wrote:

> Hello,
>
> I am working on developing integrating an external service with Apache
> Ranger.
> I am trying to figure out how to write unit tests which can test my
> authorization plugin.
> Is there any way to start ranger in memory?
>
> I see that there are some tests for hive which uses a file based policy and
> has a test client which reads from the file as a mock policy store. Is this
> the way to go?
> Also is there any generic RangerAdminClient for tests?
>
> Thanks.
>



-- 
Colm O hEigeartaigh

Talend Community Coder
http://coders.talend.com