<s> from tests . testing_framework . base_test_cases import PluginTestCase <EOL> from hamcrest import * <EOL> from nose_parameterized . parameterized import parameterized <EOL> class NetPluginsTests ( PluginTestCase ) : <EOL> TYPE_ACTIVE = "<STR_LIT>" <EOL> TYPE_BRUTEFORCE = "<STR_LIT>" <EOL> METASPLOIT_BANNER_REGEX = "<STR_LIT>" <EOL> @ classmethod <EOL> def setUpClass ( cls ) : <EOL> super ( NetPluginsTests , cls ) . setUpClass ( ) <EOL> @ classmethod <EOL> def tearDownClass ( cls ) : <EOL> super ( NetPluginsTests , cls ) . tearDownClass ( ) <EOL> @ parameterized . expand ( [ <EOL> ( "<STR_LIT>" , "<STR_LIT>" ) , <EOL> ( "<STR_LIT>" , "<STR_LIT>" ) , <EOL> ( "<STR_LIT>" , "<STR_LIT>" ) , <EOL> ( "<STR_LIT>" , "<STR_LIT>" ) , <EOL> ( "<STR_LIT>" , "<STR_LIT>" ) , <EOL> ( "<STR_LIT>" , "<STR_LIT>" ) , <EOL> ( "<STR_LIT>" , "<STR_LIT>" ) , <EOL> ( "<STR_LIT>" , "<STR_LIT>" ) , <EOL> ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> ] ) <EOL> def test_net_active ( self , plugin_name , resource_name ) : <EOL> self . _run_owtf_and_asserts_for_plugin ( self . TYPE_ACTIVE , <EOL> plugin_name , <EOL> resource_name ) <EOL> def test_smb_active ( self ) : <EOL> self . owtf ( "<STR_LIT>" ) <EOL> num_resources = self . get_number_of_resources ( "<STR_LIT>" ) <EOL> self . assert_external_tool_started ( times = num_resources ) <EOL> self . assert_that_output_matches_more_than ( self . METASPLOIT_BANNER_REGEX , times = <NUM_LIT:3> ) <EOL> self . assert_that_output_contains ( "<STR_LIT>" ) <EOL> @ parameterized . expand ( [ <EOL> ( "<STR_LIT>" , "<STR_LIT>" ) , <EOL> ( "<STR_LIT>" , "<STR_LIT>" ) , <EOL> ( "<STR_LIT>" , "<STR_LIT>" ) , <EOL> ( "<STR_LIT>" , "<STR_LIT>" ) , <EOL> ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> ] ) <EOL> def test_net_bruteforce ( self , plugin_name , resource_name ) : <EOL> self . _run_owtf_and_asserts_for_plugin ( self . TYPE_BRUTEFORCE , <EOL> plugin_name , <EOL> resource_name ) <EOL> def _run_owtf_and_asserts_for_plugin ( self , plugin_type , name , resource_name ) : <EOL> self . owtf ( "<STR_LIT>" + plugin_type + "<STR_LIT>" + name ) <EOL> num_resources = self . get_number_of_resources ( resource_name ) <EOL> self . assert_external_tool_started ( times = num_resources ) <EOL> self . assert_that_output_matches_more_than ( self . METASPLOIT_BANNER_REGEX , num_resources ) <EOL> def get_number_of_resources ( self , name ) : <EOL> return len ( self . get_resources ( name ) ) </s>
