original_docstring: 
      This function verifies data of each key in a versioned bucket
  
      Parameters:
          key(char): key to be verified
          bucket(char): name of the versoiined bucket
  
      Returns:
  
      
docstring: This function verifies data of each key in a versioned bucket
docstring_tokens: This function verifies data of each key in a versioned bucket
code: def verify_key_with_version(each_key, bucket):
      """
      This function verifies data of each key in a versioned bucket
  
      Parameters:
          key(char): key to be verified
          bucket(char): name of the versoiined bucket
  
      Returns:
  
      """
      log.info("verifying data for key: %s" % os.path.basename(each_key["name"]))
      key_from_s3 = bucket.Object(os.path.basename(each_key["name"]))
      no_of_versions = len(each_key["versioning_info"])
      log.info("no of versions: %s" % no_of_versions)
      for each_version in each_key["versioning_info"]:
          log.info("version_id: %s" % each_version["version_id"])
          key_from_s3_with_version = key_from_s3.get(VersionId=each_version["version_id"])
          log.info("verifying size")
          log.info("size from yaml: %s" % each_version["size"])
          log.info("size from s3 %s" % key_from_s3_with_version["ContentLength"])
          if int(each_version["size"] != int(key_from_s3_with_version["ContentLength"])):
              raise TestExecError("Size not matched")
          log.info("verifying md5")
          log.info("md5_local: %s" % each_version["md5_local"])
          key_from_s3.download_file(
              "download.temp", ExtraArgs={"VersionId": each_version["version_id"]}
          )
          downloaded_md5 = utils.get_md5("download.temp")
          log.info("md5_from_s3: %s" % downloaded_md5)
          if each_version["md5_local"] != downloaded_md5:
              raise TestExecError("Md5 not matched")
          utils.exec_shell_cmd("sudo rm -rf download.temp")
          log.info(
              "verification complete for the key: %s ---> version_id: %s"
              % (key_from_s3.key, each_version["version_id"])
          )
code_tokens: def verify_key_with_version ( each_key , bucket ) : log . info ( "verifying data for key: %s" % os . path . basename ( each_key [ "name" ] ) ) key_from_s3 = bucket . Object ( os . path . basename ( each_key [ "name" ] ) ) no_of_versions = len ( each_key [ "versioning_info" ] ) log . info ( "no of versions: %s" % no_of_versions ) for each_version in each_key [ "versioning_info" ] : log . info ( "version_id: %s" % each_version [ "version_id" ] ) key_from_s3_with_version = key_from_s3 . get ( VersionId = each_version [ "version_id" ] ) log . info ( "verifying size" ) log . info ( "size from yaml: %s" % each_version [ "size" ] ) log . info ( "size from s3 %s" % key_from_s3_with_version [ "ContentLength" ] ) if int ( each_version [ "size" ] != int ( key_from_s3_with_version [ "ContentLength" ] ) ) : raise TestExecError ( "Size not matched" ) log . info ( "verifying md5" ) log . info ( "md5_local: %s" % each_version [ "md5_local" ] ) key_from_s3 . download_file ( "download.temp" , ExtraArgs = { "VersionId" : each_version [ "version_id" ] } ) downloaded_md5 = utils . get_md5 ( "download.temp" ) log . info ( "md5_from_s3: %s" % downloaded_md5 ) if each_version [ "md5_local" ] != downloaded_md5 : raise TestExecError ( "Md5 not matched" ) utils . exec_shell_cmd ( "sudo rm -rf download.temp" ) log . info ( "verification complete for the key: %s ---> version_id: %s" % ( key_from_s3 . key , each_version [ "version_id" ] ) )
short_docstring: This function verifies data of each key in a versioned bucket
short_docstring_tokens: This function verifies data of each key in a versioned bucket
comment: """
      This function verifies data of each key in a versioned bucket
  
      Parameters:
          key(char): key to be verified
          bucket(char): name of the versoiined bucket
  
      Returns:
  
      """