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

unit_test.py fails in blocks.dependencies() #47

Closed
jimmers opened this issue May 17, 2013 · 5 comments
Closed

unit_test.py fails in blocks.dependencies() #47

jimmers opened this issue May 17, 2013 · 5 comments

Comments

@jimmers
Copy link

jimmers commented May 17, 2013

C:\sulley_build\sulley>unit_test.py
PRIMITIVE MUTATION COUNTS (SIZES):
delim: 44 (3979)
string: 1078 (72904962)
byte: 112
word: 141
dword: 143
qword: 143
sizer: 143
Traceback (most recent call last):
File "C:\sulley_build\sulley\unit_test.py", line 5, in
unit_tests.blocks.run()
File "C:\sulley_build\sulley\unit_tests\blocks.py", line 5, in run
dependencies()
File "C:\sulley_build\sulley\unit_tests\blocks.py", line 89, in dependencies
assert(s_render().find("ONE") == -1)
AssertionError

@jimmers
Copy link
Author

jimmers commented May 20, 2013

Culprit:

Index: sulley/primitives.py

--- sulley/primitives.py (revision 147)
+++ sulley/primitives.py (revision 149)
@@ -199,7 +199,7 @@
self.original_value = self.values[0]
self.rendered = ""
self.fuzz_complete = False

  •    self.mutant_index   = 1      # XXX - should start mutating at 1, since the first item is the default. right?
    
  •    self.mutant_index   = 0
    

That comes from https://sulley.googlecode.com/svn/trunk

@Fitblip
Copy link
Member

Fitblip commented May 21, 2013

Are you using the most up-to-date version?

https://github.com/OpenRCE/sulley/blob/master/sulley/primitives.py

I see nowhere in here does a mutant_index get initialized with 1...

@jimmers
Copy link
Author

jimmers commented May 22, 2013

It is inited with zero and that breaks dependencies() test.

@Fitblip
Copy link
Member

Fitblip commented May 23, 2013

Hrm, that's odd. The unit tests were written long ago by someone else, so if you feel like fixing them, go for it?

I'm concentrating my effort on sulley V2, and since I'm the only dev on this (with limited time) I have to pick how I spend my time wisely.

I realize that's probably not what you like to hear after reporting a bug, but I believe this is a problem with the test itself, and not with the sulley codebase.

@SteveJM
Copy link
Contributor

SteveJM commented Jun 16, 2015

Ahhh, I had this and fixed it in pull request earlier today.
The test required a "s_mutate()" prior to the first assert.

Therefore this issue can now be closed.

@Fitblip Fitblip closed this as completed Jun 19, 2015
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

No branches or pull requests

3 participants