Skip to content

Commit

Permalink
Merge release v1.1.1 into main (#229)
Browse files Browse the repository at this point in the history
* Implement test orchestrator (#4)

* Initial work on test-orchestrator

* Ignore runtime folder

* Update runtime directory for test modules

* Fix logging
Add initial framework for running tests

* logging and misc cleanup

* logging changes

* Add a stop hook after all tests complete

* Refactor test_orc code

* Add arg passing
Add option to use locally cloned via install or remote via main project network orchestrator

* Fix baseline module
Fix orchestrator exiting only after timeout

* Add result file to baseline test module
Change result format to match closer to design doc

* Refactor pylint

* Skip test module if it failed to start

* Refactor

* Check for valid log level

---------

Co-authored-by: Jacob Boddey <[email protected]>

* Add issue report templates (#7)

* Add issue templates

* Update README.md

* Discover devices on the network (#5)

* Test run sync (#8)

* Initial work on test-orchestrator

* Ignore runtime folder

* Update runtime directory for test modules

* Fix logging
Add initial framework for running tests

* logging and misc cleanup

* logging changes

* Add a stop hook after all tests complete

* Refactor test_orc code

* Add arg passing
Add option to use locally cloned via install or remote via main project network orchestrator

* Fix baseline module
Fix orchestrator exiting only after timeout

* Add result file to baseline test module
Change result format to match closer to design doc

* Refactor pylint

* Skip test module if it failed to start

* Refactor

* Check for valid log level

* Add config file arg
Misc changes to network start procedure

* fix merge issues

* Update runner and test orch procedure
Add useful runtiem args

* Restructure test run startup process
Misc updates to work with net orch updates

* Refactor

---------

* Quick refactor (#9)

* Fix duplicate sleep calls

* Add net orc (#11)

* Add network orchestrator repository

* cleanup duplicate start and install scripts

* Temporary fix for python dependencies

* Remove duplicate python requirements

* remove duplicate conf files

* remove remote-net option

* cleanp unecessary files

* Add the DNS test module (#12)

* Add network orchestrator repository

* cleanup duplicate start and install scripts

* Temporary fix for python dependencies

* Remove duplicate python requirements

* remove duplicate conf files

* remove remote-net option

* cleanp unecessary files

* Add dns test module
Fix test module build process

* Add mac address of device under test to test container
Update dns test to use mac address filter

* Update dns module tests

* Change result output

* logging update

* Update test module for better reusability

* Load in module config to test module

* logging cleanup

* Update baseline module to new template
Misc cleanup

* Add ability to disable individual tests

* remove duplicate readme

* Update device directories

* Remove local folder

* Update device template
Update test module to work with new device config file format

* Change test module network config options
Do not start network services for modules not configured for network

* Refactor

---------

* Add baseline and pylint tests (#25)

* Discover devices on the network (#22)

* Discover devices on the network

* Add defaults when missing from config
Implement monitor wait period from config

* Add steady state monitor
Remove duplicate callback registrations

* Load devices into network orchestrator during testrun start

---------

Co-authored-by: jhughesbiot <[email protected]>

* Build dependencies first (#21)

* Build dependencies first

* Remove debug message

* Add depend on option to test modules

* Re-add single interface option

* Import subprocess

---------

Co-authored-by: jhughesbiot <[email protected]>

* Port scan test module (#23)

* Add network orchestrator repository

* cleanup duplicate start and install scripts

* Temporary fix for python dependencies

* Remove duplicate python requirements

* remove duplicate conf files

* remove remote-net option

* cleanp unecessary files

* Add dns test module
Fix test module build process

* Add mac address of device under test to test container
Update dns test to use mac address filter

* Update dns module tests

* Change result output

* logging update

* Update test module for better reusability

* Load in module config to test module

* logging cleanup

* Update baseline module to new template
Misc cleanup

* Add ability to disable individual tests

* remove duplicate readme

* Update device directories

* Remove local folder

* Update device template
Update test module to work with new device config file format

* Change test module network config options
Do not start network services for modules not configured for network

* Initial nmap test module add
Add device ip resolving to base module
Add network mounting for test modules

* Update ipv4 device resolving in test modules

* Map in ip subnets and remove hard coded references

* Add ftp port test

* Add ability to pass config for individual tests within a module
Update nmap module scan to run tests based on config

* Add full module check for compliance

* Add all tcp port scans to config

* Update nmap commands to match existing DAQ tests
Add udp scanning and tests

* logging cleanup

* Update TCP port scanning range
Update logging

* Merge device config into module config
Update device template

* fix merge issues

* Update timeouts
Add multi-threading for multiple scanns to run simultaneously
Add option to use scan scripts for services

* Fix merge issues

* Fix device configs

* Remove unecessary files

* Cleanup duplicate properties

* Cleanup install script

* Formatting (#26)

* Fix pylint issues in net orc

* more pylint fixes

* fix listener lint issues

* fix logger lint issues

* fix validator lint issues

* fix util lint issues

* Update base network module linting issues

* Cleanup linter issues for dhcp modules
Remove old code testing code

* change to single quote delimeter

* Cleanup linter issues for ntp module

* Cleanup linter issues for radius module

* Cleanup linter issues for template module

* fix linter issues with faux-dev

* Test results (#27)

* Collect all module test results

* Fix test modules without config options

* Add timestamp to test results

* Test results (#28)

* Collect all module test results

* Fix test modules without config options

* Add timestamp to test results

* Add attempt timing and device info to test results

* Ignore disabled test containers when generating results

* Fully skip modules that are disabled

* Fix pylint test and skip internet tests so CI passes (#29)

* disable internet checks for pass

* fix pylint test

* Increase pylint score (#31)

* More formatting fixes

* More formatting fixes

* More formatting fixes

* More formatting fixes

* Misc pylint fixes
Fix test module logger

---------

Co-authored-by: jhughesbiot <[email protected]>

* Pylint (#32)

* More formatting fixes

* More formatting fixes

* More formatting fixes

* More formatting fixes

* Misc pylint fixes
Fix test module logger

* remove unused files

* more formatting

* revert breaking pylint changes

* more formatting

* fix results file

* More formatting

* ovs module formatting

---------

Co-authored-by: Jacob Boddey <[email protected]>

* Add license header (#36)

* More formatting fixes

* More formatting fixes

* More formatting fixes

* More formatting fixes

* Misc pylint fixes
Fix test module logger

* remove unused files

* more formatting

* revert breaking pylint changes

* more formatting

* fix results file

* More formatting

* ovs module formatting

* Add ovs control into network orchestrator

* Add verification methods for the base network

* Add network validation and misc logging updates

* remove ovs module

* add license header to all python files

---------

Co-authored-by: Jacob Boddey <[email protected]>
Co-authored-by: SuperJonotron <[email protected]>

* Ovs (#35)

* More formatting fixes

* More formatting fixes

* More formatting fixes

* More formatting fixes

* Misc pylint fixes
Fix test module logger

* remove unused files

* more formatting

* revert breaking pylint changes

* more formatting

* fix results file

* More formatting

* ovs module formatting

* Add ovs control into network orchestrator

* Add verification methods for the base network

* Add network validation and misc logging updates

* remove ovs module

---------

Co-authored-by: Jacob Boddey <[email protected]>
Co-authored-by: SuperJonotron <[email protected]>

* remove ovs files added back in during merge

* Nmap (#38)

* More formatting fixes

* More formatting fixes

* More formatting fixes

* More formatting fixes

* Misc pylint fixes
Fix test module logger

* remove unused files

* more formatting

* revert breaking pylint changes

* more formatting

* fix results file

* More formatting

* ovs module formatting

* Add ovs control into network orchestrator

* Add verification methods for the base network

* Add network validation and misc logging updates

* remove ovs module

* add license header to all python files

* Update tcp scans to speed up full port range scan
Add version checking
Implement ssh version checking

* Add unknown port checks
Match unknown ports to existing services
Add unknown ports without existing services to results file

---------

Co-authored-by: Jacob Boddey <[email protected]>
Co-authored-by: SuperJonotron <[email protected]>

* Create startup capture (#37)

* Connection (#40)

* Initial add of connection test module with ping test

* Update host user resolving

* Update host user resolving for validator

* add get user method to validator

* Conn mac oui (#42)

* Initial add of connection test module with ping test

* Update host user resolving

* Update host user resolving for validator

* add get user method to validator

* Add mac_oui test
Add option to return test result and details of test for reporting

* Con mac address (#43)

* Initial add of connection test module with ping test

* Update host user resolving

* Update host user resolving for validator

* add get user method to validator

* Add mac_oui test
Add option to return test result and details of test for reporting

* Add connection.mac_address test

* Dns (#44)

* Add MDNS test

* Update existing mdns logging to be more consistent with other tests

* Add startup and monitor captures

* File permissions (#45)

* Fix validator file permissions

* Fix test module permissions

* Fix device capture file permissions

* Fix device results permissions

* Add connection single ip test (#47)

* Nmap results (#49)

* Update processing of nmap results to use xml output and json conversions for stability

* Update matching with regex to prevent wrong service matches and duplicate processing for partial matches

* Update max port scan range

* Framework restructure (#50)

* Restructure framework and modules

* Fix CI paths

* Fix base module

* Add build script

* Remove build logs

* Update base and template docker files to fit the new format
Implement a template option on network modules
Fix skipping of base image build

* remove base image build in ci

* Remove group from chown

---------

Co-authored-by: jhughesbiot <[email protected]>

* Ip control (#51)

* Add initial work for ip control module

* Implement ip control module with additional cleanup methods

* Update link check to not use error stream

* Add error checking around container network configurations

* Add network cleanup for namespaces and links

* formatting

* Move config to /local (#52)

* Move config to /local

* Fix testing config

* Fix ovs_control config location

* Fix faux dev config location

* Add documentation (#53)

* Sync dev to main (#56)

* Merge dev into main (Sprint 7 and 8) (#33)

* Implement test orchestrator (#4)

* Initial work on test-orchestrator

* Ignore runtime folder

* Update runtime directory for test modules

* Fix logging
Add initial framework for running tests

* logging and misc cleanup

* logging changes

* Add a stop hook after all tests complete

* Refactor test_orc code

* Add arg passing
Add option to use locally cloned via install or remote via main project network orchestrator

* Fix baseline module
Fix orchestrator exiting only after timeout

* Add result file to baseline test module
Change result format to match closer to design doc

* Refactor pylint

* Skip test module if it failed to start

* Refactor

* Check for valid log level

---------

Co-authored-by: Jacob Boddey <[email protected]>

* Add issue report templates (#7)

* Add issue templates

* Update README.md

* Discover devices on the network (#5)

* Test run sync (#8)

* Initial work on test-orchestrator

* Ignore runtime folder

* Update runtime directory for test modules

* Fix logging
Add initial framework for running tests

* logging and misc cleanup

* logging changes

* Add a stop hook after all tests complete

* Refactor test_orc code

* Add arg passing
Add option to use locally cloned via install or remote via main project network orchestrator

* Fix baseline module
Fix orchestrator exiting only after timeout

* Add result file to baseline test module
Change result format to match closer to design doc

* Refactor pylint

* Skip test module if it failed to start

* Refactor

* Check for valid log level

* Add config file arg
Misc changes to network start procedure

* fix merge issues

* Update runner and test orch procedure
Add useful runtiem args

* Restructure test run startup process
Misc updates to work with net orch updates

* Refactor

---------

* Quick refactor (#9)

* Fix duplicate sleep calls

* Add net orc (#11)

* Add network orchestrator repository

* cleanup duplicate start and install scripts

* Temporary fix for python dependencies

* Remove duplicate python requirements

* remove duplicate conf files

* remove remote-net option

* cleanp unecessary files

* Add the DNS test module (#12)

* Add network orchestrator repository

* cleanup duplicate start and install scripts

* Temporary fix for python dependencies

* Remove duplicate python requirements

* remove duplicate conf files

* remove remote-net option

* cleanp unecessary files

* Add dns test module
Fix test module build process

* Add mac address of device under test to test container
Update dns test to use mac address filter

* Update dns module tests

* Change result output

* logging update

* Update test module for better reusability

* Load in module config to test module

* logging cleanup

* Update baseline module to new template
Misc cleanup

* Add ability to disable individual tests

* remove duplicate readme

* Update device directories

* Remove local folder

* Update device template
Update test module to work with new device config file format

* Change test module network config options
Do not start network services for modules not configured for network

* Refactor

---------

* Add baseline and pylint tests (#25)

* Discover devices on the network (#22)

* Discover devices on the network

* Add defaults when missing from config
Implement monitor wait period from config

* Add steady state monitor
Remove duplicate callback registrations

* Load devices into network orchestrator during testrun start

---------

Co-authored-by: jhughesbiot <[email protected]>

* Build dependencies first (#21)

* Build dependencies first

* Remove debug message

* Add depend on option to test modules

* Re-add single interface option

* Import subprocess

---------

Co-authored-by: jhughesbiot <[email protected]>

* Port scan test module (#23)

* Add network orchestrator repository

* cleanup duplicate start and install scripts

* Temporary fix for python dependencies

* Remove duplicate python requirements

* remove duplicate conf files

* remove remote-net option

* cleanp unecessary files

* Add dns test module
Fix test module build process

* Add mac address of device under test to test container
Update dns test to use mac address filter

* Update dns module tests

* Change result output

* logging update

* Update test module for better reusability

* Load in module config to test module

* logging cleanup

* Update baseline module to new template
Misc cleanup

* Add ability to disable individual tests

* remove duplicate readme

* Update device directories

* Remove local folder

* Update device template
Update test module to work with new device config file format

* Change test module network config options
Do not start network services for modules not configured for network

* Initial nmap test module add
Add device ip resolving to base module
Add network mounting for test modules

* Update ipv4 device resolving in test modules

* Map in ip subnets and remove hard coded references

* Add ftp port test

* Add ability to pass config for individual tests within a module
Update nmap module scan to run tests based on config

* Add full module check for compliance

* Add all tcp port scans to config

* Update nmap commands to match existing DAQ tests
Add udp scanning and tests

* logging cleanup

* Update TCP port scanning range
Update logging

* Merge device config into module config
Update device template

* fix merge issues

* Update timeouts
Add multi-threading for multiple scanns to run simultaneously
Add option to use scan scripts for services

* Fix merge issues

* Fix device configs

* Remove unecessary files

* Cleanup duplicate properties

* Cleanup install script

* Formatting (#26)

* Fix pylint issues in net orc

* more pylint fixes

* fix listener lint issues

* fix logger lint issues

* fix validator lint issues

* fix util lint issues

* Update base network module linting issues

* Cleanup linter issues for dhcp modules
Remove old code testing code

* change to single quote delimeter

* Cleanup linter issues for ntp module

* Cleanup linter issues for radius module

* Cleanup linter issues for template module

* fix linter issues with faux-dev

* Test results (#27)

* Collect all module test results

* Fix test modules without config options

* Add timestamp to test results

* Test results (#28)

* Collect all module test results

* Fix test modules without config options

* Add timestamp to test results

* Add attempt timing and device info to test results

* Ignore disabled test containers when generating results

* Fully skip modules that are disabled

* Fix pylint test and skip internet tests so CI passes (#29)

* disable internet checks for pass

* fix pylint test

* Increase pylint score (#31)

* More formatting fixes

* More formatting fixes

* More formatting fixes

* More formatting fixes

* Misc pylint fixes
Fix test module logger

---------

Co-authored-by: jhughesbiot <[email protected]>

* Pylint (#32)

* More formatting fixes

* More formatting fixes

* More formatting fixes

* More formatting fixes

* Misc pylint fixes
Fix test module logger

* remove unused files

* more formatting

* revert breaking pylint changes

* more formatting

* fix results file

* More formatting

* ovs module formatting

---------

Co-authored-by: Jacob Boddey <[email protected]>

* Add license header (#36)

* More formatting fixes

* More formatting fixes

* More formatting fixes

* More formatting fixes

* Misc pylint fixes
Fix test module logger

* remove unused files

* more formatting

* revert breaking pylint changes

* more formatting

* fix results file

* More formatting

* ovs module formatting

* Add ovs control into network orchestrator

* Add verification methods for the base network

* Add network validation and misc logging updates

* remove ovs module

* add license header to all python files

---------

Co-authored-by: Jacob Boddey <[email protected]>
Co-authored-by: SuperJonotron <[email protected]>

* Ovs (#35)

* More formatting fixes

* More formatting fixes

* More formatting fixes

* More formatting fixes

* Misc pylint fixes
Fix test module logger

* remove unused files

* more formatting

* revert breaking pylint changes

* more formatting

* fix results file

* More formatting

* ovs module formatting

* Add ovs control into network orchestrator

* Add verification methods for the base network

* Add network validation and misc logging updates

* remove ovs module

---------

Co-authored-by: Jacob Boddey <[email protected]>
Co-authored-by: SuperJonotron <[email protected]>

* remove ovs files added back in during merge

* Nmap (#38)

* More formatting fixes

* More formatting fixes

* More formatting fixes

* More formatting fixes

* Misc pylint fixes
Fix test module logger

* remove unused files

* more formatting

* revert breaking pylint changes

* more formatting

* fix results file

* More formatting

* ovs module formatting

* Add ovs control into network orchestrator

* Add verification methods for the base network

* Add network validation and misc logging updates

* remove ovs module

* add license header to all python files

* Update tcp scans to speed up full port range scan
Add version checking
Implement ssh version checking

* Add unknown port checks
Match unknown ports to existing services
Add unknown ports without existing services to results file

---------

Co-authored-by: Jacob Boddey <[email protected]>
Co-authored-by: SuperJonotron <[email protected]>

* Create startup capture (#37)

* Connection (#40)

* Initial add of connection test module with ping test

* Update host user resolving

* Update host user resolving for validator

* add get user method to validator

* Conn mac oui (#42)

* Initial add of connection test module with ping test

* Update host user resolving

* Update host user resolving for validator

* add get user method to validator

* Add mac_oui test
Add option to return test result and details of test for reporting

* Con mac address (#43)

* Initial add of connection test module with ping test

* Update host user resolving

* Update host user resolving for validator

* add get user method to validator

* Add mac_oui test
Add option to return test result and details of test for reporting

* Add connection.mac_address test

* Dns (#44)

* Add MDNS test

* Update existing mdns logging to be more consistent with other tests

* Add startup and monitor captures

* File permissions (#45)

* Fix validator file permissions

* Fix test module permissions

* Fix device capture file permissions

* Fix device results permissions

* Add connection single ip test (#47)

* Nmap results (#49)

* Update processing of nmap results to use xml output and json conversions for stability

* Update matching with regex to prevent wrong service matches and duplicate processing for partial matches

* Update max port scan range

* Framework restructure (#50)

* Restructure framework and modules

* Fix CI paths

* Fix base module

* Add build script

* Remove build logs

* Update base and template docker files to fit the new format
Implement a template option on network modules
Fix skipping of base image build

* remove base image build in ci

* Remove group from chown

---------

Co-authored-by: jhughesbiot <[email protected]>

* Ip control (#51)

* Add initial work for ip control module

* Implement ip control module with additional cleanup methods

* Update link check to not use error stream

* Add error checking around container network configurations

* Add network cleanup for namespaces and links

* formatting

* Move config to /local (#52)

* Move config to /local

* Fix testing config

* Fix ovs_control config location

* Fix faux dev config location

* Add documentation (#53)

---------

Co-authored-by: jhughesbiot <[email protected]>
Co-authored-by: jhughesbiot <[email protected]>
Co-authored-by: Noureddine <[email protected]>
Co-authored-by: SuperJonotron <[email protected]>

* Sprint 8 Hotfix (#54)

* Fix connection results.json

* Re add try/catch

* Fix log level

* Debug test module load order

* Add depends on to nmap module

* Remove logging change

---------

Co-authored-by: jhughesbiot <[email protected]>
Co-authored-by: jhughesbiot <[email protected]>
Co-authored-by: Noureddine <[email protected]>
Co-authored-by: SuperJonotron <[email protected]>

* Fix missing results on udp tests when tcp ports are also defined (#59)

* Add licence header (#61)

* Resolve merge conflict

* Add network docs (#63)

* Add network docs

* Rename to readme

* Add link to template module

* Dhcp (#64)

* Add initial work for ip control module

* Implement ip control module with additional cleanup methods

* Update link check to not use error stream

* Add error checking around container network configurations

* Add network cleanup for namespaces and links

* formatting

* initial work on adding grpc functions for dhcp tests

* rework code to allow for better usage and unit testing

* working poc for test containers and grpc client to dhcp-1

* Move grpc client code into base image

* Move grpc proto builds outside of dockerfile into module startup script

* Setup pythonpath var in test module base startup process
misc cleanup

* pylinting and logging updates

* Add python path resolving to network modules
Update grpc path to prevent conflicts
misc pylinting

* Change lease resolving method to fix pylint issue

* cleanup unit tests

* cleanup unit tests

* Add grpc updates to dhcp2 module
Update dhcp_config to deal with missing optional variables

* Add grpc updates to dhcp2 module
Update dhcp_config to deal with missing optional variables

* fix line endings

* misc cleanup

* Dhcp (#67)

* Add initial work for ip control module

* Implement ip control module with additional cleanup methods

* Update link check to not use error stream

* Add error checking around container network configurations

* Add network cleanup for namespaces and links

* formatting

* initial work on adding grpc functions for dhcp tests

* rework code to allow for better usage and unit testing

* working poc for test containers and grpc client to dhcp-1

* Move grpc client code into base image

* Move grpc proto builds outside of dockerfile into module startup script

* Setup pythonpath var in test module base startup process
misc cleanup

* pylinting and logging updates

* Add python path resolving to network modules
Update grpc path to prevent conflicts
misc pylinting

* Change lease resolving method to fix pylint issue

* cleanup unit tests

* cleanup unit tests

* Add grpc updates to dhcp2 module
Update dhcp_config to deal with missing optional variables

* Add grpc updates to dhcp2 module
Update dhcp_config to deal with missing optional variables

* fix line endings

* misc cleanup

* Move isc-dhcp-server and radvd to services
Move DHCP server monitoring and booting to python script

* Add grpc methods to interact with dhcp_server module
Update dhcp_server to control radvd server directly from calls
Fix radvd service status method

* Add updates to dhcp2 module
Update radvd service

* Add license headers

* Add connection.dhcp_address test (#68)

* Add NTP tests (#60)

* Add ntp support test

* Add extra log message

* Modify descriptions

* Pylint

* Pylint (#69)

---------

Co-authored-by: jhughesbiot <[email protected]>

* Add ipv6 tests (#65)

* Add ipv6 tests

* Check for ND_NS

* Connection private address (#71)

* Add ntp support test

* Add extra log message

* Modify descriptions

* Pylint

* formatting

* Change isc-dhcp service setup
Fix dhcpd logging
Add start and stop methods to grpc dhcp client
Add dhcp2 client
Inttial private_addr test

* Add max lease time
Add unit tests

* fix last commit

* finish initial work on test

* pylinting

* Breakup test and allow better failure reporting

* restore network after test

* Wait for device to get a lease from original dhcp range after network restore

* pylinting

* Fix ipv6 tests

---------

Co-authored-by: Jacob Boddey <[email protected]>

* fix windows line ending

* Fix python import

* move isc-dhcp service commands to their own class
update logging
pylinting

* fix dhcp1

* Initial CI testing for tests (#72)

* Fix radvd conf

* Fix individual test disable

* Add NTP Pass CI test (#76)

* add shared address test (#75)

* Fix single ip test (#58)

* Fix single ip test from detecting faux-device during validation as a failure

* remove dhcp server capture file from scan

---------

Co-authored-by: J Boddey <[email protected]>

* Merge API into dev (#70)

* Start API

* Write interfaces

* Get current configuration

* Set versions

* Add more API methods

* Correct no-ui flag

* Do not launch API on baseline test

* Move loading devices back to Test Run core

* Merge dev into api (#74)

* Merge dev into main (Add license header) (#62)

Add license header

* Add network docs (#63)

* Add network docs

* Rename to readme

* Add link to template module

* Dhcp (#64)

* Add initial work for ip control module

* Implement ip control module with additional cleanup methods

* Update link check to not use error stream

* Add error checking around container network configurations

* Add network cleanup for namespaces and links

* formatting

* initial work on adding grpc functions for dhcp tests

* rework code to allow for better usage and unit testing

* working poc for test containers and grpc client to dhcp-1

* Move grpc client code into base image

* Move grpc proto builds outside of dockerfile into module startup script

* Setup pythonpath var in test module base startup process
misc cleanup

* pylinting and logging updates

* Add python path resolving to network modules
Update grpc path to prevent conflicts
misc pylinting

* Change lease resolving method to fix pylint issue

* cleanup unit tests

* cleanup unit tests

* Add grpc updates to dhcp2 module
Update dhcp_config to deal with missing optional variables

* Add grpc updates to dhcp2 module
Update dhcp_config to deal with missing optional variables

* fix line endings

* misc cleanup

* Dhcp (#67)

* Add initial work for ip control module

* Implement ip control module with additional cleanup methods

* Update link check to not use error stream

* Add error checking around container network configurations

* Add network cleanup for namespaces and links

* formatting

* initial work on adding grpc functions for dhcp tests

* rework code to allow for better usage and unit testing

* working poc for test containers and grpc client to dhcp-1

* Move grpc client code into base image

* Move grpc proto builds outside of dockerfile into module startup script

* Setup pythonpath var in test module base startup process
misc cleanup

* pylinting and logging updates

* Add python path resolving to network modules
Update grpc path to prevent conflicts
misc pylinting

* Change lease resolving method to fix pylint issue

* cleanup unit tests

* cleanup unit tests

* Add grpc updates to dhcp2 module
Update dhcp_config to deal with missing optional variables

* Add grpc updates to dhcp2 module
Update dhcp_config to deal with missing optional variables

* fix line endings

* misc cleanup

* Move isc-dhcp-server and radvd to services
Move DHCP server monitoring and booting to python script

* Add grpc methods to interact with dhcp_server module
Update dhcp_server to control radvd server directly from calls
Fix radvd service status method

* Add updates to dhcp2 module
Update radvd service

* Add license headers

* Add connection.dhcp_address test (#68)

* Add NTP tests (#60)

* Add ntp support test

* Add extra log message

* Modify descriptions

* Pylint

* Pylint (#69)

---------

Co-authored-by: jhughesbiot <[email protected]>

* Add ipv6 tests (#65)

* Add ipv6 tests

* Check for ND_NS

* Merge dev into main (Sprint 9) (#66)

* Implement test orchestrator (#4)

* Initial work on test-orchestrator

* Ignore runtime folder

* Update runtime directory for test modules

* Fix logging
Add initial framework for running tests

* logging and misc cleanup

* logging changes

* Add a stop hook after all tests complete

* Refactor test_orc code

* Add arg passing
Add option to use locally cloned via install or remote via main project network orchestrator

* Fix baseline module
Fix orchestrator exiting only after timeout

* Add result file to baseline test module
Change result format to match closer to design doc

* Refactor pylint

* Skip test module if it failed to start

* Refactor

* Check for valid log level

---------

Co-authored-by: Jacob Boddey <[email protected]>

* Add issue report templates (#7)

* Add issue templates

* Update README.md

* Discover devices on the network (#5)

* Test run sync (#8)

* Initial work on test-orchestrator

* Ignore runtime folder

* Update runtime directory for test modules

* Fix logging
Add initial framework for running tests

* logging and misc cleanup

* logging changes

* Add a stop hook after all tests complete

* Refactor test_orc code

* Add arg passing
Add option to use locally cloned via install or remote via main project network orchestrator

* Fix baseline module
Fix orchestrator exiting only after timeout

* Add result file to baseline test module
Change result format to match closer to design doc

* Refactor pylint

* Skip test module if it failed to start

* Refactor

* Check for valid log level

* Add config file arg
Misc changes to network start procedure

* fix merge issues

* Update runner and test orch procedure
Add useful runtiem args

* Restructure test run startup process
Misc updates to work with net orch updates

* Refactor

---------

* Quick refactor (#9)

* Fix duplicate sleep calls

* Add net orc (#11)

* Add network orchestrator repository

* cleanup duplicate start and install scripts

* Temporary fix for python dependencies

* Remove duplicate python requirements

* remove duplicate conf files

* remove remote-net option

* cleanp unecessary files

* Add the DNS test module (#12)

* Add network orchestrator repository

* cleanup duplicate start and install scripts

* Temporary fix for python dependencies

* Remove duplicate python requirements

* remove duplicate conf files

* remove remote-net option

* cleanp unecessary files

* Add dns test module
Fix test module build process

* Add mac address of device under test to test container
Update dns test to use mac address filter

* Update dns module tests

* Change result output

* logging update

* Update test module for better reusability

* Load in module config to test module

* logging cleanup

* Update baseline module to new template
Misc cleanup

* Add ability to disable individual tests

* remove duplicate readme

* Update device directories

* Remove local folder

* Update device template
Update test module to work with new device config file format

* Change test module network config options
Do not start network services for modules not configured for network

* Refactor

---------

* Add baseline and pylint tests (#25)

* Discover devices on the network (#22)

* Discover devices on the network

* Add defaults when missing from config
Implement monitor wait period from config

* Add steady state monitor
Remove duplicate callback registrations

* Load devices into network orchestrator during testrun start

---------

Co-authored-by: jhughesbiot <[email protected]>

* Build dependencies first (#21)

* Build dependencies first

* Remove debug message

* Add depend on option to test modules

* Re-add single interface option

* Import subprocess

---------

Co-authored-by: jhughesbiot <[email protected]>

* Port scan test module (#23)

* Add network orchestrator repository

* cleanup duplicate start and install scripts

* Temporary fix for python dependencies

* Remove duplicate python requirements

* remove duplicate conf files

* remove remote-net option

* cleanp unecessary files

* Add dns test module
Fix test module build process

* Add mac address of device under test to test container
Update dns test to use mac address filter

* Update dns module tests

* Change result output

* logging update

* Update test module for better reusability

* Load in module config to test module

* logging cleanup

* Update baseline module to new template
Misc cleanup

* Add ability to disable individual tests

* remove duplicate readme

* Update device directories

* Remove local folder

* Update device template
Update test module to work with new device config file format

* Change test module network config options
Do not start network services for modules not configured for network

* Initial nmap test module add
Add device ip resolving to base module
Add network mounting for test modules

* Update ipv4 device resolving in test modules

* Map in ip subnets and remove hard coded references

* Add ftp port test

* Add ability to pass config for individual tests within a module
Update nmap module scan to run tests based on config

* Add full module check for compliance

* Add all tcp port scans to config

* Update nmap commands to match existing DAQ tests
Add udp scanning and tests

* logging cleanup

* Update TCP port scanning range
Update logging

* Merge device config into module config
Update device template

* fix merge issues

* Update timeouts
Add multi-threading for multiple scanns to run simultaneously
Add option to use scan scripts for services

* Fix merge issues

* Fix device configs

* Remove unecessary files

* Cleanup duplicate properties

* Cleanup install script

* Formatting (#26)

* Fix pylint issues in net orc

* more pylint fixes

* fix listener lint issues

* fix logger lint issues

* fix validator lint issues

* fix util lint issues

* Update base network module linting issues

* Cleanup linter issues for dhcp modules
Remove old code testing code

* change to single quote delimeter

* Cleanup linter issues for ntp module

* Cleanup linter issues for radius module

* Cleanup linter issues for template module

* fix linter issues with faux-dev

* Test results (#27)

* Collect all module test results

* Fix test modules without config options

* Add timestamp to test results

* Test results (#28)

* Collect all module test results

* Fix test modules without config options

* Add timestamp to test results

* Add attempt timing and device info to test results

* Ignore disabled test containers when generating results

* Fully skip modules that are disabled

* Fix pylint test and skip internet tests so CI passes (#29)

* disable internet checks for pass

* fix pylint test

* Increase pylint score (#31)

* More formatting fixes

* More formatting fixes

* More formatting fixes

* More formatting fixes

* Misc pylint fixes
Fix test module logger

---------

Co-authored-by: jhughesbiot <[email protected]>

* Pylint (#32)

* More formatting fixes

* More formatting fixes

* More formatting fixes

* More formatting fixes

* Misc pylint fixes
Fix test module logger

* remove unused files

* more formatting

* revert breaking pylint changes

* more formatting

* fix results file

* More formatting

* ovs module formatting

---------

Co-authored-by: Jacob Boddey <[email protected]>

* Add license header (#36)

* More formatting fixes

* More formatting fixes

* More formatting fixes

* More formatting fixes

* Misc pylint fixes
Fix test module logger

* remove unused files

* more formatting

* revert breaking pylint changes

* more formatting

* fix results file

* More formatting

* ovs module formatting

* Add ovs control into network orchestrator

* Add verification methods for the base network

* Add network validation and misc logging updates

* remove ovs module

* add license header to all python files

---------

Co-authored-by: Jacob Boddey <[email protected]>
Co-authored-by: SuperJonotron <[email protected]>

* Ovs (#35)

* More formatting fixes

* More formatting fixes

* More formatting fixes

* More formatting fixes

* Misc pylint fixes
Fix test module logger

* remove unused files

* more formatting

* revert breaking pylint changes

* more formatting

* fix results file

* More formatting

* ovs module formatting

* Add ovs control into network orchestrator

* Add verification methods for the base network

* Add network validation and misc logging updates

* remove ovs module

---------

Co-authored-by: Jacob Boddey <[email protected]>
Co-authored-by: SuperJonotron <[email protected]>

* remove ovs files added back in during merge

* Nmap (#38)

* More formatting fixes

* More formatting fixes

* More formatting fixes

* More formatting fixes

* Misc pylint fixes
Fix test module logger

* remove unused files

* more formatting

* revert breaking pylint changes

* more formatting

* fix results file

* More formatting

* ovs module formatting

* Add ovs control into network orchestrator

* Add verification methods for the base network

* Add network validation and misc logging updates

* remove ovs module

* add license header to all python files

* Update tcp scans to speed up full port range scan
Add version checking
Implement ssh version checking

* Add unknown port checks
Match unknown ports to existing services
Add unknown ports without existing services to results file

---------

Co-authored-by: Jacob Boddey <[email protected]>
Co-authored-by: SuperJonotron <[email protected]>

* Create startup capture (#37)

* Connection (#40)

* Initial add of connection test module with ping test

* Update host user resolving

* Update host user resolving for validator

* add get user method to validator

* Conn mac oui (#42)

* Initial add of connection test module with ping test

* Update host user resolving

* Update host user resolving for validator

* add get user method to validator

* Add mac_oui test
Add option to return test result and details of test for reporting

* Con mac address (#43)

* Initial add of connection test module with ping test

* Update host user resolving

* Update host user resolving for validator

* add get user method to validator

* Add mac_oui test
Add option to return test result and details of test for reporting

* Add connection.mac_address test

* Dns (#44)

* Add MDNS test

* Update existing mdns logging to be more consistent with other tests

* Add startup and monitor captures

* File permissions (#45)

* Fix validator file permissions

* Fix test module permissions

* Fix device capture file permissions

* Fix device results permissions

* Add connection single ip test (#47)

* Nmap results (#49)

* Update processing of nmap results to use xml output and json conversions for stability

* Update matching with regex to prevent wrong service matches and duplicate processing for partial matches

* Update max port scan range

* Framework restructure (#50)

* Restructure framework and modules

* Fix CI paths

* Fix base module

* Add build script

* Remove build logs

* Update base and template docker files to fit the new format
Implement a template option on network modules
Fix skipping of base image build

* remove base image build in ci

* Remove group from chown

---------

Co-authored-by: jhughesbiot <[email protected]>

* Ip control (#51)

* Add initial work for ip control module

* Implement ip control module with additional cleanup methods

* Update link check to not use error stream

* Add error checking around container network configurations

* Add network cleanup for namespaces and links

* formatting

* Move config to /local (#52)

* Move config to /local

* Fix testing config

* Fix ovs_control config location

* Fix faux dev config location

* Add documentation (#53)

* Sync dev to main (#56)

* Merge dev into main (Sprint 7 and 8) (#33)

* Implement test orchestrator (#4)

* Initial work on test-orchestrator

* Ignore runtime folder

* Update runtime directory for test modules

* Fix logging
Add initial framework for running tests

* logging and misc cleanup

* logging changes

* Add a stop hook after all tests complete

* Refactor test_orc code

* Add arg passing
Add option to use locally cloned via install or remote via main project network orchestrator

* Fix baseline module
Fix orchestrator exiting only after timeout

* Add result file to baseline test module
Change result format to match closer to design doc

* Refactor pylint

* Skip test module if it failed to start

* Refactor

* Check for valid log level

---------

Co-authored-by: Jacob Boddey <[email protected]>

* Add issue report templates (#7)

* Add issue templates

* Update README.md

* Discover devices on the network (#5)

* Test run sync (#8)

* Initial work on test-orchestrator

* Ignore runtime folder

* Update runtime directory for test modules

* Fix logging
Add initial framework for running tests

* logging and misc cleanup

* logging changes

* Add a stop hook after all tests complete

* Refactor test_orc code

* Add arg passing
Add option to use locally cloned via install or remote via main project network orchestrator

* Fix baseline module
Fix orchestrator exiting only after timeout

* Add result file to baseline test module
Change result format to match closer to design doc

* Refactor pylint

* Skip test module if it failed to start

* Refactor

* Check for valid log level

* Add config file arg
Misc changes to network start procedure

* fix merge issues

* Update runner and test orch procedure
Add useful runtiem args

* Restructure test run startup process
Misc updates to work with net orch updates

* Refactor

---------

* Quick refactor (#9)

* Fix duplicate sleep calls

* Add net orc (#11)

* Add network orchestrator repository

* cleanup duplicate start and install scripts

* Temporary fix for python dependencies

* Remove duplicate python requirements

* remove duplicate conf files

* remove remote-net option

* cleanp unecessary files

* Add the DNS test module (#12)

* Add network orchestrator repository

* cleanup duplicate start and install scripts

* Temporary fix for python dependencies

* Remove duplicate python requirements

* remove duplicate conf files

* remove remote-net option

* cleanp unecessary files

* Add dns test module
Fix test module build process

* Add mac address of device under test to test container
Update dns test to use mac address filter

* Update dns module tests

* Change result output

* logging update

* Update test module for better reusability

* Load in module config to test module

* logging cleanup

* Update baseline module to new template
Misc cleanup

* Add ability to disable individual tests

* remove duplicate readme

* Update device directories

* Remove local folder

* Update device template
Update test module to work with new device config file format

* Change test module network config options
Do not start network services for modules not configured for network

* Refactor

---------

* Add baseline and pylint tests (#25)

* Discover devices on the network (#22)

* Discover devices on the network

* Add defaults when missing from config
Implement monitor wait period from config

* Add steady state monitor
Remove duplicate callback registrations

* Load devices into network orchestrator during testrun start

---------

Co-authored-by: jhughesbiot <[email protected]>

* Build dependencies first (#21)

* Build dependencies first

* Remove debug message

* Add depend on option to test modules

* Re-add single interface option

* Import subprocess

---------

Co-authored-by: jhughesbiot <[email protected]>

* Port scan test module (#23)

* Add network orchestrator repository

* cleanup duplicate start and install scripts

* Temporary fix for python dependencies

* Remove duplicate python requirements

* remove duplicate conf files

* remove remote-net option

* cleanp unecessary files

* Add dns test module
Fix test module build process

* Add mac address of device under test to test container
Update dns test to use mac address filter

* Update dns module tests

* Change result output

* logging update

* Update test module for better reusability

* Load in module config to test module

* logging cleanup

* Update baseline module to new template
Misc cleanup

* Add ability to disable individual tests

* remove duplicate readme

* Update device directories

* Remove local folder

* Update device template
Update test module to work with new device config file format

* Change test module network config options
Do not start network services for modules not configured for network

* Initial nmap test module add
Add device ip resolving to base module
Add network mounting for test modules

* Update ipv4 device resolving in test modules

* Map in ip subnets and remove hard coded references

* Add ftp port test

* Add ability to pass config for individual tests within a module
Update nmap module scan to run tests based on config

* Add full module check for compliance

* Add all tcp port scans to config

* Update nmap commands to match existing DAQ tests
Add udp scanning and tests

* logging cleanup

* Update TCP port scanning range
Update logging

* Merge device config into module config
Update device template

* fix merge issues

* Update timeouts
Add multi-threading for multiple scanns to run simultaneously
Add option to use scan scripts for services

* Fix merge issues

* Fix device configs

* Remove unecessary files

* Cleanup duplicate properties

* Cleanup install script

* Formatting (#26)

* Fix pylint issues in net orc

* more pylint fixes

* fix listener lint issues

* fix logger lint issues

* fix validator lint issues

* fix util lint issues

* Update base network module linting issues

* Cleanup linter issues for dhcp modules
Remove old code testing code

* change to single quote delimeter

* Cleanup linter issues for ntp module

* Cleanup linter issues for radius module

* Cleanup linter issues for template module

* fix linter issues with faux-dev

* Test results (#27)

* Collect all module test results

* Fix test modules without config options

* Add timestamp to test results

* Test results (#28)

* Collect all module test results

* Fix test modules without config options

* Add timestamp to test results

* Add attempt timing and device info to test results

* Ignore disabled test containers when generating results

* Fully skip modules that are disabled

* Fix pylint test and skip internet tests so CI passes (#29)

* disable internet checks for pass

* fix pylint test

* Increase pylint score (#31)

* More formatting fixes

* More formatting fixes

* More formatting fixes

* More formatting fixes

* Misc pylint fixes
Fix test module logger

---------

Co-authored-by: jhughesbiot <[email protected]>

* Pylint (#32)

* More formatting fixes

* More formatting fixes

* More formatting fixes

* More formatting fixes

* Misc pylint fixes
Fix test module logger

* remove unused files

* more formatting

* revert breaking pylint changes

* more formatting

* fix results file

* More formatting

* ovs module formatting

---------

Co-authored-by: Jacob Boddey <[email protected]>

* Add license header (#36)

* More formatting fixes

* More formatting fixes

* More formatting fixes

* More formatting fixes

* Misc pylint fixes
Fix test module logger

* remove unused files

* more formatting

* revert breaking pylint changes

* more formatting

* fix results file

* More formatting

* ovs module formatting

* Add ovs control into network orchestrator

* Add verification methods for the base network

* Add network validation and misc logging updates

* remove ovs module

* add license header to all python files

---------

Co-authored-by: Jacob Boddey <[email protected]>
Co-authored-by: SuperJonotron <[email protected]>

* Ovs (#35)

* More formatting fixes

* More formatting fixes

* More formatting fixes

* More formatting fixes

* Misc pylint fixes
Fix test module logger

* remove unused files

* more formatting

* revert breaking pylint changes

* more formatting

* fix results file

* More formatting

* ovs module formatting

* Add ovs control into network orchestrator

* Add verification methods for the base network

* Add network validation and misc logging updates

* remove ovs module

---------

Co-authored-by: Jacob Boddey <[email protected]>
Co-authored-by: SuperJonotron <[email protected]>

* remove ovs files added back in during merge

* Nmap (#38)

* More formatting fixes

* More formatting fixes

* More formatting fixes

* More formatting fixes

* Misc pylint fixes
Fix test module logger

* remove unused files

* more formatting

* revert breaking pylint changes

* more formatting

* fix results file

* More formatting

* ovs module formatting

* Add ovs control into network orchestrator

* Add verification methods for the base network

* Add network validation and misc logging updates

* remove ovs module

* add license header to all python files

* Update tcp scans to speed up full port range scan
Add version checking
Implement ssh version checking

* Add unknown port checks
Match unknown ports to existing services
Add unknown ports without existing services to results file

---------

Co-authored-by: Jacob Boddey <[email protected]>
Co-authored-by: SuperJonotron <[email protected]>

* Create startup capture (#37)

* Connection (#40)

* Initial add of connection test module with ping test

* Update host user resolving

* Update host user resolving for validator

* add get user method to validator

* Conn mac oui (#42)

* Initial add of connection test module with ping test

* Update host user resolving

* Update host user resolving for validator

* add get user method to validator

* Add mac_oui test
Add option to return test result and details of test for reporting

* Con mac address (#43)

* Initial add of connection test module with ping test

* Update host user resolving

* Update host user resolving for validator

* add get user method to validator

* Add mac_oui test
Add option to return test result and details of test for reporting

* Add connection.mac_address test

* Dns (#44)

* Add MDNS test

* Update existing mdns logging to be more consistent with other tests

* Add startup and monitor captures

* File permissions (#45)

* Fix validator file permissions

* Fix test module permissions

* Fix device capture file permissions

* Fix device results permissions

* Add connection single ip test (#47)

* Nmap results (#49)

* Update processing of nmap results to use xml output and json conversions for stability

* Update matching with regex to prevent wrong service matches and duplicate processing for partial matches

* Update max port scan range

* Framework restructure (#50)

* Restructure framework and modules

* Fix CI paths

* Fix base module

* Add build script

* Remove build logs

* Update base and template docker files to fit the new format
Implement a template option on network modules
Fix skipping of base image build

* remove base image build in ci

* Remove group from chown

---------

Co-authored-by: jhughesbiot <[email protected]>

* Ip control (#51)

* Add initial work for ip control module

* Implement ip control module with additional cleanup methods

* Update link check to not use error stream

* Add error checking around container network configurations

* Add network cleanup for namespaces and links

* formatting

* Move config to /local (#52)

* Move config to /local

* Fix testing config

* Fix ovs_control config location

* Fix faux dev config location

* Add documentation (#53)

---------

Co-authored-by: jhughesbiot <[email protected]>
Co-authored-by: jhughesbiot <[email protected]>
Co-authored-by: Noureddine <[email protected]>
Co-authored-by: SuperJonotron <[email protected]>

* Sprint 8 Hotfix (#54)

* Fix connection results.json

* Re add try/catch

* Fix log level

* Debug test module load order

* Add depends on to nmap module

* Remove logging change

---------

Co-authored-by: jhughesbiot <[email protected]>
Co-authored-by: jhughesbiot <[email protected]>
Co-authored-by: Noureddine <[email protected]>
Co-authored-by: SuperJonotron <[email protected]>

* Fix missing results on udp tests when tcp ports are also defined (#59)

* Add licence header (#61)

* Resolve merge conflict

* Add network docs (#63)

* Add network docs

* Rename to readme

* Add link to template module

* Dhcp (#64)

* Add initial work for ip control module

* Implement ip control module with additional cleanup methods

* Update link check to not use error stream

* Add error checking around container network configurations

* Add network cleanup for namespaces and links

* formatting

* initial work on adding grpc functions for dhcp tests

* rework code to allow for better usage and unit testing

* working poc for test containers and grpc client to dhcp-1

* Move grpc client code into base image

* Move grpc proto builds outside of dockerfile into module startup script

* Setup pythonpath var in test module base startup process
misc cleanup

* pylinting and logging updates

* Add python path resolving to network modules
Update grpc path to prevent conflicts
misc pylinting

* Change lease resolving method to fix pylint issue

* cleanup unit tests

* cleanup unit tests

* Add grpc updates to dhcp2 module
Update dhcp_config to deal with missing optional variables

* Add grpc updates to dhcp2 module
Update dhcp_config to deal with missing optional variables

* fix line endings

* misc cleanup

* Dhcp (#67)

* Add initial work for ip control module

* Implement ip control module with additional cleanup methods

* Update link check to not use error stream

* Add error checking around container network configurations

* Add network cleanup for namespaces and links

* formatting

* initial work on adding grpc functions for dhcp tests

* rework code to allow for better usage and unit testing

* working poc for test containers and grpc client to dhcp-1

* Move grpc client code into base image

* Move grpc proto builds outside of dockerfile into module startup script

* Setup pythonpath var in test module base startup process
misc cleanup

* pylinting and logging updates

* Add python path resolving to network modules
Update grpc path to prevent conflicts
misc pylinting

* Change lease resolving method to fix pylint issue

* cleanup unit tests

* cleanup unit tests

* Add grpc updates to dhcp2 module
Update dhcp_config to deal with missing optional variables

* Add grpc updates to dhcp2 module
Update dhcp_config to deal with missing optional variables

* fix line endings

* misc cleanup

* Move isc-dhcp-server and radvd to services
Move DHCP server monitoring and booting to python script

* Add grpc methods to interact with dhcp_server module
Update dhcp_server to control radvd server directly from calls
Fix radvd service status method

* Add updates to dhcp2 module
Update radvd service

* Add license headers

* Add connection.dhcp_address test (#68)

* Add NTP tests (#60)

* Add ntp support test

* Add extra log message

* Modify descriptions

* Pylint

* Pylint (#69)

---------

Co-authored-by: jhughesbiot <[email protected]>

* Add ipv6 tests (#65)

* Add ipv6 tests

* Check for ND_NS

---------

Co-authored-by: jhughesbiot <[email protected]>
Co-authored-by: jhughesbiot <[email protected]>
Co-authored-by: Noureddine <[email protected]>
Co-authored-by: SuperJonotron <[email protected]>

* Connection private address (#71)

* Add ntp support test

* Add extra log message

* Modify descriptions

* Pylint

* formatting

* Change isc-dhcp service setup
Fix dhcpd logging
Add start and stop methods to grpc dhcp client
Add dhcp2 client
Inttial private_addr test

* Add max lease time
Add unit tests

* fix last commit

* finish initial work on test

* pylinting

* Breakup test and allow better failure reporting

* restore network after test

* Wait for device to get a lease from original dhcp range after network restore

* pylinting

* Fix ipv6 tests

---------

Co-authored-by: Jacob Boddey <[email protected]>

* fix windows line ending

* Fix python import

* move isc-dhcp service commands to their own class
update logging
pylinting

* fix dhcp1

* Initial CI testing for tests (#72)

* Fix radvd conf

---------

Co-authored-by: jhughesbiot <[email protected]>
Co-authored-by: jhughesbiot <[email protected]>
Co-authored-by: Noureddine <[email protected]>
Co-authored-by: SuperJonotron <[email protected]>

* Fix testing command

* Disable API on testing

* Add API session

* Remove old method

* Remove local vars

* Replace old var

* Add device config

* Add device configs

* Fix paths

* Change MAC address

* Revert mac

* Fix copy path

* Debug loading devices

* Remove reference

* Changes

* Re-add checks to prevent null values

* Fix variable

* Fix

* Use dict instead of string

* Try without json conversion

* Container output to log

* Undo changes to nmap module

* Add post devices route

---------

Co-authored-by: jhughesbiot <[email protected]>
Co-authored-by: jhughesbiot <[email protected]>
Co-authored-by: Noureddine <[email protected]>
Co-authored-by: SuperJonotron <[email protected]>

* Dhcp tests (#81)

* Separate dhcp control methods into their own module
Implement ip change test
Add place holder for dhcp failover test

* Stabilize network before leaving ip_change test
Add dhcp_failover test

* fix regression issue with individual test enable/disable setting

* fix gitignore

* Merge tls tests into dev (#80)

* initial add of security module and tls tests

* Fix server test and implement 1.3 version

* pylinting

* More work on client tests

* Add client tls tests
Add unit tets
Add common python code to base test module

* re-enable dhcp unit tests disabled dur…
  • Loading branch information
8 people authored Jan 31, 2024
1 parent 39d0323 commit 8d18ac5
Show file tree
Hide file tree
Showing 89 changed files with 1,953 additions and 1,982 deletions.
32 changes: 19 additions & 13 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ on:

jobs:
testrun_baseline:
permissions: {}
name: Baseline
runs-on: ubuntu-20.04
timeout-minutes: 20
steps:
- name: Checkout source
uses: actions/checkout@v2.3.4
uses: actions/checkout@v4.1.1
- name: Install dependencies
shell: bash {0}
run: cmd/prepare
Expand All @@ -28,13 +29,14 @@ jobs:
run: testing/baseline/test_baseline

testrun_tests:
permissions: {}
name: Tests
runs-on: ubuntu-20.04
needs: testrun_baseline
timeout-minutes: 45
steps:
- name: Checkout source
uses: actions/checkout@v2.3.4
uses: actions/checkout@v4.1.1
- name: Install dependencies
shell: bash {0}
run: cmd/prepare
Expand All @@ -51,20 +53,21 @@ jobs:
if: ${{ always() }}
run: sudo tar --exclude-vcs -czf runtime.tgz /usr/local/testrun/runtime/
- name: Upload runtime results
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
if-no-files-found: error
name: runtime_${{ github.workflow }}_${{ github.run_id }}
name: runtime_tests_${{ github.run_id }}
path: runtime.tgz

testrun_api:
permissions: {}
name: API
runs-on: ubuntu-20.04
timeout-minutes: 40
steps:
- name: Checkout source
uses: actions/checkout@v2.3.4
uses: actions/checkout@v4.1.1
- name: Install dependencies
shell: bash {0}
run: cmd/prepare
Expand All @@ -82,47 +85,50 @@ jobs:
if: ${{ always() }}
run: sudo tar --exclude-vcs -czf runtime.tgz /usr/local/testrun/runtime/ /usr/local/testrun/local/
- name: Upload runtime results
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
if-no-files-found: error
name: runtime_${{ github.workflow }}_${{ github.run_id }}
name: runtime_api_${{ github.run_id }}
path: runtime.tgz

pylint:
permissions: {}
name: Pylint
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- name: Checkout source
uses: actions/checkout@v2.3.4
uses: actions/checkout@v4.1.1
- name: Run pylint
shell: bash {0}
run: testing/pylint/test_pylint

testrun_package:
permissions: {}
name: Package
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- name: Checkout source
uses: actions/checkout@v2.3.4
uses: actions/checkout@v4.1.1
- name: Package Testrun
shell: bash {0}
run: cmd/package
- name: Archive package
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Testrun Installer
name: testrun_installer
path: testrun*.deb

testrun_ui:
permissions: {}
name: UI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4.1.1
- name: Install Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18.10.0
- name: Install Chromium Browser
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ pylint.out
__pycache__/
build/
testing/unit_test/temp/
*.deb
*.deb

make/DEBIAN/postinst
7 changes: 7 additions & 0 deletions cmd/install
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ pip3 install -r framework/requirements.txt
# Copy the default configuration
cp -n local/system.json.example local/system.json

# Set file permissions
# This does not work on GitHub actions
if logname ; then
USER_NAME=$(logname)
sudo chown "$USER_NAME" local/system.json
fi

deactivate

# Build docker images
Expand Down
2 changes: 1 addition & 1 deletion cmd/package
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ cp -r {framework,modules} $MAKE_SRC_DIR/usr/local/testrun
dpkg-deb --build --root-owner-group make

# Rename the .deb file
mv make.deb testrun_1-1_amd64.deb
mv make.deb testrun_1-1-1_amd64.deb
7 changes: 4 additions & 3 deletions docs/get_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ However, to achieve a compliant test outcome, your device must be configured cor
- Connect one USB Ethernet adapter to the internet source (e.g., router or switch) using an ethernet cable.
- Connect the other USB Ethernet adapter directly to the IoT device you want to test using an ethernet cable.

**NOTE: The device under test should be powered off until prompted**

**NOTE: Both adapters should be disabled in the host system (IPv4, IPv6 and general). You can do this by going to Settings > Network**
Some things to remember:
- The device under test should be powered off until prompted
- Both adapters should be disabled in the host system (IPv4, IPv6 and general). You can do this by going to Settings > Network
- Struggling to identify the correct interfaces? See [this guide](network/identify_interfaces.md).

2. Start Testrun.

Expand Down
5 changes: 3 additions & 2 deletions docs/network/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

## Table of Contents
1) Network Overview (this page)
2) [Addresses](addresses.md)
3) [Add a new network service](add_new_service.md)
2) [How to identify network interfaces](identify_interfaces.md)
3) [Addresses](addresses.md)
4) [Add a new network service](add_new_service.md)

Test Run provides several built-in network services that can be utilized for testing purposes. These services are already available and can be used without any additional configuration.

Expand Down
18 changes: 18 additions & 0 deletions docs/network/identify_interfaces.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Identifying network interfaces

For Testrun to operate correctly, you must select the correct network interfaces within the settings panel of the user interface. There are 2 methods to identify the correct network interfaces:

A) Find the printed MAC address on your interface

Some USB network interfaces will have the MAC address printed on the interface itself. This will look something like: ```00:e0:4c:02:0f:a8```.

Compare this printed MAC address against the MAC address provided in the settings panel in the user interface.

B) Connect your interfaces one at a time

1) Ensure both interfaces are disconnected from your PC and open the settings panel in the user interface.

2) Connect your internet interface to your PC and refresh the settings panel. One interface, which was not previously present, should now be visibile.

3) Repeat the previous step for the devices interface.

142 changes: 112 additions & 30 deletions framework/python/src/api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Provides Testrun data via REST API."""
from fastapi import FastAPI, APIRouter, Response, Request, status
from fastapi.responses import FileResponse
from fastapi.middleware.cors import CORSMiddleware
Expand All @@ -37,7 +37,8 @@
DEVICES_PATH = "/usr/local/testrun/local/devices"
DEFAULT_DEVICE_INTF = "enx123456789123"

LATEST_RELEASE_CHECK = "https://api.github.com/repos/google/testrun/releases/latest"
LATEST_RELEASE_CHECK = ("https://api.github.com/repos/google/" +
"testrun/releases/latest")

class Api:
"""Provide REST endpoints to manage Testrun"""
Expand Down Expand Up @@ -77,6 +78,9 @@ def __init__(self, test_run):
self.delete_device,
methods=["DELETE"])
self._router.add_api_route("/device", self.save_device, methods=["POST"])
self._router.add_api_route("/device/edit",
self.edit_device,
methods=["POST"])

# Allow all origins to access the API
origins = ["*"]
Expand Down Expand Up @@ -111,14 +115,17 @@ def stop(self):

async def get_sys_interfaces(self):
addrs = psutil.net_if_addrs()
ifaces = []
for iface in addrs:
ifaces = {}

# pylint: disable=consider-using-dict-items
for key in addrs.keys():
nic = addrs[key]

# Ignore any interfaces that are not ethernet
if not (iface.startswith("en") or iface.startswith("eth")):
if not (key.startswith("en") or key.startswith("eth")):
continue

ifaces.append(iface)
ifaces[key] = nic[0].address

return ifaces

Expand Down Expand Up @@ -240,32 +247,38 @@ async def get_version(self, response: Response):
json_response["installed_version"] = "v" + current_version

# Check latest version number from GitHub API
version_check = requests.get(LATEST_RELEASE_CHECK, timeout=5)
try:
version_check = requests.get(LATEST_RELEASE_CHECK, timeout=5)

# Check OK response was received
if version_check.status_code != 200:
response.status_code = 500
LOGGER.error(version_check.content)
return self._generate_msg(False, "Failed to fetch latest version")

# Extract version number from response, removing the leading 'v'
latest_version_no = version_check.json()["name"].strip("v")
LOGGER.debug(f"Latest version available is {latest_version_no}")

# Craft JSON response
json_response["latest_version"] = "v" + latest_version_no
json_response["latest_version_url"] = version_check.json()["html_url"]

# String comparison between current and latest version
if latest_version_no > current_version:
json_response["update_available"] = True
LOGGER.debug("An update is available")
else:
json_response["update_available"] = False
LOGGER.debug("The latest version is installed")

# Check OK response was received
if version_check.status_code != 200:
return json_response
except Exception as e:
response.status_code = 500
LOGGER.error(version_check.content)
LOGGER.error("Failed to fetch latest version")
LOGGER.debug(e)
return self._generate_msg(False, "Failed to fetch latest version")

# Extract version number from response, removing the leading 'v'
latest_version_no = version_check.json()["name"].strip("v")
LOGGER.debug(f"Latest version available is {latest_version_no}")

# Craft JSON response
json_response["latest_version"] = "v" + latest_version_no
json_response["latest_version_url"] = version_check.json()["html_url"]

# String comparison between current and latest version
if latest_version_no > current_version:
json_response["update_available"] = True
LOGGER.debug("An update is available")
else:
json_response["update_available"] = False
LOGGER.debug("The latest version is installed")

return json_response

async def get_reports(self, request: Request):
LOGGER.debug("Received reports list request")
# Resolve the server IP from the request so we
Expand Down Expand Up @@ -389,8 +402,76 @@ async def save_device(self, request: Request, response: Response):

else:

self._test_run.save_device(device, device_json)
response.status_code = status.HTTP_200_OK
response.status_code = status.HTTP_409_CONFLICT
return self._generate_msg(False, "A device with that " +
"MAC address already exists")

return device.to_config_json()

# Catch JSON Decode error etc
except JSONDecodeError:
response.status_code = status.HTTP_400_BAD_REQUEST
return self._generate_msg(False, "Invalid JSON received")

async def edit_device(self, request: Request, response: Response):

LOGGER.debug("Received device edit request")

try:
req_raw = (await request.body()).decode("UTF-8")
req_json = json.loads(req_raw)

# Validate top level fields
if not (DEVICE_MAC_ADDR_KEY in req_json and
"device" in req_json):
response.status_code = status.HTTP_400_BAD_REQUEST
return self._generate_msg(False, "Invalid request received")

# Extract device information from request
device_json = req_json.get("device")

if not self._validate_device_json(device_json):
response.status_code = status.HTTP_400_BAD_REQUEST
return self._generate_msg(False, "Invalid request received")

# Get device from old MAC address
device = self._session.get_device(req_json.get(DEVICE_MAC_ADDR_KEY))

# Check if device exists
if device is None:
response.status_code = status.HTTP_404_NOT_FOUND
return self._generate_msg(False,
"A device with that MAC " +
"address could not be found")

if (self._session.get_target_device() == device and
self._session.get_status() not in [
"Cancelled",
"Compliant",
"Non-Compliant"]):
response.status_code = 403
return self._generate_msg(False, "Cannot edit this device whilst " +
"it is being tested")

# Check if a device exists with the new MAC address
check_new_device = self._session.get_device(
device_json.get(DEVICE_MAC_ADDR_KEY))

if not check_new_device is None and (device.mac_addr
!= check_new_device.mac_addr):
response.status_code = status.HTTP_409_CONFLICT
return self._generate_msg(False,
"A device with that MAC address " +
"already exists")

# Update the device
device.mac_addr = device_json.get(DEVICE_MAC_ADDR_KEY).lower()
device.manufacturer = device_json.get(DEVICE_MANUFACTURER_KEY)
device.model = device_json.get(DEVICE_MODEL_KEY)
device.test_modules = device_json.get(DEVICE_TEST_MODULES_KEY)

self._test_run.save_device(device, device_json)
response.status_code = status.HTTP_200_OK

return device.to_config_json()

Expand All @@ -399,6 +480,7 @@ async def save_device(self, request: Request, response: Response):
response.status_code = status.HTTP_400_BAD_REQUEST
return self._generate_msg(False, "Invalid JSON received")


async def get_report(self, response: Response,
device_name, timestamp):

Expand Down
Loading

0 comments on commit 8d18ac5

Please sign in to comment.