<s> '''<STR_LIT>''' <EOL> import unittest <EOL> import shutil <EOL> import eutester . euproperties <EOL> from eucaops import Eucaops <EOL> from eutester . euproperties import Euproperty_Manager <EOL> class Euca4229 ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . conf = "<STR_LIT>" <EOL> self . cond = <NUM_LIT:0> <EOL> self . tester = Eucaops ( config_file = self . conf , password = "<STR_LIT>" ) <EOL> self . doAuth ( ) <EOL> self . sbin = self . tester . eucapath + "<STR_LIT>" <EOL> self . source = "<STR_LIT>" + self . tester . credpath + "<STR_LIT>" <EOL> def tearDown ( self ) : <EOL> self . tester . sys ( self . source + self . sbin + "<STR_LIT>" ) <EOL> self . tester . cleanup_artifacts ( ) <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 . reservation = self . tester . run_instance ( keypair = self . keypair . name , group = self . group , min = <NUM_LIT:1> , max = numMax , 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 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 testEuca4229 ( self ) : <EOL> self . zone = self . tester . get_zones ( ) . pop ( ) <EOL> self . num_snaps_before = str ( self . tester . sys ( self . source + "<STR_LIT>" ) ) . count ( "<STR_LIT>" ) <EOL> self . tester . sys ( self . source + self . sbin + "<STR_LIT>" ) <EOL> self . volume = self . tester . create_volume ( self . zone , <NUM_LIT:2> , timeout = <NUM_LIT:100> ) <EOL> try : <EOL> self . snap = self . tester . create_snapshot ( self . volume . id , description = "<STR_LIT>" ) <EOL> except Exception as detail : <EOL> self . cond = str ( detail ) . count ( '<STR_LIT>' ) <EOL> self . num_snaps_after = str ( self . tester . sys ( self . source + "<STR_LIT>" ) ) . count ( "<STR_LIT>" ) <EOL> if self . cond >= <NUM_LIT:1> and self . num_snaps_after == self . num_snaps_before : <EOL> self . tester . debug ( "<STR_LIT>" ) <EOL> pass <EOL> else : <EOL> self . fail ( "<STR_LIT>" ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> unittest . main ( "<STR_LIT>" ) </s>
