<s> """<STR_LIT>""" <EOL> from grr . lib import flags <EOL> from grr . lib import test_lib <EOL> from grr . lib . checks import checks_test_lib <EOL> from grr . parsers import config_file <EOL> class NfsExportsTests ( checks_test_lib . HostCheckTest ) : <EOL> results = None <EOL> @ classmethod <EOL> def setUpClass ( cls ) : <EOL> cls . LoadCheck ( "<STR_LIT>" ) <EOL> def setUp ( self , * args , ** kwargs ) : <EOL> super ( NfsExportsTests , self ) . setUp ( * args , ** kwargs ) <EOL> if not NfsExportsTests . results : <EOL> parser = config_file . NfsExportsParser ( ) <EOL> host_data = self . SetKnowledgeBase ( ) <EOL> with open ( self . TestDataPath ( "<STR_LIT>" ) ) as export_fd : <EOL> parsed = list ( parser . Parse ( None , export_fd , None ) ) <EOL> host_data [ "<STR_LIT>" ] = self . SetArtifactData ( parsed = parsed ) <EOL> NfsExportsTests . results = self . RunChecks ( host_data ) <EOL> def testNfsExportsCheck ( self ) : <EOL> """<STR_LIT>""" <EOL> check_id = "<STR_LIT>" <EOL> sym = "<STR_LIT>" <EOL> found = [ ( "<STR_LIT>" <EOL> "<STR_LIT>" ) , <EOL> ( "<STR_LIT>" <EOL> "<STR_LIT>" ) ] <EOL> self . assertCheckDetectedAnom ( check_id , self . results , sym , found ) <EOL> sym = "<STR_LIT>" <EOL> found = [ "<STR_LIT>" ] <EOL> self . assertCheckDetectedAnom ( check_id , self . results , sym , found ) <EOL> def testNfsRootSquashCheck ( self ) : <EOL> check_id = "<STR_LIT>" <EOL> sym = "<STR_LIT>" <EOL> found = [ ( "<STR_LIT>" <EOL> "<STR_LIT>" ) ] <EOL> self . assertCheckDetectedAnom ( check_id , self . results , sym , found ) <EOL> def testNfsAuthCheck ( self ) : <EOL> check_id = "<STR_LIT>" <EOL> sym = "<STR_LIT>" <EOL> found = [ "<STR_LIT>" , <EOL> "<STR_LIT>" ] <EOL> self . assertCheckDetectedAnom ( check_id , self . results , sym , found ) <EOL> def main ( argv ) : <EOL> test_lib . GrrTestProgram ( argv = argv ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> flags . StartMain ( main ) </s>
