Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add IMEISV to NASREQ #221

Merged
merged 1 commit into from
May 27, 2024
Merged

Add IMEISV to NASREQ #221

merged 1 commit into from
May 27, 2024

Conversation

javiermtorres
Copy link

No description provided.

@javiermtorres javiermtorres requested a review from a team as a code owner May 16, 2024 09:38
true -> AAA0
end,
{reply, ['AAA' | AAA]};
OkResponse = fun() ->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is that a fun? I don't see the need for that.

This could simply be:

OkResponse = {reply, ['AAA' | AAA]},

resulting in a much smaller change.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to avoid doing all this processing unless it's really necessary, but maybe it's a premature optimization. If you prefer this way, I can change it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that code is used in unit test only, I really don't see that that would need optimization.

You could also move the answer construction into the final case when you change it a bit to

    case Msg of
	#{'Calling-Station-Id' := ?MSISDN_FOR_IMEI_SV}
	  when not is_map_key('3GPP-IMEISV') ->
	    {answer_message, 5005};
	_ ->
	    < code for ok response >
    end;

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I'll remove the fun and use the precomputed ok response.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re: the answer construction, I prefer using explicit conditions for separate cases in tests. The "when not is_map_key" requires that the reader spends time thinking on whether the case they're using complies or not with this condition. This may be ok for the code itself, but makes the life of a tester easier.

test/ergw_aaa_test_lib.hrl Outdated Show resolved Hide resolved
test/diameter_nasreq_SUITE.erl Outdated Show resolved Hide resolved
@javiermtorres javiermtorres requested a review from RoadRunnr May 27, 2024 10:33
@javiermtorres
Copy link
Author

The rate limit TC fails due unrelated issues. @RoadRunnr is working on making it more stable.

@javiermtorres javiermtorres merged commit b5ad0bf into master May 27, 2024
6 checks passed
@javiermtorres javiermtorres deleted the add-avps-to-nasreq branch May 27, 2024 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants