]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Assign the RADIUS dictionary to requests in unit_test_module
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 30 Nov 2018 12:42:16 +0000 (07:42 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 10 Dec 2018 16:20:38 +0000 (11:20 -0500)
This is needed for runtime attribute resolution to work correctly.

src/bin/unit_test_module.c

index 9ded3f3c5ffe9fc102d3bec5f63314fdb8e00e9e..35c16716d8d3bfdaa84d3890c98c1f4aa629f572 100644 (file)
@@ -179,6 +179,17 @@ static REQUEST *request_from_file(FILE *fp, fr_event_list_t *el, RADCLIENT *clie
        request = request_alloc(NULL);
        gettimeofday(&now, NULL);
 
+       /*
+        *      FIXME - Should be less RADIUS centric, but everything
+        *      else assumes RADIUS at the moment so we can fix this later.
+        */
+       request->dict = fr_dict_by_protocol_name("radius");
+       if (!request->dict) {
+               ERROR("RADIUS dictionary failed to load");
+               talloc_free(request);
+               return NULL;
+       }
+
        request->packet = fr_radius_alloc(request, false);
        if (!request->packet) {
                ERROR("No memory");