freeradius 3.0.13 used custome attribute reply - freeradius

I am configuring Freeradius.
It is authentication reject when i try to use custom attribute register in radreply table.
This is my test operation and error case.
Ⅰ. Insert record to radreply table
> insert into radreply values(null,"user1","Custom-TEST1",":=","56789");
> select * from radreply;
+----+----------+---------------+----+-----------+
| id | username | attribute | op | value |
+----+----------+---------------+----+-----------+
| 1 | user1 | Custom-NET01 | := | 12345 |
+----+----------+---------------+----+-----------+
Ⅱ. Configure dictionary file
$ vi /etc/raddb/dictionary
  ATTRIBUTE Custom-TEST1 3000 integer
I checked by debbug mode. Then i can see this messages.
(0) sql: ERROR: Error parsing value: Unknown or invalid value "10.0.0.1" for attribute Custom-TEST1
(0) sql: ERROR: Error parsing user data from database result
(0) sql: ERROR: SQL query error getting reply attributes
Please tell me how to solve this error.

The issue here is you've defined your custom attribute as an integer (which in this case means a 32bit unsigned integer). You're then later, trying to assign an IPv4 address to this integer, which is invalid.
If you want to assign an ipv4 address to your attribute, it needs to be defined as an ipaddr type.

Related

ElasticMQ does not reject illegal string as epected

I have been using ElasticMQ, it is supposed to behave like AWS SQS.
According to AWS SQS online documentation, any illegal strings that are out of this range #x9 | #xA | #xD | #x20 to #xD7FF | #xE000 to #xFFFD | #x10000 to #x10FFFF, will be rejected.
But when I created an illegal string (only consists of one illegal char), and sent it to ElasticMQ, it was not rejected.
ElasticMQ did behave strangely though: for this illegal string (one char), the MD5 checksum calculated on the client side was very different from the MD5 checksum returned by ElasticMQ.
Can anyone verify if ElasticMQ is able to reject illegal strings?

cannot find "for loop" keyword in robot framework

I am currently connecting SQL server to robot framework, so i can read my data table name in robot. and I want to use for loop to check table name, somehow, ":FOR" loop keyword cannot found, but I have installed libraries such as operating-system, collections, string, built-in, diff-library and so on. anyone can help me why i cannot use for loop? any help will be appreciated.
The robot framework users guide has a whole section on how to use the for loop. From that section:
The syntax starts with :FOR, where colon is required to separate the
syntax from normal keywords. The next cell contains the loop variable,
the subsequent cell must have IN, and the final cells contain values
over which to iterate. These values can contain variables, including
list variables.
Here's an example from the user's guide, reformatted to use pipes (for clarity):
*** Test Cases ***
| Example 1
| | :FOR | ${animal} | IN | cat | dog
| | | log | ${animal}
| | | log | 2nd keyword
| | Log | Outside loop
Maybe you are not escaping indented cells; as the Tip in the documentation says. Try writing loops like this:
:FOR ${index} IN RANGE ${start} ${stop}
\ log to console index: ${index}
\ Call a Keyword

How do I use dynamic arguments in my SpecFlow scenario background?

