<s> import hashlib <EOL> from functional . common import test <EOL> class ComputeAgentTests ( test . TestCase ) : <EOL> """<STR_LIT>""" <EOL> ID = None <EOL> MD5HASH = hashlib . md5 ( ) . hexdigest ( ) <EOL> URL = "<STR_LIT>" <EOL> VER = "<STR_LIT>" <EOL> OS = "<STR_LIT>" <EOL> ARCH = "<STR_LIT>" <EOL> HYPER = "<STR_LIT>" <EOL> HEADERS = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> FIELDS = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> @ classmethod <EOL> def setUpClass ( cls ) : <EOL> opts = cls . get_show_opts ( cls . HEADERS ) <EOL> raw_output = cls . openstack ( '<STR_LIT>' <EOL> + cls . OS + '<STR_LIT:U+0020>' + cls . ARCH + '<STR_LIT:U+0020>' <EOL> + cls . VER + '<STR_LIT:U+0020>' + cls . URL + '<STR_LIT:U+0020>' <EOL> + cls . MD5HASH + '<STR_LIT:U+0020>' + cls . HYPER + '<STR_LIT:U+0020>' <EOL> + opts ) <EOL> output_list = raw_output . split ( '<STR_LIT:\n>' , <NUM_LIT:1> ) <EOL> cls . ID = output_list [ <NUM_LIT:0> ] <EOL> cls . assertOutput ( cls . MD5HASH + '<STR_LIT:\n>' , output_list [ <NUM_LIT:1> ] ) <EOL> @ classmethod <EOL> def tearDownClass ( cls ) : <EOL> raw_output = cls . openstack ( '<STR_LIT>' + cls . ID ) <EOL> cls . assertOutput ( '<STR_LIT>' , raw_output ) <EOL> def test_agent_list ( self ) : <EOL> raw_output = self . openstack ( '<STR_LIT>' ) <EOL> self . assertIn ( self . ID , raw_output ) <EOL> self . assertIn ( self . OS , raw_output ) <EOL> self . assertIn ( self . ARCH , raw_output ) <EOL> self . assertIn ( self . VER , raw_output ) <EOL> self . assertIn ( self . URL , raw_output ) <EOL> self . assertIn ( self . MD5HASH , raw_output ) <EOL> self . assertIn ( self . HYPER , raw_output ) <EOL> def test_agent_set ( self ) : <EOL> ver = '<STR_LIT>' <EOL> url = "<STR_LIT>" <EOL> md5hash = hashlib . md5 ( ) . hexdigest ( ) <EOL> raw_output = self . openstack ( '<STR_LIT>' <EOL> + self . ID + '<STR_LIT:U+0020>' + ver + '<STR_LIT:U+0020>' <EOL> + url + '<STR_LIT:U+0020>' + md5hash ) <EOL> self . assertEqual ( '<STR_LIT>' , raw_output ) <EOL> raw_output = self . openstack ( '<STR_LIT>' ) <EOL> self . assertIn ( self . ID , raw_output ) <EOL> self . assertIn ( ver , raw_output ) <EOL> self . assertIn ( url , raw_output ) <EOL> self . assertIn ( md5hash , raw_output ) </s>
