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

Need a test script #141

Open
flaviojs opened this issue Nov 7, 2023 · 1 comment
Open

Need a test script #141

flaviojs opened this issue Nov 7, 2023 · 1 comment

Comments

@flaviojs
Copy link
Contributor

flaviojs commented Nov 7, 2023

I don't use this software so I'm asking help from anyone that uses it.

Requirements of the script:

  • uses a regular dynamips executable (no extra code changes)
  • no gui or user interaction, to be executed from the console as part of automated tests (I'm in a 64-bit linux)
  • it must assert that a router capability worked (maybe send a packet from A to B?, starting up is not enough)

Optional, would be nice to have:

  • cleanup leftovers so the next run occurs in the same conditions
  • report the amount of clock time it took to complete the task
  • report the amount of cpu time it took to complete the task
  • report the amount of memory it needed to complete the task
  • use an easy-to-modify setup or language (like python)
  • minimize dependencies

Long story:

I'm playing around with rust in this project. After a few tries I arrived at a nice solution. I have access to the public structures and functions that the C code provides and can easily replace any C function with a rust function.

I make mistakes all the time, so I need a baseline test to avoid the accumulation of mistakes that comes with blind development. My focus/interest is the virtual hardware, which I want to experiment with, possibly complete or fix.

It sucks to see this project with security bugs, but I'm not gonna touch C code unless someone integrates Coverity Scan or similar into the CI (so I can see a list of bugs).
I find C to be very error-prone, I don't intend to repeat that frustrating development experience now that I know rust.

@flaviojs
Copy link
Contributor Author

flaviojs commented Oct 4, 2024

I tried a bunch of stuff while converting to rust and found a decent baseline test.
Only thing left is make a script to automate the test.

Non-hypervisor "can boot" test:

  1. run dynamips with options for a particular image and TCP console
  2. telnet to the TCP console and wait for either "bytes of NVRAM" or "bytes of processor board System flash"
  3. Result:
    3.a) PASS if the target text is found
    3.b) FAIL if dynamips crashes
    3.c) FAIL if telnet fails to connect X times
    3.d) FAIL if there is no telnet text during X time
    3.e) FAIL if IOS keeps rebooting

When the target text appears we know that:

  1. the microcode and cpu (jit/nojit) seem to work
  2. all the hardware that IOS can detect has been detected (memory,pci,eeprom,fpga,...) without crashing or rebooting
  3. the config file has not been read yet

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

1 participant