<s> '''<STR_LIT>''' <EOL> import unittest <EOL> import shutil <EOL> from eucaops import Eucaops <EOL> class EucaTest ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . conf = "<STR_LIT>" <EOL> self . tester = Eucaops ( config_file = self . conf , password = "<STR_LIT>" ) <EOL> self . doAuth ( ) <EOL> self . OK = '<STR_LIT>' <EOL> self . ENDC = '<STR_LIT>' <EOL> def tearDown ( self ) : <EOL> self . tester . cleanup_artifacts ( ) <EOL> self . tester . modify_property ( '<STR_LIT>' , '<STR_LIT:false>' ) <EOL> self . tester . delete_keypair ( self . keypair ) <EOL> self . tester . local ( "<STR_LIT>" + self . keypair . name + "<STR_LIT>" ) <EOL> shutil . rmtree ( self . tester . credpath ) <EOL> def runInstances ( self , numMax ) : <EOL> self . emi = self . tester . get_emi ( root_device_type = '<STR_LIT>' ) <EOL> self . reservation = self . tester . run_instance ( self . emi , keypair = self . keypair . name , group = self . group , min = <NUM_LIT:1> , max = numMax , <EOL> is_reachable = False ) <EOL> for instance in self . reservation . instances : <EOL> if instance . state == "<STR_LIT>" : <EOL> self . ip = instance . public_dns_name <EOL> self . instanceid = instance . id <EOL> def runSysCmd ( self , cmd ) : <EOL> self . source = "<STR_LIT>" + self . tester . credpath + "<STR_LIT>" <EOL> self . out = self . tester . sys ( self . source + cmd ) <EOL> def doAuth ( self ) : <EOL> self . keypair = self . tester . add_keypair ( ) <EOL> self . group = self . tester . add_group ( ) <EOL> self . tester . authorize_group ( self . group ) <EOL> def test ( self ) : <EOL> self . tester . modify_property ( '<STR_LIT>' , '<STR_LIT:true>' ) <EOL> self . runInstances ( <NUM_LIT:1> ) <EOL> self . tester . stop_instances ( self . reservation ) <EOL> self . runSysCmd ( '<STR_LIT>' + self . instanceid ) <EOL> assert str ( self . out ) . count ( '<STR_LIT>' ) == <NUM_LIT:0> <EOL> assert str ( self . out ) . count ( '<STR_LIT>' ) == <NUM_LIT:0> <EOL> print self . OK + '<STR_LIT>' + self . ENDC <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> unittest . main ( ) </s>
