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

GremlinNetworkAttackHelper hostname setter broken #66

Open
davebrown-exit107 opened this issue Dec 14, 2021 · 1 comment
Open

GremlinNetworkAttackHelper hostname setter broken #66

davebrown-exit107 opened this issue Dec 14, 2021 · 1 comment

Comments

@davebrown-exit107
Copy link

davebrown-exit107 commented Dec 14, 2021

When using children of GremlinNetworkAttackHelper (GremlinPacketLossAttack, GremlinLatencyAttack, GremlinBlackholeAttack), the hostnames parameter behaves in an unexpected manner when given a list.

In the general case of GremlinNetworkAttackHelper will return a list consisting of only the last element of the input list.

hostnames = [
            'www.gremlin.com',
            '^api.gremlin.com',
            ]
attack = GremlinNetworkAttackHelper(hostnames=hostnames)

expected: ['www.gremlin.com', '^api.gremlin.com'] (<class 'list'>)
actual attack.hostnames: ['^api.gremlin.com'] (<class 'list'>)

In more specific cases of actual attacks (e.g. GremlinPacketLossAttack), the same behavior shows up, except that the output of the api_model() call is a list of elements of the string that was the last element of the input list.

hostnames = [
            'www.gremlin.com',
            '^api.gremlin.com',
            ]
attack = GremlinNetworkAttackHelper(hostnames=hostnames)

expected: {'type': 'packet_loss', 'commandType': 'Packet Loss', 'args': ['-l', '60', '-r', '1', '-p', '^53', '-h', 'www.gremlin.com,^api.gremlin.com']}
actual attack.hostnames: {'type': 'packet_loss', 'commandType': 'Packet Loss', 'args': ['-l', '60', '-r', '1', '-p', '^53', '-h', '^,a,p,i,.,g,r,e,m,l,i,n,.,c,o,m']}

hostnames-list-example.py.txt

@pagbrl
Copy link
Contributor

pagbrl commented Jun 28, 2022

I believe [#73 ] will fix this problem

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 a pull request may close this issue.

2 participants