Skip to content
This repository was archived by the owner on Dec 14, 2022. It is now read-only.

Commit ea6eecf

Browse files
committed
Added test data to test_search_enpoint and adopted test file
1 parent 7ae835b commit ea6eecf

File tree

2 files changed

+229
-2
lines changed

2 files changed

+229
-2
lines changed

elk-traffic-monitor-api/test/documents/basic/search_test_documents.js

Lines changed: 227 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,5 +475,232 @@ module.exports = [
475475
"version": "7.7.20200130",
476476
"domainId": "8064faa2-54d2-42aa-b549-af5a0b289284"
477477
}
478+
},
479+
{
480+
"transactionElements": {
481+
"leg0": {
482+
"leg": 0,
483+
"protocolInfo": {
484+
"recvHeader": "GET /api/portal/v1.3/appinfo HTTP/1.1\r\nHost: 127.0.0.1:8075\r\nAccept: */*\r\nIsApiPortalRequest: true\r\nConnection: close\r\n\r\n",
485+
"sentHeader": "HTTP/1.1 200 OK\r\nDate: Tue, 17 Mar 2020 11:18:05 GMT\r\nContent-Type: application/json\r\nCache-Control: no-cache, no-store, must-revalidate\r\nPragma: no-cache\r\nExpires: 0\r\nX-Frame-Options: DENY\r\nX-Content-Type-Options: nosniff\r\nX-XSS-Protection: 0\r\nServer: Gateway\r\nConnection: close\r\nX-CorrelationID: Id-edb1705e7d0168a34d74bfba 0\r\n\r\n",
486+
"http": {
487+
"localPort": "8075",
488+
"method": "GET",
489+
"status": 200,
490+
"wafStatus": 0,
491+
"remoteAddr": "127.0.0.1",
492+
"bytesSent": 735,
493+
"remotePort": "53514",
494+
"uri": "/api/portal/v1.3/appinfo",
495+
"localAddr": "127.0.0.1",
496+
"statusText": "OK",
497+
"bytesReceived": 121,
498+
"remoteName": "127.0.0.1"
499+
}
500+
},
501+
"duration": 12
502+
}
503+
},
504+
"correlationId": "edb1705e7d0168a34d74bfba",
505+
"@version": "1",
506+
"circuitPath": [],
507+
"tags": [
508+
"openlog"
509+
],
510+
"timestampOriginal": "2020-03-17T11:18:05.378Z",
511+
"processInfo": {
512+
"groupName": "QuickStart Group",
513+
"serviceName": "QuickStart Server",
514+
"domainId": "ed992442-c363-4d36-963a-9e6314b0f421",
515+
"groupId": "group-2",
516+
"version": "7.7.20200130",
517+
"serviceId": "instance-1",
518+
"hostname": "api-env"
519+
}
520+
},
521+
{
522+
"transactionElements": {
523+
"leg0": {
524+
"leg": 0,
525+
"finalStatus": "Pass",
526+
"protocolInfo": {
527+
"recvHeader": "GET / HTTP/1.1\r\nHost: api-env.demo.axway.com:8075\r\nUser-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\nAccept-Language: en-US,en;q=0.5\r\nAccept-Encoding: gzip, deflate, br\r\nReferer: https://api-env.demo.axway.com:8075/home\r\nConnection: keep-alive\r\nCookie: 6e7e1bb1dd446d4cd36889414ccb4cb7=cakooto11btta81joumss3hnka; portal.logintypesso=false; portal.demo=off; portal.isgridSortIgnoreCase=on; roundcube_sessid=3qqh3mp9qnrqq0hfrmdvac73sc\r\nUpgrade-Insecure-Requests: 1\r\n\r\n",
528+
"sentHeader": "HTTP/1.1 200 OK\r\nDate: Tue, 17 Mar 2020 11:23:06 GMT\r\nServer: Gateway\r\nConnection: close\r\nX-CorrelationID: Id-1ab3705e920284217e6aae73 0\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\nAccept-Language: en-US,en;q=0.5\r\nCache-Control: no-cache, no-store, must-revalidate\r\nContent-Security-Policy: frame-ancestors 'none'\r\nCookie: 6e7e1bb1dd446d4cd36889414ccb4cb7=cakooto11btta81joumss3hnka; portal.logintypesso=false; portal.demo=off; portal.isgridSortIgnoreCase=on; roundcube_sessid=3qqh3mp9qnrqq0hfrmdvac73sc\r\nExpires: 0\r\nHost: api-env.demo.axway.com:8075\r\nPragma: no-cache\r\nReferer: https://api-env.demo.axway.com:8075/home\r\nUpgrade-Insecure-Requests: 1\r\nUser-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0\r\nX-Content-Type-Options: nosniff\r\nX-Frame-Options: DENY\r\nX-XSS-Protection: 0\r\nContent-Type: text/html\r\n\r\n",
529+
"http": {
530+
"localPort": "8075",
531+
"method": "GET",
532+
"status": 200,
533+
"wafStatus": 0,
534+
"remoteAddr": "10.128.58.136",
535+
"bytesSent": 2855,
536+
"bytesReceived": 572,
537+
"remotePort": "45412",
538+
"localAddr": "10.128.58.136",
539+
"statusText": "OK",
540+
"uri": "/",
541+
"remoteName": "10.128.58.136"
542+
}
543+
},
544+
"duration": 2
545+
}
546+
},
547+
"correlationId": "1ab3705e920284217e6aae73",
548+
"@version": "1",
549+
"circuitPath": [
550+
{
551+
"execTime": 1,
552+
"policy": "API Manager Protection Policy",
553+
"filters": [
554+
{
555+
"class": "com.vordel.circuit.attribute.SetAttributeFilter",
556+
"status": "Pass",
557+
"filterTime": 1584444186836,
558+
"execTime": 0,
559+
"espk": "DEFAULT_PRIMARY_VordelGateway_7.7.0:3563372240640736537",
560+
"name": "Disable Monitoring",
561+
"type": "SetAttributeFilter"
562+
},
563+
{
564+
"class": "com.vordel.circuit.CircuitDelegateFilter",
565+
"status": "Pass",
566+
"filterTime": 1584444186837,
567+
"execTime": 1,
568+
"subPaths": [
569+
{
570+
"execTime": 0,
571+
"policy": "Secure Headers",
572+
"filters": [
573+
{
574+
"class": "com.vordel.circuit.conversion.AddHTTPHeaderFilter",
575+
"status": "Pass",
576+
"filterTime": 1584444186836,
577+
"execTime": 0,
578+
"type": "AddHTTPHeaderFilter",
579+
"espk": "DEFAULT_PRIMARY_VordelGateway_7.7.0:1018430481999133398",
580+
"name": "Add X-Frame-Options"
581+
},
582+
{
583+
"status": "Pass",
584+
"class": "com.vordel.circuit.conversion.AddHTTPHeaderFilter",
585+
"filterTime": 1584444186836,
586+
"execTime": 0,
587+
"espk": "DEFAULT_PRIMARY_VordelGateway_7.7.0:2425540468063109194",
588+
"name": "Add X-Content-Type-Options",
589+
"type": "AddHTTPHeaderFilter"
590+
},
591+
{
592+
"class": "com.vordel.circuit.conversion.AddHTTPHeaderFilter",
593+
"status": "Pass",
594+
"filterTime": 1584444186836,
595+
"execTime": 0,
596+
"espk": "DEFAULT_PRIMARY_VordelGateway_7.7.0:-5444113616489599230",
597+
"name": "Add X-XSS-Protection",
598+
"type": "AddHTTPHeaderFilter"
599+
},
600+
{
601+
"class": "com.vordel.circuit.conversion.AddHTTPHeaderFilter",
602+
"status": "Pass",
603+
"filterTime": 1584444186836,
604+
"execTime": 0,
605+
"espk": "DEFAULT_PRIMARY_VordelGateway_7.7.0:7081893704511792953",
606+
"name": "Add Content-Security-Policy",
607+
"type": "AddHTTPHeaderFilter"
608+
},
609+
{
610+
"class": "com.vordel.circuit.conversion.AddHTTPHeaderFilter",
611+
"status": "Pass",
612+
"filterTime": 1584444186837,
613+
"execTime": 0,
614+
"espk": "DEFAULT_PRIMARY_VordelGateway_7.7.0:-2212651968248743366",
615+
"name": "Add Expires",
616+
"type": "AddHTTPHeaderFilter"
617+
},
618+
{
619+
"class": "com.vordel.circuit.conversion.AddHTTPHeaderFilter",
620+
"status": "Pass",
621+
"filterTime": 1584444186837,
622+
"execTime": 0,
623+
"espk": "DEFAULT_PRIMARY_VordelGateway_7.7.0:1947547883410725837",
624+
"name": "Add Pragma",
625+
"type": "AddHTTPHeaderFilter"
626+
},
627+
{
628+
"class": "com.vordel.circuit.conversion.AddHTTPHeaderFilter",
629+
"status": "Pass",
630+
"filterTime": 1584444186837,
631+
"execTime": 0,
632+
"espk": "DEFAULT_PRIMARY_VordelGateway_7.7.0:1213862525432630139",
633+
"name": "Add Cache-Control",
634+
"type": "AddHTTPHeaderFilter"
635+
}
636+
]
637+
}
638+
],
639+
"espk": "DEFAULT_PRIMARY_VordelGateway_7.7.0:-7310008129630418788",
640+
"name": "Add Secure Headers",
641+
"type": "CircuitDelegateFilter"
642+
},
643+
{
644+
"status": "Fail",
645+
"class": "com.vordel.circuit.authn.CheckSessionFilter",
646+
"filterTime": 1584444186837,
647+
"execTime": 0,
648+
"espk": "DEFAULT_PRIMARY_VordelGateway_7.7.0:1617103538881458172",
649+
"name": "Check Session",
650+
"type": "CheckSessionFilter"
651+
},
652+
{
653+
"class": "com.vordel.circuit.attribute.CompareAttributeFilter",
654+
"status": "Pass",
655+
"filterTime": 1584444186837,
656+
"execTime": 0,
657+
"espk": "DEFAULT_PRIMARY_VordelGateway_7.7.0:1444681803898426806",
658+
"name": "Is This Root or Home?",
659+
"type": "CompareAttributeFilter"
660+
},
661+
{
662+
"class": "com.vordel.circuit.attribute.CompareAttributeFilter",
663+
"status": "Fail",
664+
"filterMessage": "Filter failed",
665+
"filterTime": 1584444186837,
666+
"execTime": 0,
667+
"type": "CompareAttributeFilter",
668+
"name": "Query String Exists?",
669+
"espk": "DEFAULT_PRIMARY_VordelGateway_7.7.0:-3576911551036060428"
670+
},
671+
{
672+
"status": "Pass",
673+
"class": "com.vordel.circuit.file.LoadFileFilter",
674+
"filterTime": 1584444186837,
675+
"execTime": 0,
676+
"espk": "DEFAULT_PRIMARY_VordelGateway_7.7.0:644437044284765021",
677+
"name": "Load API Manager Login Page",
678+
"type": "LoadFileFilter"
679+
},
680+
{
681+
"status": "Pass",
682+
"class": "com.vordel.circuit.net.ReflectFilter",
683+
"filterTime": 1584444186837,
684+
"execTime": 0,
685+
"espk": "DEFAULT_PRIMARY_VordelGateway_7.7.0:-3977244110355365495",
686+
"name": "Send Login Page",
687+
"type": "ReflectFilter"
688+
}
689+
]
690+
}
691+
],
692+
"tags": [
693+
"openlog"
694+
],
695+
"timestampOriginal": "2020-03-17T11:23:06.838Z",
696+
"processInfo": {
697+
"groupName": "QuickStart Group",
698+
"serviceName": "QuickStart Server",
699+
"domainId": "ed992442-c363-4d36-963a-9e6314b0f421",
700+
"groupId": "group-2",
701+
"version": "7.7.20200130",
702+
"serviceId": "instance-1",
703+
"hostname": "api-env"
704+
}
478705
}
479706
];

elk-traffic-monitor-api/test/test_search_endpoint.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ describe('Endpoints', function () {
4848
expect(response.statusCode).to.equal(200);
4949
expect(body).to.be.an('Object');
5050
expect(body).to.have.property('data');
51-
expect(body.data).to.have.lengthOf(4);
51+
expect(body.data).to.have.lengthOf(6);
5252
checkFields(body.data, false);
5353
});
5454
});
@@ -484,7 +484,7 @@ function checkFields(data, hasServiceContext) {
484484
expect(entry).to.have.property('uri');
485485
expect(entry).to.have.property('duration');
486486
expect(entry).to.have.property('type');
487-
expect(entry).to.have.property('finalStatus');
487+
//expect(entry).to.have.property('finalStatus');
488488
if(hasServiceContext) {
489489
expect(entry).to.have.property('subject');
490490
expect(entry).to.have.property('correlationId');

0 commit comments

Comments
 (0)