Adding Testcases to modules

shivu prasad shivaprasad2452 at gmail.com
Tue Oct 30 13:09:02 CET 2018


Hi Alan,

Thanks for help,

I created the test module and run it is working for authorize method but
authenticate method is not calling only,

I checked radiusd.conf(src/tests/modules/radiusd.conf), in authenticate
only Pap is there.

authenticate {
        pap
    }

I try adding my module there but its throwing the error.
even I try the updating the auth type after authorize like below slimier to
default config in sites-enabled/default


server default {
    authorize {
        #
        # Include the test file specified by the
        # KEYWORD environment variable.
        #
        $INCLUDE $ENV{MODULE_TEST_UNLANG}
        if (ok)    {
        update control{
            Auth-Type := idcs
        }
    }

        #pap
    }

    authenticate {
        $INCLUDE  $ENV{MODULE_TEST_UNLANG}

        #pap
    }
}

but still it throwing the below error

Debug:   my_reject
Tue Oct 30 17:20:44 2018 : Error: src/tests/modules//radiusd.conf[43]:
Unknown Auth-Type "control" in authenticate sub-section.
# build/tests/modules/always/replace.log
MODULE_TEST_DIR=src/tests/modules/always/
MODULE_TEST_UNLANG=src/tests/modules/always/replace.unlang
FR_LIBRARY_PATH=./build/lib/.libs build/make/jlibtool --quiet
--mode=execute ./build/bin/local/unittest -D share -d src/tests/modules/ -i
build/tests/modules/always/replace.attrs -f
build/tests/modules/always/replace.attrs -xx
make: *** [build/tests/modules/always/replace] Error 1

any input to how to resolve and add test-case to authenticate method.

Regards,
Shivaprasad








On Thu, Oct 11, 2018 at 1:05 AM Alan DeKok <aland at deployingradius.com>
wrote:

> On Oct 10, 2018, at 3:05 PM, shivu prasad <shivaprasad2452 at gmail.com>
> wrote:
> >
> > Hi Alan,
> >
> > Thanks for help I able to run default test suite.
> > configure
> > - make
> > - make test (not tests)
> > worked after some ssl fix.
>
>   Sure.
>
> > Now I want to add testcases to my new module
> > can you help me, what steps  or config I need to do for adding testcases
> tp
> > my module.
> > Here is my understanding
> >
> > - Create module in src/tests/modules (I am referring the files module).
> > - Do I need to add entry or need config change to make them run.
>
>   See the existing examples.
>
> src/tests/modules/always/module.conf
>
>   - the configuration for your module
>
> src/tests/modules/always/*.unlang
>
>   Tests to run for the modules
>
>   Alan DeKok.
>
> -
> List info/subscribe/unsubscribe? See
> http://www.freeradius.org/list/devel.html


More information about the Freeradius-Devel mailing list