[GH-ISSUE #2019] Build a tool to create and execute test cases #1359

Closed
opened 2026-10-14 03:45:41 +07:00 by bsakaguchi · 5 comments
Owner

Originally created by @ghost on GitHub (Feb 3, 2016).
Original GitHub issue: https://github.com/openwall/john/issues/2019

Get some code from TS and build a tool that parses and execute test cases:

  1. read the test cases;
  2. for each test case, execute the commands requested;
  3. validate as TS does now: # of guesses ok, exit()=0, etc.

Examples:

<Prepare>
    ../run/john -form:cpu --list=format-tests | cut -f3 >alltests.in
    ../run/john --format=cpu --list=format-tests | cut -f4 > solution.dic
</Prepare>

<Clear>
    rm ../run/*.pot
</Clear>

<TestCases format=raw-SHA512-opencl>

<Case1 guesses=1>
../run/john alltests.in -form=raw-sha512-ng-opencl -mask=?u?u?uCAPS
</Case1>

<Case2 guesses=10>
../run/john alltests.in -form=raw-sha512-ng-opencl --wo:solution.dic
</Case2>
<TestCases>

<Execution>
  <Name=T1>
    DO=Prepare()
    DO=Clear()
    DO=Case1()
    DO=Case2()
  </Name>
</Execution>
Originally created by @ghost on GitHub (Feb 3, 2016). Original GitHub issue: https://github.com/openwall/john/issues/2019 Get some code from TS and build a tool that parses and execute test cases: 1. read the test cases; 2. for each test case, execute the commands requested; 3. validate as TS does now: # of guesses ok, exit()=0, etc. Examples: ``` <Prepare> ../run/john -form:cpu --list=format-tests | cut -f3 >alltests.in ../run/john --format=cpu --list=format-tests | cut -f4 > solution.dic </Prepare> <Clear> rm ../run/*.pot </Clear> <TestCases format=raw-SHA512-opencl> <Case1 guesses=1> ../run/john alltests.in -form=raw-sha512-ng-opencl -mask=?u?u?uCAPS </Case1> <Case2 guesses=10> ../run/john alltests.in -form=raw-sha512-ng-opencl --wo:solution.dic </Case2> <TestCases> <Execution> <Name=T1> DO=Prepare() DO=Clear() DO=Case1() DO=Case2() </Name> </Execution> ```
bsakaguchi 2026-10-14 03:45:41 +07:00
Author
Owner

@jfoug commented on GitHub (Feb 7, 2016):

and how is this different/better than ./jtrts.pl -internal ?

<!-- gh-comment-id:181026993 --> @jfoug commented on GitHub (Feb 7, 2016): and how is this different/better than `./jtrts.pl -internal` ?
Author
Owner

@ghost commented on GitHub (Feb 7, 2016):

I have to admit that I do not have a clear view of -internal. Anyway, I want to create test cases, to:

  • automate the check of reported errors/avoid regressions.
  • I would like to test if mask works: none, few and all cracked.
  • I would like to test --skip-self-test
  • I would like to test --min-len and --max-len
  • Etc.

The point is: I need to test. And I have to write these tests all the time.

<!-- gh-comment-id:181034885 --> @ghost commented on GitHub (Feb 7, 2016): I have to admit that I do not have a clear view of -internal. Anyway, I want to create test cases, to: - automate the check of reported errors/avoid regressions. - I would like to test if mask works: none, few and all cracked. - I would like to test --skip-self-test - I would like to test --min-len and --max-len - Etc. The point is: I need to test. And I have to write these tests all the time.
Author
Owner

@magnumripper commented on GitHub (Feb 7, 2016):

The best would be to add features to the TS.

<!-- gh-comment-id:181122215 --> @magnumripper commented on GitHub (Feb 7, 2016): The best would be to add features to the TS.
Author
Owner

@ghost commented on GitHub (Mar 6, 2016):

I probably will mess up things inside TS. So, I created a script just to keep tests saved.

I added it to /unused and will PR (to keep it saved and under VC)

<!-- gh-comment-id:193008499 --> @ghost commented on GitHub (Mar 6, 2016): I probably will mess up things inside TS. So, I created a script just to keep tests saved. I added it to /unused and will PR (to keep it saved and under VC)
Author
Owner

@ghost commented on GitHub (Mar 6, 2016):

3e455de886

<!-- gh-comment-id:193009019 --> @ghost commented on GitHub (Mar 6, 2016): 3e455de886d610520250fff3714134e4989e8692
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
openwall/john#1359
No description provided.