<commit_before>#!/usr/bin/env python

# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""A Test Script to be copied to the test VM to perform various tests to
   object storage via APIs exposed by the provider.

   Note: it is intentional that this test script is NOT dependant on the PKB
   package so we do not have to copy the entire PKB package to test VM just to
   run this script.
"""

import json
import logging
import sys
from threading import Thread
import string
import random
import time

import boto
import gflags as flags
import gcs_oauth2_boto_plugin  # noqa
from azure.storage import BlobService

FLAGS = flags.FLAGS

flags.DEFINE_enum(
    'storage_provider', 'GCS', ['GCS', 'S3', 'AZURE'],
    'The target storage provider to test.')

flags.DEFINE_string('host', None, 'The hostname of the storage endpoint.')

flags.DEFINE_string('bucket', None,
                    'The name of the bucket to test with. Caller is '
                    'responsible to create an empty bucket for a particular '
                    'invocation of this test and then clean-up the bucket '
                    'after this test returns.')

flags.DEFINE_string('azure_account', None,
                    'The name of the storage account for Azure.')

flags.DEFINE_string('azure_key', None,
                    'The key of the storage account for Azure.')

flags.DEFINE_enum(
    'scenario', 'OneByteRW', ['OneByteRW', 'ListConsistency',<commit_msg>Azure's latest breaking change broke object stroage benchmark scripts. We are making an adjustment here to our script so it works with Azure's latest Python package again.<commit_after>#!/usr/bin/env python

# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""A Test Script to be copied to the test VM to perform various tests to
   object storage via APIs exposed by the provider.

   Note: it is intentional that this test script is NOT dependant on the PKB
   package so we do not have to copy the entire PKB package to test VM just to
   run this script.
"""

import json
import logging
import sys
from threading import Thread
import string
import random
import time

import boto
import gflags as flags
import gcs_oauth2_boto_plugin  # noqa
from azure.storage.blob import BlobService

FLAGS = flags.FLAGS

flags.DEFINE_enum(
    'storage_provider', 'GCS', ['GCS', 'S3', 'AZURE'],
    'The target storage provider to test.')

flags.DEFINE_string('host', None, 'The hostname of the storage endpoint.')

flags.DEFINE_string('bucket', None,
                    'The name of the bucket to test with. Caller is '
                    'responsible to create an empty bucket for a particular '
                    'invocation of this test and then clean-up the bucket '
                    'after this test returns.')

flags.DEFINE_string('azure_account', None,
                    'The name of the storage account for Azure.')

flags.DEFINE_string('azure_key', None,
                    'The key of the storage account for Azure.')

flags.DEFINE_enum(
    'scenario', 'OneByteRW', ['OneByteRW', 'ListConsistency',
{'fraction_non_alphanumeric': 0.07161803713527852, 'fraction_numerical': 0.004822763443453099, 'mean_word_length': 3.3208333333333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1367215', 'n_tokens_mistral': 1121, 'n_tokens_neox': 1074, 'n_words': 533}