I have a feature that logs into a trading system and keys a number of trades. Theres a lot of reusable steps at the beginning of each trade (initial trade set up) But each trade has different arguments.
Here is an example
Scenario: Trade 1
Given I have selected my test data: "20003"
And I have connected to VMS with the following details:
| Field | Value |
| Username | user |
| Password | password |
| Session | myServer |
When I run the DCL command to set my privileges to full
Then I expect to see the following:
| Pass Criteria | Timeout |
| Privileges Set | 00:00:30 |
When I ICE to the test account: "System Test"
Then I expect to be ICED see the following:
| Pass Criteria | Timeout |
| "ICED to System Test" | "00:00:10" |
When I run a dcl to delete the company: "Test_Company"
Then I expect to see a confirmation that company: "Test_Company" has been deleted or doesnt exist
So within those steps the 2 things that could change is the "Given" argument so the test data ID and also the Test company at the end.
What I wanted was some way to run a background step so that its being able to know what parameters to enter. So if it was Trade 1 for example it would enter 20003, if it was Trade 2 enter 20004 etc.
Can I do this? I was thinking using the "Example" table that Scenario Outline uses. Or is there a better way to do this? I dont want these repeatable steps in all of my scenarios as it takes up lots of room and doesnt look too readable.
So I did some searching and couldn't find a solution that didn't require a lot of coding so I made this up:
this is what the background looks like
Background:
Given I have selected my test data:
| Scenario | ID |
| DirectCredit_GBP | 20003 |
| Cheque_GBP | 20004 |
| ForeignCheque_GBP | 20005 |
And in order to find which row it should use the method behind it uses ScenarioContext. Here is the method:
[Given(#"I have selected my test data:")]
[When(#"I have selected my test data:")]
public static void setTestDataID(Table data)
{
string scenario = ScenarioContext.Current.ScenarioInfo.Title;
string testDataId = data.ReadTable("Scenario", scenario, "ID"));
TestDriver.LoadTestData(testDataId);
}
What the method does is search the table for the scenario name (using an extension method I wrote) and get the ID, once its got the ID it passes it into my TestDriver method.
It seems to work fine and keeps the test readable.

Xtext: Cross-References with Alternative

I've started my first Xtext project and I run into a problem with Cross-Reference (That's what I think is maybe the problem). I've got a DatType, InterfaceDescription rule and an Enumeration. What I want to do is to describe an interface by leting the user choose a datatype from the enumeration or define a new one.
The Enum works without a problem, but when I define a new Datatype with "datatype test1" and use it inside the InterfaceDescription, I get the following Error: 'XtextReconcilerJob' has encountered a problem. An internal error occurred during: "XtextReconcileJon". And that's the error stack: http://pastebin.com/evFki2mB
DataType:
'datatype' name=ID ('mapto' mappedType = JAVAID)?
;
Interface:
interfaceType=InterfaceType name=ID datatype=([DataType]| DataTypeEnum)
;
enum InterfaceType:
INLET = 'inlet' |
OUTLET = 'outlet'
;
DataTypeEnum:
INT8 = 'int8' | INT16 = 'int16' | INT32 = 'int32' |
DOUBLE = 'double' | SINGLE = 'single' | REAL = 'real' |
BOOLEAN = 'boolean' | CHAR = 'char'
;
When I use the DataType Cross-Reference in another Rule, it works:
ParamList:
'param:' datatype=[DataType] name=ID
;
Anyone knows what's the problem?
There are a few issues with the grammar, that together cause this strange behaviour:
DataTypeEnum, as opposed to its name is not an enum but a strange object that might represent a few string values. This hides the issue of the alternate type assignment in the interface rule in the editor.
When generating the editor, some cryptic error messages appear in the output:
error(208): ../org.xtext.example.mydsl/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDsl.g:447:1: The following token definitions can never be matched because prior tokens match the same input: RULE_ID
ebnf2 is not supported for CrossReference - this means, that an extended construct, such as the '|' pattern is not allowed when defining references
By prefixing the DataTypeEnum with the enum keyword, the datatype attribute definition becomes erroneous in the editor, as there is no type in EMF that can be both an enum and an EObject, thus the problem location becomes obvious.
Finally, the runtime error was caused by the fact, that something was missing from the generated parser/lexer tooling, and the resulting model was also incorrect.
To be more constructive, I suggest replacing the offending line by defining a TypeReference element, that can either refer to types mapped to Java or data types. I could extend your grammar in the following way:
Interface:
interfaceType=InterfaceType name=ID datatype=(TypeReference)
;
TypeReference:
JavaTypeReference | DataTypeReference
;
JavaTypeReference:
type = [DataType]
;
DataTypeReference:
type = DataTypeEnum
;
enum DataTypeEnum:
INT8 = 'int8' | INT16 = 'int16' | INT32 = 'int32' |
DOUBLE = 'double' | SINGLE = 'single' | REAL = 'real' |
BOOLEAN = 'boolean' | CHAR = 'char'
;
PS.: I suggest adding some keywords to the language to ease parsing, especially error recovery. See the following blog post for details: http://zarnekow.blogspot.hu/2012/11/xtext-corner-7-parser-error-recovery.html

fitnesse: howto load a symbol with a result in query table

In a FitNesse query table, is it possible to load a symbol with the returned results?
example of what I would like to do:
|Query: GetPlayers|
| name | age | ID |
| jones | 36 | $ID1= |
| smith | 27 | $ID2= |
Or alternatively, just have one $ID symbol which is loaded with a collection.
Is this possible?
Unfortunately I believe this is still an unresolved issue in FitNesse. There is a PivotalTracker entry for it, that no one has take one yet: https://www.pivotaltracker.com/story/show/1893214. I've looked at it, but haven't been able to solve it myself.
We currently work around this by having a driver that can do equivalent query. Then we get the value back from the query. It is much more cumbersome, but works for now.
I completely agree that this should be possible. But as far as I know, it has not been fixed yet.
Maybe I don't understand your problem, but this is working fine for me:
|Query: whatever|whatever_param |
|key |value |
|a_key |$symbol= |
|check |$symbol|a_value|
I use Cslim, and the method whatever.query() returns a list of maps that correspond to the keys (the key a_key have the value a_value for this exemple)

Resources