From 1f9050267eeb870c4c0f50000fc32985c4d8535b Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Tue, 4 Feb 2020 12:02:18 -0800 Subject: [PATCH] add ini, xml, and yaml test files --- tests/fixtures/generic/ini-iptelserver.ini | 133 +++++++++++ tests/fixtures/generic/ini-iptelserver.json | 1 + tests/fixtures/generic/ini-test.ini | 12 + tests/fixtures/generic/ini-test.json | 1 + tests/fixtures/generic/xml-cd_catalog.json | 1 + tests/fixtures/generic/xml-cd_catalog.xml | 211 ++++++++++++++++++ tests/fixtures/generic/xml-foodmenu.json | 1 + tests/fixtures/generic/xml-foodmenu.xml | 33 +++ tests/fixtures/generic/yaml-istio-sc.json | 1 + tests/fixtures/generic/yaml-istio-sc.yaml | 17 ++ .../fixtures/generic/yaml-istio-sidecar.json | 1 + .../fixtures/generic/yaml-istio-sidecar.yaml | 174 +++++++++++++++ 12 files changed, 586 insertions(+) create mode 100644 tests/fixtures/generic/ini-iptelserver.ini create mode 100644 tests/fixtures/generic/ini-iptelserver.json create mode 100644 tests/fixtures/generic/ini-test.ini create mode 100644 tests/fixtures/generic/ini-test.json create mode 100644 tests/fixtures/generic/xml-cd_catalog.json create mode 100644 tests/fixtures/generic/xml-cd_catalog.xml create mode 100644 tests/fixtures/generic/xml-foodmenu.json create mode 100644 tests/fixtures/generic/xml-foodmenu.xml create mode 100644 tests/fixtures/generic/yaml-istio-sc.json create mode 100644 tests/fixtures/generic/yaml-istio-sc.yaml create mode 100644 tests/fixtures/generic/yaml-istio-sidecar.json create mode 100644 tests/fixtures/generic/yaml-istio-sidecar.yaml diff --git a/tests/fixtures/generic/ini-iptelserver.ini b/tests/fixtures/generic/ini-iptelserver.ini new file mode 100644 index 00000000..9b46c75f --- /dev/null +++ b/tests/fixtures/generic/ini-iptelserver.ini @@ -0,0 +1,133 @@ +[Settings] +#====================================================================== +# Set detailed log for additional debugging info +DetailedLog=1 +RunStatus=1 +StatusPort=6090 +StatusRefresh=10 +Archive=1 +# Sets the location of the MV_FTP log file +LogFile=/opt/ecs/mvuser/MV_IPTel/log/MV_IPTel.log +#====================================================================== +Version=0.9 Build 4 Created July 11 2004 14:00 +ServerName=Unknown +[FTP] +#====================================================================== +# set the FTP server active +RunFTP=1 +# defines the FTP control port +FTPPort=21 +# defines the FTP data port +FTPDataPort=20 +# Sets the location of the FTP data directory to catch terminal backups +FTPDir=/opt/ecs/mvuser/MV_IPTel/data/FTPdata +# FTP Timeout (secs) +FTP_TimeOut=5 +# Enable SuperUser +EnableSU=1 +# set the SuperUser Name +SUUserName=mvuser +# set the SuperUser Password +SUPassword=Avaya +# +#====================================================================== +[FTPS] +#====================================================================== +# set the FTPS server active +RunFTPS=0 +# defines the FTP control port +FTPPort=990 +# defines the FTP data port +FTPDataPort=889 +#====================================================================== +[TFTP] +#====================================================================== +# set the Trivial FTP server active +RunTrivialFTP=1 +# defines the Trivial FTP port +TrivialFTPPort=69 +# Sets the location of the TFTP data directory for terminal downloads +TFTPDir=/opt/ecs/mvuser/MV_IPTel/data/TFTPdata +#====================================================================== +[HTTP] +#====================================================================== +# set the HTTP download server active +RunHTTP=1 +# defines the HTTP download port +HTTPPort=81 +# Sets the location of the HTTP data directory for downloads +HTTPDir=/opt/ecs/mvuser/MV_IPTel/data/HTTPdata +#====================================================================== +[HTTPS] +#====================================================================== +# set the HTTPS download server active +RunHTTPS=0 +# defines the HTTPS download port +HTTPSPort=411 +# Sets the location of the HTTPS data directory for downloads +HTTPSDir=/opt/ecs/mvuser/MV_IPTel/data/HTTPSdata +# Sets the location of the CertFile +CertFile=/opt/ecs/mvuser/MV_IPTel/certs/IPTelcert.pem +# Sets the location of the KeyFile +KeyFile=/opt/ecs/mvuser/MV_IPTel/certs/IPTelkey.pem +# Use Client Authorization +ClientAuth=0 +# narrow config for Avaya IPTel (TLSV1 using RSA_NULL_SHA) +IPTel=0 +# sets the SSL variants if not Avaya IPtel (IPTel=0) +SSLV2=0 +SSLV3=0 +TLSV1=1 +UseProxy=0 +ProxyAddr=simon.avaya.com +ProxyPort=9000 +#====================================================================== +[BACKUP_SERVERS] +#====================================================================== +# Run as FileServer for Backup & Update requests - Note this process uses HTTPS +FileServer=0 +# sets whether to download Firmware updates from the primary/secondary file servers +RequestUpdates=0 +# sets whether to upload FTP files to the primary/secondary file servers +RequestBackup=0 +# Enable use of the Primary file server +UsePrimarySvr=0 +# Primary file server IP address ( or resolvable DNS) +PrimaryIP=192.168.0.13 +# Enable use of the Secondary file server +UseSecondarySvr=0 +# Secondary file server IP address ( or resolvable DNS) +SecondaryIP=192.168.0.10 +# Sets the update interval for Backups & updates ; 1 = min; 2 =hour, 3=day, 4 =month +UpdateInterval=2 +#Send FTP backup to the customer sever +CustomFTP=1 +# FTP backup directory customer sever +CustomFTPDir=home/mvuser/backup +# FTP backup directory user login name +CustomFTPUName=tom +# FTP backup directory user password +CustomFTPPwd=jerry +# Enable CDR Backup - enable=1 on both File Server & Client +CDRBackup=0 +# Enable BCMS Backup - enable=1 on both File Server & Client +BCMSBackup=0 +# Retain CDR / BCMS copy data for x days ( Receiver always + 1 week) +RetainDays=7.0 +#====================================================================== +[SNMP] +#================================================================ +# +# Validate FTP store with SNMP check +UseSNMP=1 +# In case the SNMPGET syntax changes you can redefine the commands +# Uncomment the relevant line to override the internal command +#the syntax is "Command + IPADDR + ExtObj + Awk +# the IPADRR is derived from the connection +# Note there are relavant spaces at the start/end of the component - omit and it will fail +#Command=/usr/bin/snmpget +#Params= -v2c -cpublic +#ExtObject=.1.3.6.1.4.1.6889.2.69.1.4.9.0 +#TypeObject=.1.3.6.1.4.1.6889.2.69.1.1.2.0 +#Awk=| awk -F \" '' {print $2 } '' +#================================================================ diff --git a/tests/fixtures/generic/ini-iptelserver.json b/tests/fixtures/generic/ini-iptelserver.json new file mode 100644 index 00000000..68a0d7d4 --- /dev/null +++ b/tests/fixtures/generic/ini-iptelserver.json @@ -0,0 +1 @@ +{"Settings": {"detailedlog": "1", "runstatus": "1", "statusport": "6090", "statusrefresh": "10", "archive": "1", "logfile": "/opt/ecs/mvuser/MV_IPTel/log/MV_IPTel.log", "version": "0.9 Build 4 Created July 11 2004 14:00", "servername": "Unknown"}, "FTP": {"runftp": "1", "ftpport": "21", "ftpdataport": "20", "ftpdir": "/opt/ecs/mvuser/MV_IPTel/data/FTPdata", "ftp_timeout": "5", "enablesu": "1", "suusername": "mvuser", "supassword": "Avaya"}, "FTPS": {"runftps": "0", "ftpport": "990", "ftpdataport": "889"}, "TFTP": {"runtrivialftp": "1", "trivialftpport": "69", "tftpdir": "/opt/ecs/mvuser/MV_IPTel/data/TFTPdata"}, "HTTP": {"runhttp": "1", "httpport": "81", "httpdir": "/opt/ecs/mvuser/MV_IPTel/data/HTTPdata"}, "HTTPS": {"runhttps": "0", "httpsport": "411", "httpsdir": "/opt/ecs/mvuser/MV_IPTel/data/HTTPSdata", "certfile": "/opt/ecs/mvuser/MV_IPTel/certs/IPTelcert.pem", "keyfile": "/opt/ecs/mvuser/MV_IPTel/certs/IPTelkey.pem", "clientauth": "0", "iptel": "0", "sslv2": "0", "sslv3": "0", "tlsv1": "1", "useproxy": "0", "proxyaddr": "simon.avaya.com", "proxyport": "9000"}, "BACKUP_SERVERS": {"fileserver": "0", "requestupdates": "0", "requestbackup": "0", "useprimarysvr": "0", "primaryip": "192.168.0.13", "usesecondarysvr": "0", "secondaryip": "192.168.0.10", "updateinterval": "2", "customftp": "1", "customftpdir": "home/mvuser/backup", "customftpuname": "tom", "customftppwd": "jerry", "cdrbackup": "0", "bcmsbackup": "0", "retaindays": "7.0"}, "SNMP": {"usesnmp": "1"}} diff --git a/tests/fixtures/generic/ini-test.ini b/tests/fixtures/generic/ini-test.ini new file mode 100644 index 00000000..3dd29875 --- /dev/null +++ b/tests/fixtures/generic/ini-test.ini @@ -0,0 +1,12 @@ +[DEFAULT] +ServerAliveInterval = 45 +Compression = yes +CompressionLevel = 9 +ForwardX11 = yes + +[bitbucket.org] +User = hg + +[topsecret.server.com] +Port = 50022 +ForwardX11 = no diff --git a/tests/fixtures/generic/ini-test.json b/tests/fixtures/generic/ini-test.json new file mode 100644 index 00000000..30d55804 --- /dev/null +++ b/tests/fixtures/generic/ini-test.json @@ -0,0 +1 @@ +{"bitbucket.org": {"serveraliveinterval": "45", "compression": "yes", "compressionlevel": "9", "forwardx11": "yes", "user": "hg"}, "topsecret.server.com": {"serveraliveinterval": "45", "compression": "yes", "compressionlevel": "9", "forwardx11": "no", "port": "50022"}} diff --git a/tests/fixtures/generic/xml-cd_catalog.json b/tests/fixtures/generic/xml-cd_catalog.json new file mode 100644 index 00000000..25091de8 --- /dev/null +++ b/tests/fixtures/generic/xml-cd_catalog.json @@ -0,0 +1 @@ +{"CATALOG": {"CD": [{"TITLE": "Empire Burlesque", "ARTIST": "Bob Dylan", "COUNTRY": "USA", "COMPANY": "Columbia", "PRICE": "10.90", "YEAR": "1985"}, {"TITLE": "Hide your heart", "ARTIST": "Bonnie Tyler", "COUNTRY": "UK", "COMPANY": "CBS Records", "PRICE": "9.90", "YEAR": "1988"}, {"TITLE": "Greatest Hits", "ARTIST": "Dolly Parton", "COUNTRY": "USA", "COMPANY": "RCA", "PRICE": "9.90", "YEAR": "1982"}, {"TITLE": "Still got the blues", "ARTIST": "Gary Moore", "COUNTRY": "UK", "COMPANY": "Virgin records", "PRICE": "10.20", "YEAR": "1990"}, {"TITLE": "Eros", "ARTIST": "Eros Ramazzotti", "COUNTRY": "EU", "COMPANY": "BMG", "PRICE": "9.90", "YEAR": "1997"}, {"TITLE": "One night only", "ARTIST": "Bee Gees", "COUNTRY": "UK", "COMPANY": "Polydor", "PRICE": "10.90", "YEAR": "1998"}, {"TITLE": "Sylvias Mother", "ARTIST": "Dr.Hook", "COUNTRY": "UK", "COMPANY": "CBS", "PRICE": "8.10", "YEAR": "1973"}, {"TITLE": "Maggie May", "ARTIST": "Rod Stewart", "COUNTRY": "UK", "COMPANY": "Pickwick", "PRICE": "8.50", "YEAR": "1990"}, {"TITLE": "Romanza", "ARTIST": "Andrea Bocelli", "COUNTRY": "EU", "COMPANY": "Polydor", "PRICE": "10.80", "YEAR": "1996"}, {"TITLE": "When a man loves a woman", "ARTIST": "Percy Sledge", "COUNTRY": "USA", "COMPANY": "Atlantic", "PRICE": "8.70", "YEAR": "1987"}, {"TITLE": "Black angel", "ARTIST": "Savage Rose", "COUNTRY": "EU", "COMPANY": "Mega", "PRICE": "10.90", "YEAR": "1995"}, {"TITLE": "1999 Grammy Nominees", "ARTIST": "Many", "COUNTRY": "USA", "COMPANY": "Grammy", "PRICE": "10.20", "YEAR": "1999"}, {"TITLE": "For the good times", "ARTIST": "Kenny Rogers", "COUNTRY": "UK", "COMPANY": "Mucik Master", "PRICE": "8.70", "YEAR": "1995"}, {"TITLE": "Big Willie style", "ARTIST": "Will Smith", "COUNTRY": "USA", "COMPANY": "Columbia", "PRICE": "9.90", "YEAR": "1997"}, {"TITLE": "Tupelo Honey", "ARTIST": "Van Morrison", "COUNTRY": "UK", "COMPANY": "Polydor", "PRICE": "8.20", "YEAR": "1971"}, {"TITLE": "Soulsville", "ARTIST": "Jorn Hoel", "COUNTRY": "Norway", "COMPANY": "WEA", "PRICE": "7.90", "YEAR": "1996"}, {"TITLE": "The very best of", "ARTIST": "Cat Stevens", "COUNTRY": "UK", "COMPANY": "Island", "PRICE": "8.90", "YEAR": "1990"}, {"TITLE": "Stop", "ARTIST": "Sam Brown", "COUNTRY": "UK", "COMPANY": "A and M", "PRICE": "8.90", "YEAR": "1988"}, {"TITLE": "Bridge of Spies", "ARTIST": "T'Pau", "COUNTRY": "UK", "COMPANY": "Siren", "PRICE": "7.90", "YEAR": "1987"}, {"TITLE": "Private Dancer", "ARTIST": "Tina Turner", "COUNTRY": "UK", "COMPANY": "Capitol", "PRICE": "8.90", "YEAR": "1983"}, {"TITLE": "Midt om natten", "ARTIST": "Kim Larsen", "COUNTRY": "EU", "COMPANY": "Medley", "PRICE": "7.80", "YEAR": "1983"}, {"TITLE": "Pavarotti Gala Concert", "ARTIST": "Luciano Pavarotti", "COUNTRY": "UK", "COMPANY": "DECCA", "PRICE": "9.90", "YEAR": "1991"}, {"TITLE": "The dock of the bay", "ARTIST": "Otis Redding", "COUNTRY": "USA", "COMPANY": "Stax Records", "PRICE": "7.90", "YEAR": "1968"}, {"TITLE": "Picture book", "ARTIST": "Simply Red", "COUNTRY": "EU", "COMPANY": "Elektra", "PRICE": "7.20", "YEAR": "1985"}, {"TITLE": "Red", "ARTIST": "The Communards", "COUNTRY": "UK", "COMPANY": "London", "PRICE": "7.80", "YEAR": "1987"}, {"TITLE": "Unchain my heart", "ARTIST": "Joe Cocker", "COUNTRY": "USA", "COMPANY": "EMI", "PRICE": "8.20", "YEAR": "1987"}]}} diff --git a/tests/fixtures/generic/xml-cd_catalog.xml b/tests/fixtures/generic/xml-cd_catalog.xml new file mode 100644 index 00000000..de15a6a5 --- /dev/null +++ b/tests/fixtures/generic/xml-cd_catalog.xml @@ -0,0 +1,211 @@ + + + + Empire Burlesque + Bob Dylan + USA + Columbia + 10.90 + 1985 + + + Hide your heart + Bonnie Tyler + UK + CBS Records + 9.90 + 1988 + + + Greatest Hits + Dolly Parton + USA + RCA + 9.90 + 1982 + + + Still got the blues + Gary Moore + UK + Virgin records + 10.20 + 1990 + + + Eros + Eros Ramazzotti + EU + BMG + 9.90 + 1997 + + + One night only + Bee Gees + UK + Polydor + 10.90 + 1998 + + + Sylvias Mother + Dr.Hook + UK + CBS + 8.10 + 1973 + + + Maggie May + Rod Stewart + UK + Pickwick + 8.50 + 1990 + + + Romanza + Andrea Bocelli + EU + Polydor + 10.80 + 1996 + + + When a man loves a woman + Percy Sledge + USA + Atlantic + 8.70 + 1987 + + + Black angel + Savage Rose + EU + Mega + 10.90 + 1995 + + + 1999 Grammy Nominees + Many + USA + Grammy + 10.20 + 1999 + + + For the good times + Kenny Rogers + UK + Mucik Master + 8.70 + 1995 + + + Big Willie style + Will Smith + USA + Columbia + 9.90 + 1997 + + + Tupelo Honey + Van Morrison + UK + Polydor + 8.20 + 1971 + + + Soulsville + Jorn Hoel + Norway + WEA + 7.90 + 1996 + + + The very best of + Cat Stevens + UK + Island + 8.90 + 1990 + + + Stop + Sam Brown + UK + A and M + 8.90 + 1988 + + + Bridge of Spies + T'Pau + UK + Siren + 7.90 + 1987 + + + Private Dancer + Tina Turner + UK + Capitol + 8.90 + 1983 + + + Midt om natten + Kim Larsen + EU + Medley + 7.80 + 1983 + + + Pavarotti Gala Concert + Luciano Pavarotti + UK + DECCA + 9.90 + 1991 + + + The dock of the bay + Otis Redding + USA + Stax Records + 7.90 + 1968 + + + Picture book + Simply Red + EU + Elektra + 7.20 + 1985 + + + Red + The Communards + UK + London + 7.80 + 1987 + + + Unchain my heart + Joe Cocker + USA + EMI + 8.20 + 1987 + + diff --git a/tests/fixtures/generic/xml-foodmenu.json b/tests/fixtures/generic/xml-foodmenu.json new file mode 100644 index 00000000..49216a65 --- /dev/null +++ b/tests/fixtures/generic/xml-foodmenu.json @@ -0,0 +1 @@ +{"breakfast_menu": {"food": [{"name": "Belgian Waffles", "price": "$5.95", "description": "Two of our famous Belgian Waffles with plenty of real maple syrup", "calories": "650"}, {"name": "Strawberry Belgian Waffles", "price": "$7.95", "description": "Light Belgian waffles covered with strawberries and whipped cream", "calories": "900"}, {"name": "Berry-Berry Belgian Waffles", "price": "$8.95", "description": "Light Belgian waffles covered with an assortment of fresh berries and whipped cream", "calories": "900"}, {"name": "French Toast", "price": "$4.50", "description": "Thick slices made from our homemade sourdough bread", "calories": "600"}, {"name": "Homestyle Breakfast", "price": "$6.95", "description": "Two eggs, bacon or sausage, toast, and our ever-popular hash browns", "calories": "950"}]}} diff --git a/tests/fixtures/generic/xml-foodmenu.xml b/tests/fixtures/generic/xml-foodmenu.xml new file mode 100644 index 00000000..d4db769c --- /dev/null +++ b/tests/fixtures/generic/xml-foodmenu.xml @@ -0,0 +1,33 @@ + + + + Belgian Waffles + $5.95 + Two of our famous Belgian Waffles with plenty of real maple syrup + 650 + + + Strawberry Belgian Waffles + $7.95 + Light Belgian waffles covered with strawberries and whipped cream + 900 + + + Berry-Berry Belgian Waffles + $8.95 + Light Belgian waffles covered with an assortment of fresh berries and whipped cream + 900 + + + French Toast + $4.50 + Thick slices made from our homemade sourdough bread + 600 + + + Homestyle Breakfast + $6.95 + Two eggs, bacon or sausage, toast, and our ever-popular hash browns + 950 + + diff --git a/tests/fixtures/generic/yaml-istio-sc.json b/tests/fixtures/generic/yaml-istio-sc.json new file mode 100644 index 00000000..206f88d8 --- /dev/null +++ b/tests/fixtures/generic/yaml-istio-sc.json @@ -0,0 +1 @@ +[{"apiVersion": "networking.istio.io/v1alpha3", "kind": "Sidecar", "metadata": {"name": "sidecar-config", "namespace": "default", "testboolean": true}, "spec": {"ingress": [{"port": {"number": 8080, "protocol": "HTTP", "name": "waf"}, "defaultEndpoint": "127.0.0.1:80", "captureMode": "IPTABLES"}], "egress": [{"hosts": ["*/*"]}]}}] diff --git a/tests/fixtures/generic/yaml-istio-sc.yaml b/tests/fixtures/generic/yaml-istio-sc.yaml new file mode 100644 index 00000000..cb148e5f --- /dev/null +++ b/tests/fixtures/generic/yaml-istio-sc.yaml @@ -0,0 +1,17 @@ +apiVersion: networking.istio.io/v1alpha3 +kind: Sidecar +metadata: + name: sidecar-config + namespace: default + testboolean: true +spec: + ingress: + - port: + number: 8080 + protocol: HTTP + name: waf + defaultEndpoint: 127.0.0.1:80 + captureMode: IPTABLES + egress: + - hosts: + - "*/*" diff --git a/tests/fixtures/generic/yaml-istio-sidecar.json b/tests/fixtures/generic/yaml-istio-sidecar.json new file mode 100644 index 00000000..e7ebd1b8 --- /dev/null +++ b/tests/fixtures/generic/yaml-istio-sidecar.json @@ -0,0 +1 @@ +[{"apiVersion": "v1", "kind": "ServiceAccount", "metadata": {"name": "www", "testboolean": true}}, {"apiVersion": "v1", "kind": "ServiceAccount", "metadata": {"name": "db", "testboolean": false}}, {"apiVersion": "v1", "kind": "ServiceAccount", "metadata": {"name": "auth"}}, {"apiVersion": "apps/v1", "kind": "Deployment", "metadata": {"name": "www"}, "spec": {"replicas": 3, "selector": {"matchLabels": {"app": "www"}}, "template": {"metadata": {"labels": {"app": "www", "version": "v1.0"}}, "spec": {"serviceAccountName": "www", "containers": [{"name": "modsecurity", "image": "owasp/modsecurity-crs:v3.2-modsec2-apache", "ports": [{"containerPort": 80}], "env": [{"name": "SETPROXY", "value": "True"}, {"name": "PROXYLOCATION", "value": "http://127.0.0.1:8080/"}]}, {"name": "microsimserver", "image": "kellybrazil/microsimserver", "ports": [{"containerPort": 8080}], "env": [{"name": "STATS_PORT", "value": "5000"}]}, {"name": "microsimclient", "image": "kellybrazil/microsimclient", "env": [{"name": "STATS_PORT", "value": "5001"}, {"name": "REQUEST_URLS", "value": "http://auth.default.svc.cluster.local:8080/,http://db.default.svc.cluster.local:8080/"}, {"name": "SEND_SQLI", "value": "True"}]}]}}}}, {"apiVersion": "apps/v1", "kind": "Deployment", "metadata": {"name": "auth"}, "spec": {"replicas": 3, "selector": {"matchLabels": {"app": "auth"}}, "template": {"metadata": {"labels": {"app": "auth", "version": "v1.0"}}, "spec": {"serviceAccountName": "auth", "containers": [{"name": "modsecurity", "image": "owasp/modsecurity-crs:v3.2-modsec2-apache", "ports": [{"containerPort": 80}], "env": [{"name": "SETPROXY", "value": "True"}, {"name": "PROXYLOCATION", "value": "http://127.0.0.1:8080/"}]}, {"name": "microsimserver", "image": "kellybrazil/microsimserver", "ports": [{"containerPort": 8080}], "env": [{"name": "STATS_PORT", "value": "5000"}]}]}}}}, {"apiVersion": "apps/v1", "kind": "Deployment", "metadata": {"name": "db"}, "spec": {"replicas": 3, "selector": {"matchLabels": {"app": "db"}}, "template": {"metadata": {"labels": {"app": "db", "version": "v1.0"}}, "spec": {"serviceAccountName": "db", "containers": [{"name": "modsecurity", "image": "owasp/modsecurity-crs:v3.2-modsec2-apache", "ports": [{"containerPort": 80}], "env": [{"name": "SETPROXY", "value": "True"}, {"name": "PROXYLOCATION", "value": "http://127.0.0.1:8080/"}]}, {"name": "microsimserver", "image": "kellybrazil/microsimserver", "ports": [{"containerPort": 8080}], "env": [{"name": "STATS_PORT", "value": "5000"}]}]}}}}, {"apiVersion": "v1", "kind": "Service", "metadata": {"labels": {"app": "www"}, "name": "www"}, "spec": {"ports": [{"port": 8080, "targetPort": 80, "name": "http"}], "selector": {"app": "www"}, "sessionAffinity": "None"}}, {"apiVersion": "v1", "kind": "Service", "metadata": {"labels": {"app": "auth"}, "name": "auth"}, "spec": {"ports": [{"port": 8080, "targetPort": 80, "name": "http"}], "selector": {"app": "auth"}, "sessionAffinity": "None"}}, {"apiVersion": "v1", "kind": "Service", "metadata": {"labels": {"app": "db"}, "name": "db"}, "spec": {"ports": [{"port": 8080, "targetPort": 80, "name": "http"}], "selector": {"app": "db"}, "sessionAffinity": "None"}}] diff --git a/tests/fixtures/generic/yaml-istio-sidecar.yaml b/tests/fixtures/generic/yaml-istio-sidecar.yaml new file mode 100644 index 00000000..9248ad14 --- /dev/null +++ b/tests/fixtures/generic/yaml-istio-sidecar.yaml @@ -0,0 +1,174 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: www + testboolean: true +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: db + testboolean: false +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: auth +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: www +spec: + replicas: 3 + selector: + matchLabels: + app: www + template: + metadata: + labels: + app: www + version: v1.0 # add version + spec: + serviceAccountName: www # add serviceAccountName + containers: + - name: modsecurity + image: owasp/modsecurity-crs:v3.2-modsec2-apache + ports: + - containerPort: 80 + env: + - name: SETPROXY + value: "True" + - name: PROXYLOCATION + value: "http://127.0.0.1:8080/" + - name: microsimserver + image: kellybrazil/microsimserver + ports: + - containerPort: 8080 # add microsimserver port + env: + - name: STATS_PORT + value: "5000" + - name: microsimclient + image: kellybrazil/microsimclient + env: + - name: STATS_PORT + value: "5001" + - name: REQUEST_URLS + value: "http://auth.default.svc.cluster.local:8080/,http://db.default.svc.cluster.local:8080/" + - name: SEND_SQLI + value: "True" +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: auth +spec: + replicas: 3 + selector: + matchLabels: + app: auth + template: + metadata: + labels: + app: auth + version: v1.0 # add version + spec: + serviceAccountName: auth # add serviceAccountName + containers: + - name: modsecurity + image: owasp/modsecurity-crs:v3.2-modsec2-apache + ports: + - containerPort: 80 + env: + - name: SETPROXY + value: "True" + - name: PROXYLOCATION + value: "http://127.0.0.1:8080/" + - name: microsimserver + image: kellybrazil/microsimserver + ports: + - containerPort: 8080 # add microsimserver port + env: + - name: STATS_PORT + value: "5000" +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: db +spec: + replicas: 3 + selector: + matchLabels: + app: db + template: + metadata: + labels: + app: db + version: v1.0 # add version + spec: + serviceAccountName: db # add serviceAccountName + containers: + - name: modsecurity + image: owasp/modsecurity-crs:v3.2-modsec2-apache + ports: + - containerPort: 80 + env: + - name: SETPROXY + value: "True" + - name: PROXYLOCATION + value: "http://127.0.0.1:8080/" + - name: microsimserver + image: kellybrazil/microsimserver + ports: + - containerPort: 8080 # add microsimserver port + env: + - name: STATS_PORT + value: "5000" +--- +apiVersion: v1 +kind: Service +metadata: + labels: + app: www + name: www +spec: + # externalTrafficPolicy: Local # remove externalTrafficPolicy + ports: + - port: 8080 + targetPort: 80 + name: http # add port name + selector: + app: www + sessionAffinity: None + # type: LoadBalancer # remove LoadBalancer type +--- +apiVersion: v1 +kind: Service +metadata: + labels: + app: auth + name: auth +spec: + ports: + - port: 8080 + targetPort: 80 + name: http # add port name + selector: + app: auth + sessionAffinity: None +--- +apiVersion: v1 +kind: Service +metadata: + labels: + app: db + name: db +spec: + ports: + - port: 8080 + targetPort: 80 + name: http # add port name + selector: + app: db + sessionAffinity: None \ No newline at end of file