rem
stringlengths 1
322k
| add
stringlengths 0
2.05M
| context
stringlengths 4
228k
| meta
stringlengths 156
215
|
---|---|---|---|
ext_modules = [ python_c_extension ], | ext_modules = ext_module_list, | def MakeTestSuite(): # This is apparently needed on some systems to make sure that the tests # work even if a previous version is already installed. if 'google' in sys.modules: del sys.modules['google'] generate_proto("../src/google/protobuf/unittest.proto") generate_proto("../src/google/protobuf/unittest_custom_options.proto") generate_proto("../src/google/protobuf/unittest_import.proto") generate_proto("../src/google/protobuf/unittest_mset.proto") generate_proto("../src/google/protobuf/unittest_no_generic_services.proto") generate_proto("google/protobuf/internal/more_extensions.proto") generate_proto("google/protobuf/internal/more_messages.proto") import unittest import google.protobuf.internal.generator_test as generator_test import google.protobuf.internal.descriptor_test as descriptor_test import google.protobuf.internal.reflection_test as reflection_test import google.protobuf.internal.service_reflection_test \ as service_reflection_test import google.protobuf.internal.text_format_test as text_format_test import google.protobuf.internal.wire_format_test as wire_format_test loader = unittest.defaultTestLoader suite = unittest.TestSuite() for test in [ generator_test, descriptor_test, reflection_test, service_reflection_test, text_format_test, wire_format_test ]: suite.addTest(loader.loadTestsFromModule(test)) return suite | 514bdbee452fcb1c53274f7a00c0d18bf63e19d1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10745/514bdbee452fcb1c53274f7a00c0d18bf63e19d1/setup.py |
sub_message.SetInParent() | sub_message.SetInParent() | def _MergeField(tokenizer, message): """Merges a single protocol message field into a message. Args: tokenizer: A tokenizer to parse the field name and values. message: A protocol message to record the data. Raises: ParseError: In case of ASCII parsing problems. """ message_descriptor = message.DESCRIPTOR if tokenizer.TryConsume('['): name = [tokenizer.ConsumeIdentifier()] while tokenizer.TryConsume('.'): name.append(tokenizer.ConsumeIdentifier()) name = '.'.join(name) if not message_descriptor.is_extendable: raise tokenizer.ParseErrorPreviousToken( 'Message type "%s" does not have extensions.' % message_descriptor.full_name) field = message.Extensions._FindExtensionByName(name) if not field: raise tokenizer.ParseErrorPreviousToken( 'Extension "%s" not registered.' % name) elif message_descriptor != field.containing_type: raise tokenizer.ParseErrorPreviousToken( 'Extension "%s" does not extend message type "%s".' % ( name, message_descriptor.full_name)) tokenizer.Consume(']') else: name = tokenizer.ConsumeIdentifier() field = message_descriptor.fields_by_name.get(name, None) # Group names are expected to be capitalized as they appear in the # .proto file, which actually matches their type names, not their field # names. if not field: field = message_descriptor.fields_by_name.get(name.lower(), None) if field and field.type != descriptor.FieldDescriptor.TYPE_GROUP: field = None if (field and field.type == descriptor.FieldDescriptor.TYPE_GROUP and field.message_type.name != name): field = None if not field: raise tokenizer.ParseErrorPreviousToken( 'Message type "%s" has no field named "%s".' % ( message_descriptor.full_name, name)) if field.cpp_type == descriptor.FieldDescriptor.CPPTYPE_MESSAGE: tokenizer.TryConsume(':') if tokenizer.TryConsume('<'): end_token = '>' else: tokenizer.Consume('{') end_token = '}' if field.label == descriptor.FieldDescriptor.LABEL_REPEATED: if field.is_extension: sub_message = message.Extensions[field].add() else: sub_message = getattr(message, field.name).add() else: if field.is_extension: sub_message = message.Extensions[field] else: sub_message = getattr(message, field.name) sub_message.SetInParent() while not tokenizer.TryConsume(end_token): if tokenizer.AtEnd(): raise tokenizer.ParseErrorPreviousToken('Expected "%s".' % (end_token)) _MergeField(tokenizer, sub_message) else: _MergeScalarField(tokenizer, message, field) | 949e5f8b62bdd7cf8dbfc47dfeb690d77a004e86 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10745/949e5f8b62bdd7cf8dbfc47dfeb690d77a004e86/text_format.py |
raise Error("stock link to non-directory `%s'" % stock.link) | raise Error("stock link to non-directory `%s'" % self.link) | def __init__(self, path): self.paths = self.Paths(path) self.name = basename(path) self.link = os.readlink(self.paths.link) if not isdir(self.link): raise Error("stock link to non-directory `%s'" % stock.link) | 7c2270a9fca5033c90d8f26578bcdfbbc513dbd4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/7c2270a9fca5033c90d8f26578bcdfbbc513dbd4/pool.py |
def _read_versions(self): | def _init_read_versions(self): | def _read_versions(self): source_versions = {} for dpath, dnames, fnames in os.walk(self.paths.source_versions): relative_path = make_relative(self.paths.source_versions, dpath) for fname in fnames: fpath = join(dpath, fname) versions = [ line.strip() for line in file(fpath).readlines() if line.strip() ] source_versions[join(relative_path, fname)] = versions | 08e0cfc3fea6444c78cf2e8c0bf5e3e45aab623a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/08e0cfc3fea6444c78cf2e8c0bf5e3e45aab623a/pool.py |
def _get_workdir(self): | def _init_get_workdir(self): | def _get_workdir(self): """Return an initialized workdir path. | 08e0cfc3fea6444c78cf2e8c0bf5e3e45aab623a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/08e0cfc3fea6444c78cf2e8c0bf5e3e45aab623a/pool.py |
self.source_versions = self._read_versions() self.workdir = self._get_workdir() | self.source_versions = self._init_read_versions() self.workdir = self._init_get_workdir() | def __init__(self, path, pkgcache): self.paths = StockPaths(path) self.name = basename(path) self.branch = None if "#" in self.name: self.branch = self.name.split("#")[1] | 08e0cfc3fea6444c78cf2e8c0bf5e3e45aab623a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/08e0cfc3fea6444c78cf2e8c0bf5e3e45aab623a/pool.py |
for binary in self.stocks.get_binaries(): if self.pkgcache.exists(basename(binary)): continue self.pkgcache.add(binary) def _get_source_path(self, package): name, version = parse_package_id(package) for source_path, source_version in self.stocks.get_sources(): if basename(source_path) == name: source_path = dirname(source_path) if version is None: return source_path if source_version == version: return source_path return None | self.stocks.sync() | def _sync(self): """synchronise pool with registered stocks""" for binary in self.stocks.get_binaries(): if self.pkgcache.exists(basename(binary)): continue | 958adc137a35a06ef8cd53f5768ff130640959bb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/958adc137a35a06ef8cd53f5768ff130640959bb/pool.py |
if self._get_source_path(package): | if self.stocks.exists_source_version(*parse_package_id(package)): | def exists(self, package): """Check if package exists in pool -> Returns bool""" if self.pkgcache.exists(package): return True | 958adc137a35a06ef8cd53f5768ff130640959bb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/958adc137a35a06ef8cd53f5768ff130640959bb/pool.py |
self.packagelist.add(name) | if name in self.namerefs: self.namerefs[name] += 1 else: self.namerefs[name] = 1 | def _register(self, filename): name, version = self._parse_filename(filename) self.filenames[(name, version)] = filename self.packagelist.add(name) | 48c3448cffc32de290e5ff88eff226cfecea9ee6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/48c3448cffc32de290e5ff88eff226cfecea9ee6/pool.py |
self.packagelist.remove(name) | self.namerefs[name] -= 1 if not self.namerefs[name]: del self.namerefs[name] | def _unregister(self, name, version): del self.filenames[(name, version)] self.packagelist.remove(name) | 48c3448cffc32de290e5ff88eff226cfecea9ee6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/48c3448cffc32de290e5ff88eff226cfecea9ee6/pool.py |
self.packagelist = set() | self.namerefs = {} | def __init__(self, path): self.path = path | 48c3448cffc32de290e5ff88eff226cfecea9ee6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/48c3448cffc32de290e5ff88eff226cfecea9ee6/pool.py |
if name in self.packagelist: | if name in self.namerefs: | def exists(self, name, version=None): """Returns True if package exists in cache. | 48c3448cffc32de290e5ff88eff226cfecea9ee6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/48c3448cffc32de290e5ff88eff226cfecea9ee6/pool.py |
packages |= set([ (basename(path), version) for path, version in self.stocks.get_sources() ]) | for stock, path, versions in self.stocks.get_source_versions(): package = basename(path) packages |= set([ (package, version) for version in versions ]) | def list(self, all_versions=False): """List packages in pool -> list of (name, version) tuples. | 3a9a15f86b0b640914c7d96efa3fb992e53dc72b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/3a9a15f86b0b640914c7d96efa3fb992e53dc72b/pool.py |
if not islink(fname) and isfile(fname) and fname.endswith(".deb"): binaries.append(join(dirpath, fname)) | fpath = join(dirpath, fname) if not islink(fpath) and isfile(fpath) and fname.endswith(".deb"): binaries.append(fpath) | def get_binaries(self): """Recursively scan stocks for binaries -> list of filename""" | f8a11cd3c435a22b9f228acd50f0aa30a575178c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/f8a11cd3c435a22b9f228acd50f0aa30a575178c/pool.py |
def _lexcmp(a, b): i = 0 while True: if len(a) == len(b): if i == len(a): return 0 else: if i == len(a): return -1 if i == len(b): return 1 if a[i].isalpha(): if not b[i].isalpha(): return -1 if b[i].isalpha(): if not a[i].isalpha(): return 1 val = cmp(a[i], b[i]) if val != 0: return val i += 1 | def getnum(self): str = self.str i = 0 for c in str: if c not in '0123456789': break i += 1 | c6e6c2068dfba86f0dd96c513f0df9415d64e4b1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/c6e6c2068dfba86f0dd96c513f0df9415d64e4b1/debversion.py |
|
val = cmp(l1, l2) | val = _lexcmp(l1, l2) | def _compare(s1, s2): if s1 == s2: return 0 p1 = VersionParser(s1) p2 = VersionParser(s2) while True: l1 = p1.getlex() l2 = p2.getlex() val = cmp(l1, l2) if val != 0: return val n1 = p1.getnum() n2 = p2.getnum() val = cmp(n1, n2) if val != 0: return val if p1.str == p2.str: return 0 | c6e6c2068dfba86f0dd96c513f0df9415d64e4b1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/c6e6c2068dfba86f0dd96c513f0df9415d64e4b1/debversion.py |
val = cmp(l1, l2) | val = _lexcmp(l1, l2) | def _compare_flat(s1, s2): if s1 == s2: return 0 while True: # parse lexical components i = 0 for c in s1: if c in '0123456789': break i += 1 if i: l1 = s1[:i] s1 = s1[i:] else: l1 = '' i = 0 for c in s2: if c in '0123456789': break i += 1 if i: l2 = s2[:i] s2 = s2[i:] else: l2 = '' val = cmp(l1, l2) if val != 0: return val # if lexical component is equal parse numeric component i = 0 for c in s1: if c not in '0123456789': break i += 1 if i: n1 = int(s1[:i]) s1 = s1[i:] else: n1 = 0 i = 0 for c in s2: if c not in '0123456789': break i += 1 if i: n2 = int(s2[:i]) s2 = s2[i:] else: n2 = 0 val = cmp(n1, n2) if val != 0: return val if s1 == s2: return 0 | c6e6c2068dfba86f0dd96c513f0df9415d64e4b1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/c6e6c2068dfba86f0dd96c513f0df9415d64e4b1/debversion.py |
files = StockBase.Paths.files + \ [ 'source-versions', 'SYNC_HEAD', 'checkout' ] | files = [ 'source-versions', 'SYNC_HEAD', 'checkout' ] | def __init__(self, path, recursed_paths=[]): StockBase.__init__(self, path) if self.link in recursed_paths: raise CircularDependency("circular dependency detected `%s' is in recursed paths %s" % (self.link, recursed_paths)) | 8bc3da5dd19d4b325963f509371ba23b60a5442c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/8bc3da5dd19d4b325963f509371ba23b60a5442c/pool.py |
path = join(path, ".git") command = "git --git-dir %s init" % commands.mkarg(path) | init_path = join(init_path, ".git") command = "git --git-dir %s init" % commands.mkarg(init_path) | def init_create(cls, path, bare=False, verbose=False): if not lexists(path): os.mkdir(path) | 1369eb129a26d558fcada22040a4b474703d785c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/1369eb129a26d558fcada22040a4b474703d785c/git.py |
return dir, branch | return realpath(dir), branch | def _parse_stock(stock): try: dir, branch = stock.split("#", 1) except ValueError: dir = stock branch = None | 627150a4dc71a949275caddf9eb632c7fc535155 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/627150a4dc71a949275caddf9eb632c7fc535155/pool.py |
if not self.stocks.has_key(stock_name) or \ self.stocks[stock_name].link != realpath(dir): | matches = [ stock for stock in self.stocks.values() if stock.link == dir and (not branch or stock.branch == branch) ] if not matches: | def unregister(self, stock): dir, branch = self._parse_stock(stock) stock_name = basename(dir) if branch: stock_name += "#" + branch if not self.stocks.has_key(stock_name) or \ self.stocks[stock_name].link != realpath(dir): raise Error("no matches for unregister") | 627150a4dc71a949275caddf9eb632c7fc535155 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/627150a4dc71a949275caddf9eb632c7fc535155/pool.py |
shutil.rmtree(self.stocks[stock_name].path) del self.stocks[stock_name] | if len(matches) > 1: raise Error("multiple implicit matches for unregister") stock = matches[0] shutil.rmtree(stock.path) del self.stocks[stock.name] | def unregister(self, stock): dir, branch = self._parse_stock(stock) stock_name = basename(dir) if branch: stock_name += "#" + branch if not self.stocks.has_key(stock_name) or \ self.stocks[stock_name].link != realpath(dir): raise Error("no matches for unregister") | 627150a4dc71a949275caddf9eb632c7fc535155 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/627150a4dc71a949275caddf9eb632c7fc535155/pool.py |
def getpath_cached(p, package): """get path of cached package, whether in the pool or in a subpool""" path = p.pkgcache.getpath(package) | def pkgcache_list_versions(pool, name): versions = [ pkgcache_version for pkgcache_name, pkgcache_version in pool.pkgcache.list() if pkgcache_name == name ] for subpool in pool.subpools: versions += pkgcache_list_versions(subpool, name) return versions def pkgcache_getpath_newest(pool, name): versions = pkgcache_list_versions(pool, name) if not versions: return None versions.sort(debversion.compare) version_newest = versions[-1] package = pool.fmt_package_id(name, version_newest) return pool.getpath_deb(package, build=False) def binary2source(pool, package): """translate package from binary to source""" name, version = pool.parse_package_id(package) if version: path = pool.getpath_deb(package, build=False) if not path: return None source_name = extract_source_name(path) if not source_name: return package return pool.fmt_package_id(source_name, version) path = pkgcache_getpath_newest(pool, name) if not path: return None source_name = extract_source_name(path) if not source_name: return name return source_name def getpath_build_log(package): try: pool = Pool() except Pool.Error, e: fatal(e) path = pool.getpath_build_log(package) | def getpath_cached(p, package): """get path of cached package, whether in the pool or in a subpool""" path = p.pkgcache.getpath(package) if path: return path for subpool in p.subpools: path = getpath_cached(subpool, package) if path: return path return None | 919065b4d3df165465218856468e3f56615ba42d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/919065b4d3df165465218856468e3f56615ba42d/cmd_info_build.py |
for subpool in p.subpools: path = getpath_cached(subpool, package) if path: return path | source_package = binary2source(pool, package) if source_package: path = pool.getpath_build_log(source_package) | def getpath_cached(p, package): """get path of cached package, whether in the pool or in a subpool""" path = p.pkgcache.getpath(package) if path: return path for subpool in p.subpools: path = getpath_cached(subpool, package) if path: return path return None | 919065b4d3df165465218856468e3f56615ba42d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/919065b4d3df165465218856468e3f56615ba42d/cmd_info_build.py |
return None | if not path: package_desc = `package` if source_package: package_desc += " (%s)" % source_package fatal("no build log for " + package_desc) return path | def getpath_cached(p, package): """get path of cached package, whether in the pool or in a subpool""" path = p.pkgcache.getpath(package) if path: return path for subpool in p.subpools: path = getpath_cached(subpool, package) if path: return path return None | 919065b4d3df165465218856468e3f56615ba42d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/919065b4d3df165465218856468e3f56615ba42d/cmd_info_build.py |
try: p = pool.Pool() except pool.Error, e: fatal(e) | path = getpath_build_log(package) | def main(): args = sys.argv[1:] if not args: usage() package = args[0] try: p = pool.Pool() except pool.Error, e: fatal(e) source_package = package deb = getpath_cached(p, package) if deb: source_name = extract_source_name(deb) if source_name: source_package = source_name if '=' in package: source_package += "=" + package.split("=", 1)[1] path = p.getpath_build_log(source_package) if not path: fatal("no build log for `%s' (%s)" % (package, source_package)) for line in file(path).readlines(): print line, | 919065b4d3df165465218856468e3f56615ba42d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/919065b4d3df165465218856468e3f56615ba42d/cmd_info_build.py |
source_package = package deb = getpath_cached(p, package) if deb: source_name = extract_source_name(deb) if source_name: source_package = source_name if '=' in package: source_package += "=" + package.split("=", 1)[1] path = p.getpath_build_log(source_package) if not path: fatal("no build log for `%s' (%s)" % (package, source_package)) | def main(): args = sys.argv[1:] if not args: usage() package = args[0] try: p = pool.Pool() except pool.Error, e: fatal(e) source_package = package deb = getpath_cached(p, package) if deb: source_name = extract_source_name(deb) if source_name: source_package = source_name if '=' in package: source_package += "=" + package.split("=", 1)[1] path = p.getpath_build_log(source_package) if not path: fatal("no build log for `%s' (%s)" % (package, source_package)) for line in file(path).readlines(): print line, | 919065b4d3df165465218856468e3f56615ba42d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/919065b4d3df165465218856468e3f56615ba42d/cmd_info_build.py |
|
if val != 0: return val n1 = p1.getnum() n2 = p2.getnum() val = cmp(n1, n2) | def _compare(s1, s2): if s1 == s2: return 0 p1 = VersionParser(s1) p2 = VersionParser(s2) while True: l1 = p1.getlex() l2 = p2.getlex() val = cmp(l1, l2) if val != 0: return val n1 = p1.getnum() n2 = p2.getnum() val = cmp(n1, n2) if val != 0: return val | 0df2259a0dae6973e1da3091d1f374dc26f8deb6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/0df2259a0dae6973e1da3091d1f374dc26f8deb6/debversion.py |
|
epoch = 0 | epoch = '' | def parse(v): if ':' in v: epoch, v = v.split(':', 1) else: epoch = 0 if '-' in v: upstream_version, debian_revision = v.rsplit('-', 1) else: upstream_version = v debian_revision = '' return epoch, upstream_version, debian_revision | 395732e683f0283bdaeb11dd1afb787a931240ef /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/395732e683f0283bdaeb11dd1afb787a931240ef/debversion.py |
class VersionParser: def __init__(self, str): self.str = str def getlex(self): lex = re.match(r'(\D*)', self.str).group(1) self.str = self.str[len(lex):] return lex def getnum(self): num = re.match(r'(\d*)', self.str).group(1) self.str = self.str[len(num):] if num: return int(num) return 0 def _compare(s1, s2): if s1 == s2: return 0 p1 = VersionParser(s1) p2 = VersionParser(s2) while True: l1 = p1.getlex() l2 = p2.getlex() val = cmp(l1, l2) if val != 0: return val n1 = p1.getnum() n2 = p2.getnum() val = cmp(n1, n2) if val != 0: return val | def parse(v): if ':' in v: epoch, v = v.split(':', 1) else: epoch = 0 if '-' in v: upstream_version, debian_revision = v.rsplit('-', 1) else: upstream_version = v debian_revision = '' return epoch, upstream_version, debian_revision | 395732e683f0283bdaeb11dd1afb787a931240ef /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/395732e683f0283bdaeb11dd1afb787a931240ef/debversion.py |
|
epoch = '' | epoch = '0' | def parse(v): if ':' in v: epoch, v = v.split(':', 1) else: epoch = '' if '-' in v: upstream_version, debian_revision = v.rsplit('-', 1) else: upstream_version = v debian_revision = '' return epoch, upstream_version, debian_revision | 472f35169d4662e1e6c82ca0b53e79ee29170ae7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/472f35169d4662e1e6c82ca0b53e79ee29170ae7/debversion.py |
debian_revision = '' | debian_revision = '0' | def parse(v): if ':' in v: epoch, v = v.split(':', 1) else: epoch = '' if '-' in v: upstream_version, debian_revision = v.rsplit('-', 1) else: upstream_version = v debian_revision = '' return epoch, upstream_version, debian_revision | 472f35169d4662e1e6c82ca0b53e79ee29170ae7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/472f35169d4662e1e6c82ca0b53e79ee29170ae7/debversion.py |
a = parse(normalize(a)) b = parse(normalize(b)) | a = parse(a) b = parse(b) | def compare(a, b): """Compare a with b according to Debian versioning criteria""" a = parse(normalize(a)) b = parse(normalize(b)) for i in (0, 1, 2): val = _compare(a[i], b[i]) if val != 0: return val return 0 | 472f35169d4662e1e6c82ca0b53e79ee29170ae7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/472f35169d4662e1e6c82ca0b53e79ee29170ae7/debversion.py |
val = _compare(a[i], b[i]) | val = _compare_flat(a[i], b[i]) | def compare(a, b): """Compare a with b according to Debian versioning criteria""" a = parse(normalize(a)) b = parse(normalize(b)) for i in (0, 1, 2): val = _compare(a[i], b[i]) if val != 0: return val return 0 | 472f35169d4662e1e6c82ca0b53e79ee29170ae7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/472f35169d4662e1e6c82ca0b53e79ee29170ae7/debversion.py |
howmany = 1000 | howmany = 10000 | def test(): import time howmany = 1000 start = time.time() for i in xrange(howmany): compare("0-2010.10.1-d6cbb928", "0-2010.10.10-a9ee521c") end = time.time() elapsed = end - start print "%d runs in %.4f seconds (%.2f per/sec)" % (howmany, elapsed, howmany / elapsed) | 472f35169d4662e1e6c82ca0b53e79ee29170ae7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/472f35169d4662e1e6c82ca0b53e79ee29170ae7/debversion.py |
packages = dict(self._list()) | packages = dict(self._list(all_versions=False)) | def resolve(self, unresolved): """Resolve a list of unresolved packages. If unresolved is a single unresolved package, return a single resolved package. If unresolved is a tuple or list of unresolved packages, return a list of resolved packages""" | 55ea724bfc462ec257e843569bdd5882202b0eef /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/55ea724bfc462ec257e843569bdd5882202b0eef/pool.py |
if val != 0: return val l1 = p1.getlex() l2 = p2.getlex() val = cmp(l1, l2) | def _compare(s1, s2): if s1 == s2: return 0 p1 = VersionParser(s1) p2 = VersionParser(s2) while True: n1 = p1.getnum() n2 = p2.getnum() val = cmp(n1, n2) if val != 0: return val l1 = p1.getlex() l2 = p2.getlex() val = cmp(l1, l2) if val != 0: return val if p1.str == p2.str: return 0 | e41f9404e1e8c1ec37278020e89056ac9c4d9241 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/e41f9404e1e8c1ec37278020e89056ac9c4d9241/debversion.py |
|
i = 0 for c in s1: if c in '0123456789': break i += 1 if i: l1 = s1[:i] s1 = s1[i:] else: l1 = '' i = 0 for c in s2: if c in '0123456789': break i += 1 if i: l2 = s2[:i] s2 = s2[i:] else: l2 = '' val = cmp(l1, l2) if val != 0: return val | def _compare_flat(s1, s2): if s1 == s2: return 0 while True: # parse numeric component for comparison i = 0 for c in s1: if c not in '0123456789': break i += 1 if i: n1 = int(s1[:i]) s1 = s1[i:] else: n1 = 0 i = 0 for c in s2: if c not in '0123456789': break i += 1 if i: n2 = int(s2[:i]) s2 = s2[i:] else: n2 = 0 val = cmp(n1, n2) if val != 0: return val # if numeric components equal, parse lexical components i = 0 for c in s1: if c in '0123456789': break i += 1 if i: l1 = s1[:i] s1 = s1[i:] else: l1 = '' i = 0 for c in s2: if c in '0123456789': break i += 1 if i: l2 = s2[:i] s2 = s2[i:] else: l2 = '' val = cmp(l1, l2) if val != 0: return val if s1 == s2: return 0 | e41f9404e1e8c1ec37278020e89056ac9c4d9241 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/e41f9404e1e8c1ec37278020e89056ac9c4d9241/debversion.py |
|
if val != 0: return val i = 0 for c in s1: if c in '0123456789': break i += 1 if i: l1 = s1[:i] s1 = s1[i:] else: l1 = '' i = 0 for c in s2: if c in '0123456789': break i += 1 if i: l2 = s2[:i] s2 = s2[i:] else: l2 = '' val = cmp(l1, l2) | def _compare_flat(s1, s2): if s1 == s2: return 0 while True: # parse numeric component for comparison i = 0 for c in s1: if c not in '0123456789': break i += 1 if i: n1 = int(s1[:i]) s1 = s1[i:] else: n1 = 0 i = 0 for c in s2: if c not in '0123456789': break i += 1 if i: n2 = int(s2[:i]) s2 = s2[i:] else: n2 = 0 val = cmp(n1, n2) if val != 0: return val # if numeric components equal, parse lexical components i = 0 for c in s1: if c in '0123456789': break i += 1 if i: l1 = s1[:i] s1 = s1[i:] else: l1 = '' i = 0 for c in s2: if c in '0123456789': break i += 1 if i: l2 = s2[:i] s2 = s2[i:] else: l2 = '' val = cmp(l1, l2) if val != 0: return val if s1 == s2: return 0 | e41f9404e1e8c1ec37278020e89056ac9c4d9241 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/e41f9404e1e8c1ec37278020e89056ac9c4d9241/debversion.py |
|
if not packages and not input: | if not args[1:] and not input: | def main(): try: opts, args = getopt.getopt(sys.argv[1:], 'i:sqt', ['input=', 'strict', 'quiet', 'tree']) except getopt.GetoptError, e: usage(e) if not args: usage() outputdir = args[0] packages = args[1:] input = None opt_strict = False opt_quiet = False opt_tree = False for opt, val in opts: if opt in ('-i', '--input'): if val == '-': input = sys.stdin else: input = file(val, "r") elif opt in ('-s', '--strict'): opt_strict = True elif opt in ('-q', '--quiet'): opt_quiet = True elif opt in ('-t', '--tree'): opt_tree = True p = pool.Pool() if input: packages += read_packages(input) resolved = [] unresolved = [] for package in packages: if not p.exists(package): if opt_strict: fatal("%s: no such package" % package) if not opt_quiet: warn("%s: no such package" % package) continue if '=' in package: resolved.append(package) else: unresolved.append(package) if unresolved: resolved += fmt_package_tuples(cmd_list.list_packages(False, unresolved)) packages = resolved if not packages and not input: # if no packages specified, get all the newest versions packages = fmt_package_tuples(p.list()) for package in packages: path_from = p.getpath_deb(package) fname = basename(path_from) if opt_tree: package_name = package.split("=")[0] path_to = join(outputdir, get_treedir(package_name), fname) mkdir(dirname(path_to)) else: path_to = join(outputdir, basename(path_from)) if not exists(path_to): hardlink_or_copy(path_from, path_to) sys.exit(exitcode) | d33ab6df2a62bde457c03aacc0aff06baa2ce0c8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/d33ab6df2a62bde457c03aacc0aff06baa2ce0c8/cmd_get.py |
packages.sort(reverse=True) | def _cmp(a, b): val = cmp(b[0], a[0]) if val != 0: return val return debversion.compare(a[1], b[1]) packages.sort(cmp=_cmp, reverse=True) | def main(): try: opts, args = getopt.getopt(sys.argv[1:], 'an', ['all-versions', 'name-only']) except getopt.GetoptError, e: usage(e) opt_all_versions = False opt_name_only = False for opt, val in opts: if opt in ('-a', '--all-versions'): opt_all_versions = True elif opt in ('-n', '--name-only'): opt_name_only = True if opt_name_only and opt_all_versions: fatal("--name-only and --all-versions are conflicting options") globs = args packages = list_packages(opt_all_versions, globs) packages.sort(reverse=True) if opt_name_only: names = set() for name, version in packages: names.add(name) for name in names: print name else: for name, version in packages: print "%s=%s" % (name, version) | dff2e02dc21266e3313b06564e052f15180bea32 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/dff2e02dc21266e3313b06564e052f15180bea32/cmd_list.py |
paths = self.Paths(path) | paths = cls.Paths(path) | def create(cls, path, link): mkdir(path) paths = self.Paths(path) os.symlink(realpath(link), paths.link) | abe1e191badf44c3949a18d7b7b9b4bd7d43cc5d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/abe1e191badf44c3949a18d7b7b9b4bd7d43cc5d/pool.py |
if self.branch: relative_path = make_relative(self.paths.checkout, dir) else: relative_path = make_relative(self.link, dir) | relative_path = make_relative(self.workdir, dir) | def _sync_update_source_versions(self, dir): """update versions for a particular source package at <dir>""" packages = deb_get_packages(dir) versions = verseek.list(dir) | bec42009e0647f314e2da7e1465d6d8342ac582a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/bec42009e0647f314e2da7e1465d6d8342ac582a/pool.py |
self.head = Git(self.workdir).rev_parse("HEAD") | self.head = Git(self.paths.checkout).rev_parse("HEAD") | def sync(self): """sync stock by updating source versions and importing binaries into the cache""" | bec42009e0647f314e2da7e1465d6d8342ac582a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/bec42009e0647f314e2da7e1465d6d8342ac582a/pool.py |
for subpool in subpools: | for subpool in self.subpools: | def print_info(self): if len(self.stocks): print "# stocks" for stock in self.stocks: addr = stock.link if stock.branch: addr += "#" + stock.branch print addr | 4588c70e3e5137403c9b806ad500cfc57d020d43 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/4588c70e3e5137403c9b806ad500cfc57d020d43/pool.py |
checkout_path = stock.paths.checkout if exists(join(checkout_path, "arena.internals")): command = "cd %s && sumo-close" % commands.mkarg(checkout_path) error = os.system(command) if error: raise Error("failed command: " + command) shutil.rmtree(stock.paths.path) | def unregister(self, stock): dir, branch = self._parse_stock(stock) stock_name = basename(dir) if branch: stock_name += "#" + branch matches = [ stock for stock in self.stocks.values() if stock.link == dir and (not branch or stock.branch == branch) ] if not matches: raise Error("no matches for unregister") | 6d8e479ce6858e29690ba17f229cbe7addab6e2f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/6d8e479ce6858e29690ba17f229cbe7addab6e2f/pool.py |
|
if stock.name in self.subpools: | if isinstance(stock, StockPool): | def unregister(self, stock): dir, branch = self._parse_stock(stock) stock_name = basename(dir) if branch: stock_name += "#" + branch matches = [ stock for stock in self.stocks.values() if stock.link == dir and (not branch or stock.branch == branch) ] if not matches: raise Error("no matches for unregister") | 6d8e479ce6858e29690ba17f229cbe7addab6e2f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/6d8e479ce6858e29690ba17f229cbe7addab6e2f/pool.py |
for name, version in self.pkgcache.list(): packages.add((name, version)) else: newest = {} for name, version in self.pkgcache.list(): if not newest.has_key(name) or newest[name] < version: newest[name] = version for name, version in newest.items(): packages.add((name, version)) return list(packages) | return list(packages) newest = {} for name, version in packages: if not newest.has_key(name) or newest[name] < version: newest[name] = version return newest.items() | def list(self, all_versions=False): """List packages in pool -> list of (name, version) tuples. | da33187959271d3ae9063826d7adcbf11af74502 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/da33187959271d3ae9063826d7adcbf11af74502/pool.py |
commit = orig.rev_parse(self.branch) if not commit: raise Error("no such branch `%s' at %s" % (self.branch, self.link)) checkout.update_ref("refs/heads/" + self.branch, commit) | def dup_branch(branch): commit = orig.rev_parse(branch) if not commit: raise Error("no such branch `%s' at %s" % (branch, self.link)) checkout.update_ref("refs/heads/" + branch, commit) dup_branch(self.branch) | def _get_workdir(self): """Return an initialized workdir path. | e76f0c20c7871164ce3eda2068025d12bac717e5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/e76f0c20c7871164ce3eda2068025d12bac717e5/pool.py |
return self._getoutput("git-rev-parse", rev + "^0") | return self._getoutput("git-rev-parse", rev) | def rev_parse(self, rev): """git-rev-parse <rev>. Returns object-id of parsed rev. Returns None on failure. """ try: return self._getoutput("git-rev-parse", rev + "^0") except self.Error: return None | 35cb41c357f784dd4ac68556b88a232462d1c7e4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5275/35cb41c357f784dd4ac68556b88a232462d1c7e4/git.py |
_require_integer_or_float(timeout) | if timeout is not None: _require_integer_or_float(timeout) | def allow_args_openconn(desthost, destport, localip=None, localport=0, timeout=5): # TODO: the wiki:RepyLibrary gives localport=0 as the default for this function, # slightly different than the localport=None it gives for sendmess(). This # should either be verified as intentional or made the same. _require_string(desthost) _require_integer(destport) # The user must provide either both or neither of localip and localport, # but we're going to let the actual sendmess worry about that. if localip is not None: _require_string(localip) # We accept a localport of None to mean the same thing as 0. if localport is not None: _require_integer(localport) _require_integer_or_float(timeout) | 915e45e4faccdaaf7dfa40921f8ef3ca63e59f80 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/915e45e4faccdaaf7dfa40921f8ef3ca63e59f80/namespace.py |
exitall() | if mycontext['winner'] == None: mycontext['winner'] = 'timer' | def foo(): exitall() | 2d40f0d0ce9fe713ed1f592af05dfda8af50161d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/2d40f0d0ce9fe713ed1f592af05dfda8af50161d/ut_repytests_randomratetest.py |
settimer(.5, foo, ()) | if callfunc == 'initialize': | def foo(): exitall() | 2d40f0d0ce9fe713ed1f592af05dfda8af50161d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/2d40f0d0ce9fe713ed1f592af05dfda8af50161d/ut_repytests_randomratetest.py |
for num in range(50): randomfloat() print "This should be reached when there aren't time restrictions" | for attempt in range(3): sleep(1) mycontext['winner'] = None settimer(.5, foo, ()) for num in range(50): randomfloat() sleep(.00001) if mycontext['winner'] == None: print "This should be reached when there aren't time restrictions" while mycontext['winner'] == None: sleep(.2) | def foo(): exitall() | 2d40f0d0ce9fe713ed1f592af05dfda8af50161d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/2d40f0d0ce9fe713ed1f592af05dfda8af50161d/ut_repytests_randomratetest.py |
test_single(file_path) | if not file_path.startswith('ut_') or len(file_path.split('_'))<3: print "Error, cannot determine module name from filename '"+file_path+"'" return else: module_name = file_path.split('_')[1] files_to_use = [file_path] module_file_list = filter_files(valid_files, module = module_name) files_to_use = files_to_use + filter_files(module_file_list, descriptor = 'setup') files_to_use = files_to_use + filter_files(module_file_list, descriptor = 'shutdown') files_to_use = files_to_use + filter_files(module_file_list, descriptor = 'subprocess') test_module(module_name, files_to_use) | def main(): """ <Purpose> Executes the main program that is the unit testing framework. Tests different modules, files, capabilities, dependent on command line arguments. <Arguments> None <Exceptions> None. <Side Effects> None <Returns> None """ ### ### Define allowed arguments. ### parser = optparse.OptionParser() ### Generic Option Category. group_generic = optparse.OptionGroup(parser, "Generic") # Verbose flag. group_generic.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False, help="verbose output") # Verbose flag. group_generic.add_option("-T", "--show-time", action="store_true", dest="show_time", default=False, help="display the time taken to execute a test.") parser.add_option_group(group_generic) ### Testing Option Category. group_test = optparse.OptionGroup(parser, "Testing") # Test for a specific module. group_test.add_option("-m", "--module", dest="module", help="run tests for a specific module", metavar="MODULE") # Run a specific test file. group_test.add_option("-f", "--file", dest="file", help="execute a specific test file", metavar="FILE") # Run all tests in current directory group_test.add_option("-a", "--all", dest="all", action="store_true", help="execute all test files", metavar="ALL") parser.add_option_group(group_test) # All files in the current working directory. all_files = glob.glob("*") # Valid test files in the current working directory. valid_files = filter_files(all_files) ### # Parse the arguments. ### (options, args) = parser.parse_args() #Count number of args for legal number of args test i = 0 if (options.module): i = i + 1 if (options.all): i = i + 1 if (options.file): i = i + 1 # Test for mutual exclusion. if i > 1: parser.error("Options are mutually exclusive!") # Check if the show_time option is on. if (options.show_time): global SHOW_TIME SHOW_TIME = True if (options.file): # Single file. file_path = options.file test_single(file_path) elif (options.module): # Entire module. # Retrieve the module name. module_name = options.module module_file_list = filter_files(valid_files, module = module_name) test_module(module_name, module_file_list) elif (options.all): #all test files test_all(valid_files) else: # If no options are present, print the usage print "Usage: python utf.py (-f filename | -m modulename | -a)" print "-f -- test a specific filename" print "-m -- test a module of modulename" print "-a -- run all tests in current directory" | 92b354c0bd00c2fe3a0369afa63d725fc601654b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/92b354c0bd00c2fe3a0369afa63d725fc601654b/utf.py |
def test_single(file_path): """ <Purpose> Given the test file path, this function will execute the test using the test framework. | def execute_and_check_program(file_path): """ <Purpose> Given the test file path, this function will execute the program and monitor its behavior | def test_single(file_path): """ <Purpose> Given the test file path, this function will execute the test using the test framework. <Arguments> Test file path. <Exceptions> None. <Side Effects> None <Returns> None """ file_path = os.path.normpath(file_path) testing_monitor(file_path) | 92b354c0bd00c2fe3a0369afa63d725fc601654b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/92b354c0bd00c2fe3a0369afa63d725fc601654b/utf.py |
test_single(setup_file) | execute_and_check_program(setup_file) | def test_module(module_name, module_file_list): """ <Purpose> Execute all test files contained within module_file_list matching the module_name in the form of each test file name 'ut_<module_name>_<descriptor>.py' <Arguments> module_name: module name to be tested module_file_list: a list of files to be filtered by module name and ran through the testing framework <Exceptions> None <Side Effects> None <Returns> None """ print 'Testing module:', module_name setup_file = None # Given all test files for the specified module name, find the file whose # descriptor equals 'setup' (there can be only one such file name). filtered_files = filter_files(module_file_list, descriptor = 'setup') if filtered_files: setup_file = filtered_files.pop() module_file_list.remove(setup_file) subprocess_file = None filtered_files = filter_files(module_file_list, descriptor = 'subprocess') if filtered_files: subprocess_file = filtered_files.pop() module_file_list.remove(subprocess_file) shutdown_file = None # Given all test files for the specified module name, find the file whose # descriptor equals 'shutdown' (there can be only one such file name). filtered_files = filter_files(module_file_list, descriptor = 'shutdown') if filtered_files: shutdown_file = filtered_files.pop() module_file_list.remove(shutdown_file) sub = None # If we must open a process to run concurrently with the tests if subprocess_file: print "Now starting subprocess: " + subprocess_file sub = subprocess.Popen(['python', subprocess_file]) # Give the process time to start time.sleep(30) if setup_file: print "Now running setup script: " + setup_file test_single(setup_file) start_time = time.time() # Run the module tests for test_file in module_file_list: test_single(test_file) end_time = time.time() if shutdown_file: print "Now running shutdown script: " + shutdown_file test_single(shutdown_file) #If we opened a subprocess, we need to be sure to kill it if sub: print "Now killing subprocess: " + subprocess_file if sys.version_info < (2, 6): # Using portablekill instead of os.kill as it is more uniform across os. harshexit.portablekill(sub.pid) else: sub.kill() if SHOW_TIME: print "Total time taken to run tests on module %s is: %s" % (module_name, str(end_time-start_time)[:6]) | 92b354c0bd00c2fe3a0369afa63d725fc601654b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/92b354c0bd00c2fe3a0369afa63d725fc601654b/utf.py |
test_single(test_file) | execute_and_check_program(test_file) | def test_module(module_name, module_file_list): """ <Purpose> Execute all test files contained within module_file_list matching the module_name in the form of each test file name 'ut_<module_name>_<descriptor>.py' <Arguments> module_name: module name to be tested module_file_list: a list of files to be filtered by module name and ran through the testing framework <Exceptions> None <Side Effects> None <Returns> None """ print 'Testing module:', module_name setup_file = None # Given all test files for the specified module name, find the file whose # descriptor equals 'setup' (there can be only one such file name). filtered_files = filter_files(module_file_list, descriptor = 'setup') if filtered_files: setup_file = filtered_files.pop() module_file_list.remove(setup_file) subprocess_file = None filtered_files = filter_files(module_file_list, descriptor = 'subprocess') if filtered_files: subprocess_file = filtered_files.pop() module_file_list.remove(subprocess_file) shutdown_file = None # Given all test files for the specified module name, find the file whose # descriptor equals 'shutdown' (there can be only one such file name). filtered_files = filter_files(module_file_list, descriptor = 'shutdown') if filtered_files: shutdown_file = filtered_files.pop() module_file_list.remove(shutdown_file) sub = None # If we must open a process to run concurrently with the tests if subprocess_file: print "Now starting subprocess: " + subprocess_file sub = subprocess.Popen(['python', subprocess_file]) # Give the process time to start time.sleep(30) if setup_file: print "Now running setup script: " + setup_file test_single(setup_file) start_time = time.time() # Run the module tests for test_file in module_file_list: test_single(test_file) end_time = time.time() if shutdown_file: print "Now running shutdown script: " + shutdown_file test_single(shutdown_file) #If we opened a subprocess, we need to be sure to kill it if sub: print "Now killing subprocess: " + subprocess_file if sys.version_info < (2, 6): # Using portablekill instead of os.kill as it is more uniform across os. harshexit.portablekill(sub.pid) else: sub.kill() if SHOW_TIME: print "Total time taken to run tests on module %s is: %s" % (module_name, str(end_time-start_time)[:6]) | 92b354c0bd00c2fe3a0369afa63d725fc601654b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/92b354c0bd00c2fe3a0369afa63d725fc601654b/utf.py |
test_single(shutdown_file) | execute_and_check_program(shutdown_file) | def test_module(module_name, module_file_list): """ <Purpose> Execute all test files contained within module_file_list matching the module_name in the form of each test file name 'ut_<module_name>_<descriptor>.py' <Arguments> module_name: module name to be tested module_file_list: a list of files to be filtered by module name and ran through the testing framework <Exceptions> None <Side Effects> None <Returns> None """ print 'Testing module:', module_name setup_file = None # Given all test files for the specified module name, find the file whose # descriptor equals 'setup' (there can be only one such file name). filtered_files = filter_files(module_file_list, descriptor = 'setup') if filtered_files: setup_file = filtered_files.pop() module_file_list.remove(setup_file) subprocess_file = None filtered_files = filter_files(module_file_list, descriptor = 'subprocess') if filtered_files: subprocess_file = filtered_files.pop() module_file_list.remove(subprocess_file) shutdown_file = None # Given all test files for the specified module name, find the file whose # descriptor equals 'shutdown' (there can be only one such file name). filtered_files = filter_files(module_file_list, descriptor = 'shutdown') if filtered_files: shutdown_file = filtered_files.pop() module_file_list.remove(shutdown_file) sub = None # If we must open a process to run concurrently with the tests if subprocess_file: print "Now starting subprocess: " + subprocess_file sub = subprocess.Popen(['python', subprocess_file]) # Give the process time to start time.sleep(30) if setup_file: print "Now running setup script: " + setup_file test_single(setup_file) start_time = time.time() # Run the module tests for test_file in module_file_list: test_single(test_file) end_time = time.time() if shutdown_file: print "Now running shutdown script: " + shutdown_file test_single(shutdown_file) #If we opened a subprocess, we need to be sure to kill it if sub: print "Now killing subprocess: " + subprocess_file if sys.version_info < (2, 6): # Using portablekill instead of os.kill as it is more uniform across os. harshexit.portablekill(sub.pid) else: sub.kill() if SHOW_TIME: print "Total time taken to run tests on module %s is: %s" % (module_name, str(end_time-start_time)[:6]) | 92b354c0bd00c2fe3a0369afa63d725fc601654b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/92b354c0bd00c2fe3a0369afa63d725fc601654b/utf.py |
guid=PyRSS2Gen.Guid(config.TESTLOG_URL + datestr.replace(' ', '_')), | guid=PyRSS2Gen.Guid(config.TESTLOG_URL + str(runnumber)), | def _create_rss_file(resultslist): failureitems = [] for (runnumber, revision, resulttext) in resultslist: if resulttext[0].strip() != "SUCCESS": datestr = resulttext[1].strip() dateobj = datetime.datetime.strptime(datestr, "%Y-%m-%d %H:%M:%S") # The PyRSS2Gen module expects this to be in GMT, and python is a pain # for timezone conversion. I'll just hard code assuming the system's in # PST and ignore daylight savings time. dateobj += datetime.timedelta(hours=8) item = PyRSS2Gen.RSSItem( title="Test failure on run number " + str(runnumber) + " using " + revision, link=config.TESTLOG_URL, description="\n".join(resulttext), # Spaces aren't valid in a guid. guid=PyRSS2Gen.Guid(config.TESTLOG_URL + datestr.replace(' ', '_')), pubDate=dateobj) failureitems.append(item) rss = PyRSS2Gen.RSS2( title="Test Failures on " + config.SYSTEM_DESCRIPTION, link=config.TESTLOG_URL, description="Seattle test failures for continuous build on " + config.SYSTEM_DESCRIPTION, lastBuildDate=datetime.datetime.now() + datetime.timedelta(hours=8), items=failureitems) rss.write_xml(open(config.RSS_FILE_NAME + ".new", "w")) os.rename(config.RSS_FILE_NAME + ".new", config.RSS_FILE_NAME) | 66108cc2e075c51bfa10cdc1724901a2d869e77b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/66108cc2e075c51bfa10cdc1724901a2d869e77b/run_all_tests.py |
tcp_time_updatetime(12345) times.append(time_gettime()) | connected_server = tcp_time_updatetime(12345) current_time = time_gettime() times.append(current_time) server_list.append(connected_server) integrationtestlib.log("Calling time_gettime(). Retrieved time: " + str(current_time)) | def main(): # initialize the gmail module success,explanation_str = send_gmail.init_gmail() if not success: integrationtestlib.log(explanation_str) sys.exit(0) notify_str = '' #add Eric Kimbrel to the email notify list integrationtestlib.notify_list.append("[email protected]") integrationtestlib.log("Starting test_time_tcp.py...") # get the time 5 times and make sure they are reasonably close test_start = getruntime() times = [] for i in range (5): try: tcp_time_updatetime(12345) times.append(time_gettime()) except Exception,e: pass test_stop1 = getruntime() if len(times) < 4: # more than one attempt failed notify_str += 'failed to get ntp time via tcp at least twice in 5 attempts' diff = max(times) - min(times) if diff > (test_stop1 - test_start): integrationtestlib.log('WARNING large descrepancy between tcp times: '+str(diff)) notify_str += ' WARNING large descrepancy between tcp times: '+str(diff) try: ntp_time_updatetime(12345) ntp_t = time_gettime() except Exception,e: fail_test(str(e)) test_stop2 = getruntime() diff = ntp_t - max(times) if diff > (8 + test_stop2 - test_stop1): exceedby = diff - (test_stop2-test_stop1) integrationtestlib.log('WARING large descrepancy between ntp and tcp times') notify_str += ' WARNING large descrepancy between ntp and tcp time: '+str(exceedby) if notify_str != '': integrationtestlib.notify(notify_str, "test_time_tcp test failed") else: integrationtestlib.log("Finished running test_time_tcp.py..... Test Passed") print "......................................................\n" | ce5bda691e2b4eac8ebfaedde8ac5b4b083faedd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/ce5bda691e2b4eac8ebfaedde8ac5b4b083faedd/test_time_tcp.py |
def main(): # initialize the gmail module success,explanation_str = send_gmail.init_gmail() if not success: integrationtestlib.log(explanation_str) sys.exit(0) notify_str = '' #add Eric Kimbrel to the email notify list integrationtestlib.notify_list.append("[email protected]") integrationtestlib.log("Starting test_time_tcp.py...") # get the time 5 times and make sure they are reasonably close test_start = getruntime() times = [] for i in range (5): try: tcp_time_updatetime(12345) times.append(time_gettime()) except Exception,e: pass test_stop1 = getruntime() if len(times) < 4: # more than one attempt failed notify_str += 'failed to get ntp time via tcp at least twice in 5 attempts' diff = max(times) - min(times) if diff > (test_stop1 - test_start): integrationtestlib.log('WARNING large descrepancy between tcp times: '+str(diff)) notify_str += ' WARNING large descrepancy between tcp times: '+str(diff) try: ntp_time_updatetime(12345) ntp_t = time_gettime() except Exception,e: fail_test(str(e)) test_stop2 = getruntime() diff = ntp_t - max(times) if diff > (8 + test_stop2 - test_stop1): exceedby = diff - (test_stop2-test_stop1) integrationtestlib.log('WARING large descrepancy between ntp and tcp times') notify_str += ' WARNING large descrepancy between ntp and tcp time: '+str(exceedby) if notify_str != '': integrationtestlib.notify(notify_str, "test_time_tcp test failed") else: integrationtestlib.log("Finished running test_time_tcp.py..... Test Passed") print "......................................................\n" | ce5bda691e2b4eac8ebfaedde8ac5b4b083faedd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/ce5bda691e2b4eac8ebfaedde8ac5b4b083faedd/test_time_tcp.py |
||
notify_str += 'failed to get ntp time via tcp at least twice in 5 attempts' | notify_str += "failed to get ntp time via tcp at least twice in 5 attempts\n\n" notify_str += "Appending a list of all the exceptions returned and servers we attempted to connect to:\n\n" notify_str += str(exception_string_list) | def main(): # initialize the gmail module success,explanation_str = send_gmail.init_gmail() if not success: integrationtestlib.log(explanation_str) sys.exit(0) notify_str = '' #add Eric Kimbrel to the email notify list integrationtestlib.notify_list.append("[email protected]") integrationtestlib.log("Starting test_time_tcp.py...") # get the time 5 times and make sure they are reasonably close test_start = getruntime() times = [] for i in range (5): try: tcp_time_updatetime(12345) times.append(time_gettime()) except Exception,e: pass test_stop1 = getruntime() if len(times) < 4: # more than one attempt failed notify_str += 'failed to get ntp time via tcp at least twice in 5 attempts' diff = max(times) - min(times) if diff > (test_stop1 - test_start): integrationtestlib.log('WARNING large descrepancy between tcp times: '+str(diff)) notify_str += ' WARNING large descrepancy between tcp times: '+str(diff) try: ntp_time_updatetime(12345) ntp_t = time_gettime() except Exception,e: fail_test(str(e)) test_stop2 = getruntime() diff = ntp_t - max(times) if diff > (8 + test_stop2 - test_stop1): exceedby = diff - (test_stop2-test_stop1) integrationtestlib.log('WARING large descrepancy between ntp and tcp times') notify_str += ' WARNING large descrepancy between ntp and tcp time: '+str(exceedby) if notify_str != '': integrationtestlib.notify(notify_str, "test_time_tcp test failed") else: integrationtestlib.log("Finished running test_time_tcp.py..... Test Passed") print "......................................................\n" | ce5bda691e2b4eac8ebfaedde8ac5b4b083faedd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/ce5bda691e2b4eac8ebfaedde8ac5b4b083faedd/test_time_tcp.py |
if diff > (test_stop1 - test_start): integrationtestlib.log('WARNING large descrepancy between tcp times: '+str(diff)) notify_str += ' WARNING large descrepancy between tcp times: '+str(diff) | test_diff = test_stop1 - test_start if math.fabs(diff - test_diff) > 10: fail_test_str += ' WARNING large descrepancy between tcp times. \nThe difference between tcp_time diff and the actual test diff is: '+str(diff - test_diff) fail_test_str += "\n\nThe start time of test was: " + str(test_start) + ". The end time of test was: " + str(test_stop1) fail_test_str += "\n\nThe list of times returned by the tcp_server were: " + str(times) fail_test_str += "\n\nThe max time was: " + str(max(times)) + ". The min time was: " + str(min(times)) fail_test_str += ". \n\nThe tcp diff time was: " + str(diff) + ". This time should have been less then: " + str(test_diff) fail_test_str += "\n\nThe servers we connected to are: " + str(server_list) notify_str += fail_test_str integrationtestlib.log(fail_test_str) integrationtestlib.log("Local time diff: " + str(local_end_time - local_start_time)) | def main(): # initialize the gmail module success,explanation_str = send_gmail.init_gmail() if not success: integrationtestlib.log(explanation_str) sys.exit(0) notify_str = '' #add Eric Kimbrel to the email notify list integrationtestlib.notify_list.append("[email protected]") integrationtestlib.log("Starting test_time_tcp.py...") # get the time 5 times and make sure they are reasonably close test_start = getruntime() times = [] for i in range (5): try: tcp_time_updatetime(12345) times.append(time_gettime()) except Exception,e: pass test_stop1 = getruntime() if len(times) < 4: # more than one attempt failed notify_str += 'failed to get ntp time via tcp at least twice in 5 attempts' diff = max(times) - min(times) if diff > (test_stop1 - test_start): integrationtestlib.log('WARNING large descrepancy between tcp times: '+str(diff)) notify_str += ' WARNING large descrepancy between tcp times: '+str(diff) try: ntp_time_updatetime(12345) ntp_t = time_gettime() except Exception,e: fail_test(str(e)) test_stop2 = getruntime() diff = ntp_t - max(times) if diff > (8 + test_stop2 - test_stop1): exceedby = diff - (test_stop2-test_stop1) integrationtestlib.log('WARING large descrepancy between ntp and tcp times') notify_str += ' WARNING large descrepancy between ntp and tcp time: '+str(exceedby) if notify_str != '': integrationtestlib.notify(notify_str, "test_time_tcp test failed") else: integrationtestlib.log("Finished running test_time_tcp.py..... Test Passed") print "......................................................\n" | ce5bda691e2b4eac8ebfaedde8ac5b4b083faedd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/ce5bda691e2b4eac8ebfaedde8ac5b4b083faedd/test_time_tcp.py |
fail_test(str(e)) | integrationtestlib.log("Failed to call ntp_time_updatetime(). Returned with exception: " +str(e)) notify_str += "\nFailed to call ntp_time_updatetime(). Returned with exception: " +str(e) | def main(): # initialize the gmail module success,explanation_str = send_gmail.init_gmail() if not success: integrationtestlib.log(explanation_str) sys.exit(0) notify_str = '' #add Eric Kimbrel to the email notify list integrationtestlib.notify_list.append("[email protected]") integrationtestlib.log("Starting test_time_tcp.py...") # get the time 5 times and make sure they are reasonably close test_start = getruntime() times = [] for i in range (5): try: tcp_time_updatetime(12345) times.append(time_gettime()) except Exception,e: pass test_stop1 = getruntime() if len(times) < 4: # more than one attempt failed notify_str += 'failed to get ntp time via tcp at least twice in 5 attempts' diff = max(times) - min(times) if diff > (test_stop1 - test_start): integrationtestlib.log('WARNING large descrepancy between tcp times: '+str(diff)) notify_str += ' WARNING large descrepancy between tcp times: '+str(diff) try: ntp_time_updatetime(12345) ntp_t = time_gettime() except Exception,e: fail_test(str(e)) test_stop2 = getruntime() diff = ntp_t - max(times) if diff > (8 + test_stop2 - test_stop1): exceedby = diff - (test_stop2-test_stop1) integrationtestlib.log('WARING large descrepancy between ntp and tcp times') notify_str += ' WARNING large descrepancy between ntp and tcp time: '+str(exceedby) if notify_str != '': integrationtestlib.notify(notify_str, "test_time_tcp test failed") else: integrationtestlib.log("Finished running test_time_tcp.py..... Test Passed") print "......................................................\n" | ce5bda691e2b4eac8ebfaedde8ac5b4b083faedd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/ce5bda691e2b4eac8ebfaedde8ac5b4b083faedd/test_time_tcp.py |
if not os.path.isdir(os.path.dirname(generatedfilename)): | if os.path.dirname(generatedfilename) != '' and not os.path.isdir(os.path.dirname(generatedfilename)): | def _generate_python_file_from_repy(repyfilename, generatedfilename, shared_mycontext, callfunc, callargs): """ Generate a python module from a repy file so it can be imported The first line is TRANSLATION_TAGLINE, so it's easy to detect that the file was automatically generated """ #Start the generation! Print out the header and portability stuff, then include #the original data and translations try: # Create path if it doesn't exist. if not os.path.isdir(os.path.dirname(generatedfilename)): os.makedirs(os.path.dirname(generatedfilename)) fh = open(generatedfilename, "w") except IOError, e: # this is likely a directory permissions error raise TranslationError("Cannot open file for translation '" + repyfilename + "': " + str(e)) # always close the file try: print >> fh, TRANSLATION_TAGLINE, os.path.abspath(repyfilename) print >> fh, WARNING_LABEL print >> fh, "from repyportability import *" print >> fh, "import repyhelper" if shared_mycontext: print >> fh, "mycontext = repyhelper.get_shared_context()" else: print >> fh, "mycontext = {}" print >> fh, "callfunc =", repr(callfunc) #Properly format the callargs list. Assume it only contains python strings print >> fh, "callargs =", repr(callargs) print >> fh _process_output_file(fh, repyfilename, generatedfilename) # append the TRANSLATION_TAGLINE so that we can see if the operation was # interrupted (#617) print >> fh print >> fh, TRANSLATION_TAGLINE, os.path.abspath(repyfilename) except IOError, e: raise TranslationError("Error translating file " + repyfilename + ": " + str(e)) finally: fh.close() | f349a69738f908d819d2da61f3429758e778a150 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/f349a69738f908d819d2da61f3429758e778a150/repyhelper.py |
acceptor_state['lock'].acquire() result = acceptor_state['started'] acceptor_state['lock'].release() | accepter_state['lock'].acquire() result = accepter_state['started'] accepter_state['lock'].release() | def is_accepter_started(): acceptor_state['lock'].acquire() result = acceptor_state['started'] acceptor_state['lock'].release() return result | 2c9c5b7fc404ccd32abcef46ddc80bdf58179782 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/2c9c5b7fc404ccd32abcef46ddc80bdf58179782/nmmain.py |
if is_accepter_started(): | if not node_reset_config['reset_accepter'] and is_accepter_started(): | def start_accepter(): shimstack = ShimStackInterface('(NatDeciderShim)') unique_id = rsa_publickey_to_string(configuration['publickey']) unique_id = sha_hexhash(unique_id) + str(configuration['service_vessel']) # do this until we get the accepter started... while True: if is_accepter_started(): # we're done, return the name! return myname else: for possibleport in configuration['ports']: try: servicelogger.log("[INFO]: Trying to wait") shimstack.waitforconn(unique_id, possibleport, nmconnectionmanager.connection_handler) except Exception, e: servicelogger.log("[ERROR]: when calling waitforconn for the connection_handler: " + str(e)) servicelogger.log_last_exception() else: # the waitforconn was completed so the acceptor is started acceptor_state['lock'].acquire() acceptor_state['started']= True acceptor_state['lock'].release() # assign the nodemanager name myname = unique_id + ":" + str(possibleport) servicelogger.log("[INFO]: Now listening as " + myname) break else: servicelogger.log("[ERROR]: cannot find a port for waitforconn.") # check infrequently time.sleep(configuration['pollfrequency']) | 2c9c5b7fc404ccd32abcef46ddc80bdf58179782 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/2c9c5b7fc404ccd32abcef46ddc80bdf58179782/nmmain.py |
def start_accepter(): shimstack = ShimStackInterface('(NatDeciderShim)') unique_id = rsa_publickey_to_string(configuration['publickey']) unique_id = sha_hexhash(unique_id) + str(configuration['service_vessel']) # do this until we get the accepter started... while True: if is_accepter_started(): # we're done, return the name! return myname else: for possibleport in configuration['ports']: try: servicelogger.log("[INFO]: Trying to wait") shimstack.waitforconn(unique_id, possibleport, nmconnectionmanager.connection_handler) except Exception, e: servicelogger.log("[ERROR]: when calling waitforconn for the connection_handler: " + str(e)) servicelogger.log_last_exception() else: # the waitforconn was completed so the acceptor is started acceptor_state['lock'].acquire() acceptor_state['started']= True acceptor_state['lock'].release() # assign the nodemanager name myname = unique_id + ":" + str(possibleport) servicelogger.log("[INFO]: Now listening as " + myname) break else: servicelogger.log("[ERROR]: cannot find a port for waitforconn.") # check infrequently time.sleep(configuration['pollfrequency']) | 2c9c5b7fc404ccd32abcef46ddc80bdf58179782 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/2c9c5b7fc404ccd32abcef46ddc80bdf58179782/nmmain.py |
||
acceptor_state['lock'].acquire() acceptor_state['started']= True acceptor_state['lock'].release() | accepter_state['lock'].acquire() accepter_state['started']= True accepter_state['lock'].release() | def start_accepter(): shimstack = ShimStackInterface('(NatDeciderShim)') unique_id = rsa_publickey_to_string(configuration['publickey']) unique_id = sha_hexhash(unique_id) + str(configuration['service_vessel']) # do this until we get the accepter started... while True: if is_accepter_started(): # we're done, return the name! return myname else: for possibleport in configuration['ports']: try: servicelogger.log("[INFO]: Trying to wait") shimstack.waitforconn(unique_id, possibleport, nmconnectionmanager.connection_handler) except Exception, e: servicelogger.log("[ERROR]: when calling waitforconn for the connection_handler: " + str(e)) servicelogger.log_last_exception() else: # the waitforconn was completed so the acceptor is started acceptor_state['lock'].acquire() acceptor_state['started']= True acceptor_state['lock'].release() # assign the nodemanager name myname = unique_id + ":" + str(possibleport) servicelogger.log("[INFO]: Now listening as " + myname) break else: servicelogger.log("[ERROR]: cannot find a port for waitforconn.") # check infrequently time.sleep(configuration['pollfrequency']) | 2c9c5b7fc404ccd32abcef46ddc80bdf58179782 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/2c9c5b7fc404ccd32abcef46ddc80bdf58179782/nmmain.py |
def main(): global configuration if not FOREGROUND: # Background ourselves. daemon.daemonize() # ensure that only one instance is running at a time... gotlock = runonce.getprocesslock("seattlenodemanager") if gotlock == True: # I got the lock. All is well... pass else: if gotlock: servicelogger.log("[ERROR]:Another node manager process (pid: " + str(gotlock) + ") is running") else: servicelogger.log("[ERROR]:Another node manager process is running") return # I'll grab the necessary information first... servicelogger.log("[INFO]:Loading config") # BUG: Do this better? Is this the right way to engineer this? configuration = persist.restore_object("nodeman.cfg") # Armon: initialize the network restrictions initialize_ip_interface_restrictions(configuration) # ZACK BOKA: For Linux and Darwin systems, check to make sure that the new # seattle crontab entry has been installed in the crontab. # Do this here because the "nodeman.cfg" needs to have been read # into configuration via the persist module. if nonportable.ostype == 'Linux' or nonportable.ostype == 'Darwin': if 'crontab_updated_for_2009_installer' not in configuration or \ configuration['crontab_updated_for_2009_installer'] == False: try: import update_crontab_entry modified_crontab_entry = \ update_crontab_entry.modify_seattle_crontab_entry() # If updating the seattle crontab entry succeeded, then update the # 'crontab_updated_for_2009_installer' so the nodemanager no longer # tries to update the crontab entry when it starts up. if modified_crontab_entry: configuration['crontab_updated_for_2009_installer'] = True persist.commit_object(configuration,"nodeman.cfg") except Exception,e: exception_traceback_string = traceback.format_exc() servicelogger.log("[ERROR]: The following error occured when " \ + "modifying the crontab for the new 2009 " \ + "seattle crontab entry: " \ + exception_traceback_string) # get the external IP address... # BUG: What if my external IP changes? (A problem throughout) myip = None while True: try: # Try to find our external IP. myip = emulcomm.getmyip() except Exception, e: # If we aren't connected to the internet, emulcomm.getmyip() raises this: if len(e.args) >= 1 and e.args[0] == "Cannot detect a connection to the Internet.": # So we try again. pass else: # It wasn't emulcomm.getmyip()'s exception. re-raise. raise else: # We succeeded in getting our external IP. Leave the loop. break time.sleep(0.1) vesseldict = nmrequesthandler.initialize(myip, configuration['publickey'], version) # Start accepter... myname = start_accepter() #send our advertised name to the log servicelogger.log('myname = '+str(myname)) # Start worker thread... start_worker_thread(configuration['pollfrequency']) # Start advert thread... start_advert_thread(vesseldict, myname, configuration['publickey']) # Start status thread... start_status_thread(vesseldict,configuration['pollfrequency']) # we should be all set up now. servicelogger.log("[INFO]:Started") # I will count my iterations through the loop so that I can log a message # periodically. This makes it clear I am alive. times_through_the_loop = 0 # BUG: Need to exit all when we're being upgraded while True: # E.K Previous there was a check to ensure that the acceptor # thread was started. There is no way to actually check this # and this code was never executed, so i removed it completely if not is_worker_thread_started(): servicelogger.log("[WARN]:At " + str(time.time()) + " restarting worker...") start_worker_thread(configuration['pollfrequency']) if should_start_waitable_thread('advert','Advertisement Thread'): servicelogger.log("[WARN]:At " + str(time.time()) + " restarting advert...") start_advert_thread(vesseldict, myname, configuration['publickey']) if should_start_waitable_thread('status','Status Monitoring Thread'): servicelogger.log("[WARN]:At " + str(time.time()) + " restarting status...") start_status_thread(vesseldict,configuration['pollfrequency']) if not runonce.stillhaveprocesslock("seattlenodemanager"): servicelogger.log("[ERROR]:The node manager lost the process lock...") harshexit.harshexit(55) time.sleep(configuration['pollfrequency']) # if I've been through the loop enough times, log this... times_through_the_loop = times_through_the_loop + 1 if times_through_the_loop % LOG_AFTER_THIS_MANY_ITERATIONS == 0: servicelogger.log("[INFO]: node manager is alive...") | 2c9c5b7fc404ccd32abcef46ddc80bdf58179782 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/2c9c5b7fc404ccd32abcef46ddc80bdf58179782/nmmain.py |
||
def main(): global configuration if not FOREGROUND: # Background ourselves. daemon.daemonize() # ensure that only one instance is running at a time... gotlock = runonce.getprocesslock("seattlenodemanager") if gotlock == True: # I got the lock. All is well... pass else: if gotlock: servicelogger.log("[ERROR]:Another node manager process (pid: " + str(gotlock) + ") is running") else: servicelogger.log("[ERROR]:Another node manager process is running") return # I'll grab the necessary information first... servicelogger.log("[INFO]:Loading config") # BUG: Do this better? Is this the right way to engineer this? configuration = persist.restore_object("nodeman.cfg") # Armon: initialize the network restrictions initialize_ip_interface_restrictions(configuration) # ZACK BOKA: For Linux and Darwin systems, check to make sure that the new # seattle crontab entry has been installed in the crontab. # Do this here because the "nodeman.cfg" needs to have been read # into configuration via the persist module. if nonportable.ostype == 'Linux' or nonportable.ostype == 'Darwin': if 'crontab_updated_for_2009_installer' not in configuration or \ configuration['crontab_updated_for_2009_installer'] == False: try: import update_crontab_entry modified_crontab_entry = \ update_crontab_entry.modify_seattle_crontab_entry() # If updating the seattle crontab entry succeeded, then update the # 'crontab_updated_for_2009_installer' so the nodemanager no longer # tries to update the crontab entry when it starts up. if modified_crontab_entry: configuration['crontab_updated_for_2009_installer'] = True persist.commit_object(configuration,"nodeman.cfg") except Exception,e: exception_traceback_string = traceback.format_exc() servicelogger.log("[ERROR]: The following error occured when " \ + "modifying the crontab for the new 2009 " \ + "seattle crontab entry: " \ + exception_traceback_string) # get the external IP address... # BUG: What if my external IP changes? (A problem throughout) myip = None while True: try: # Try to find our external IP. myip = emulcomm.getmyip() except Exception, e: # If we aren't connected to the internet, emulcomm.getmyip() raises this: if len(e.args) >= 1 and e.args[0] == "Cannot detect a connection to the Internet.": # So we try again. pass else: # It wasn't emulcomm.getmyip()'s exception. re-raise. raise else: # We succeeded in getting our external IP. Leave the loop. break time.sleep(0.1) vesseldict = nmrequesthandler.initialize(myip, configuration['publickey'], version) # Start accepter... myname = start_accepter() #send our advertised name to the log servicelogger.log('myname = '+str(myname)) # Start worker thread... start_worker_thread(configuration['pollfrequency']) # Start advert thread... start_advert_thread(vesseldict, myname, configuration['publickey']) # Start status thread... start_status_thread(vesseldict,configuration['pollfrequency']) # we should be all set up now. servicelogger.log("[INFO]:Started") # I will count my iterations through the loop so that I can log a message # periodically. This makes it clear I am alive. times_through_the_loop = 0 # BUG: Need to exit all when we're being upgraded while True: # E.K Previous there was a check to ensure that the acceptor # thread was started. There is no way to actually check this # and this code was never executed, so i removed it completely if not is_worker_thread_started(): servicelogger.log("[WARN]:At " + str(time.time()) + " restarting worker...") start_worker_thread(configuration['pollfrequency']) if should_start_waitable_thread('advert','Advertisement Thread'): servicelogger.log("[WARN]:At " + str(time.time()) + " restarting advert...") start_advert_thread(vesseldict, myname, configuration['publickey']) if should_start_waitable_thread('status','Status Monitoring Thread'): servicelogger.log("[WARN]:At " + str(time.time()) + " restarting status...") start_status_thread(vesseldict,configuration['pollfrequency']) if not runonce.stillhaveprocesslock("seattlenodemanager"): servicelogger.log("[ERROR]:The node manager lost the process lock...") harshexit.harshexit(55) time.sleep(configuration['pollfrequency']) # if I've been through the loop enough times, log this... times_through_the_loop = times_through_the_loop + 1 if times_through_the_loop % LOG_AFTER_THIS_MANY_ITERATIONS == 0: servicelogger.log("[INFO]: node manager is alive...") | 2c9c5b7fc404ccd32abcef46ddc80bdf58179782 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/2c9c5b7fc404ccd32abcef46ddc80bdf58179782/nmmain.py |
||
if mycontext['maxlag'] > 4: | if mycontext['maxlag'] > 2: | def check_and_exit(): if mycontext['maxlag'] > 4: print "UDP packets lag too long in the buffer: ", mycontext['maxlag'] if mycontext['maxlag'] == 0: print "UDP packets were not received or had 0 lag" exitall() | de4a8f088d7b017fa9dbb51eaf728048f32fed07 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/de4a8f088d7b017fa9dbb51eaf728048f32fed07/ut_repytests_testudpbuffersize.py |
sockobj.send("%9f "%getruntime()) | sockobj.send("%9f "%getruntime() + " "*90) | def sendforever(sockobj): while True: # send a message that is around 100 bytes sockobj.send("%9f "%getruntime()) | a9c6168baa22424dd7e989a33ee0778d92a18470 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/a9c6168baa22424dd7e989a33ee0778d92a18470/ut_repytests_testtcpbuffersize.py |
sendtime = float(connobj.recv(10).split()[0]) | sendtime = float(connobj.recv(100).strip().split()[0]) | def handleconnection(ip, port, connobj, ch, mainch): while True: sendtime = float(connobj.recv(10).split()[0]) lag = getruntime() - sendtime if mycontext['maxlag'] < lag: mycontext['maxlag'] = lag | a9c6168baa22424dd7e989a33ee0778d92a18470 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/a9c6168baa22424dd7e989a33ee0778d92a18470/ut_repytests_testtcpbuffersize.py |
if mycontext['maxlag'] > 4: | if mycontext['maxlag'] > 2: | def check_and_exit(): if mycontext['maxlag'] > 4: print "TCP packets lag too long in the buffer: ", mycontext['maxlag'] if mycontext['maxlag'] == 0: print "TCP packets were not received or had 0 lag" exitall() | a9c6168baa22424dd7e989a33ee0778d92a18470 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/a9c6168baa22424dd7e989a33ee0778d92a18470/ut_repytests_testtcpbuffersize.py |
copy_to_target("production_nat_new/src/nmpatch/nmmain.py", target_dir) copy_to_target("production_nat_new/src/nmpatch/nmclient.repy", target_dir) copy_to_target("production_nat_new/src/nmpatch/sockettimeout.repy", target_dir) copy_to_target("production_nat_new/src/nmpatch/ShimStackInterface.repy", target_dir) | def main(): repytest = False RANDOMPORTS = False target_dir = None for arg in sys.argv[1:]: # -t means we will copy repy tests if arg == '-t': repytest = True # The user wants us to fill in the port numbers randomly. elif arg == '-randomports': RANDOMPORTS = True # Not a flag? Assume it's the target directory else: target_dir = arg # We need a target dir. If one isn't found in argv, quit. if target_dir is None: help_exit("Please pass the target directory as a parameter.") #store root directory current_dir = os.getcwd() # Make sure they gave us a valid directory if not( os.path.isdir(target_dir) ): help_exit("given foldername is not a directory") #set working directory to the test folder os.chdir(target_dir) files_to_remove = glob.glob("*") #clean the test folder for f in files_to_remove: if os.path.isdir(f): shutil.rmtree(f) else: os.remove(f) #go back to root project directory os.chdir(current_dir) #now we copy the necessary files to the test folder copy_to_target("repy/*", target_dir) copy_to_target("nodemanager/*", target_dir) copy_to_target("portability/*", target_dir) copy_to_target("seattlelib/*", target_dir) copy_to_target("seash/*", target_dir) copy_to_target("softwareupdater/*", target_dir) copy_to_target("autograder/nm_remote_api.mix", target_dir) copy_to_target("keydaemon/*", target_dir) # The license must be included in anything we distribute. copy_to_target("LICENSE.TXT", target_dir) # Copy over the files needed for using shim. copy_to_target("production_nat_new/src/nmpatch/nmmain.py", target_dir) copy_to_target("production_nat_new/src/nmpatch/nmclient.repy", target_dir) copy_to_target("production_nat_new/src/nmpatch/sockettimeout.repy", target_dir) copy_to_target("production_nat_new/src/nmpatch/ShimStackInterface.repy", target_dir) # Only copy the tests if they were requested. if repytest: # The test framework itself. copy_to_target("utf/*.py", target_dir) # The various tests. copy_to_target("repy/tests/*", target_dir) copy_to_target("nodemanager/tests/*", target_dir) copy_to_target("portability/tests/*", target_dir) copy_to_target("seash/tests/*", target_dir) copy_to_target("oddball/tests/*", target_dir) copy_to_target("seattlelib/tests/*", target_dir) copy_to_target("keydaemon/tests/*", target_dir) copy_to_target("utf/tests/*", target_dir) # jsamuel: This file, dist/update_crontab_entry.py, is directly included by # make_base_installers and appears to be a candidate for removal someday. # I assume zackrb needed this for installer testing. copy_to_target("dist/update_crontab_entry.py", target_dir) #set working directory to the test folder os.chdir(target_dir) #call the process_mix function to process all mix files in the target directory process_mix("repypp.py") # set up dynamic port information if RANDOMPORTS: portstouseasints = random.sample(range(52000, 53000), 3) portstouseasstr = [] for portint in portstouseasints: portstouseasstr.append(str(portint)) print "Randomly chosen ports: ",portstouseasstr testportfiller.replace_ports(portstouseasstr, portstouseasstr) else: # if this isn't specified, just use the default ports... testportfiller.replace_ports(['12345','12346','12347'], ['12345','12346','12347']) #go back to root project directory os.chdir(current_dir) | 18f2df8a7db9cf2f36003cd18801ab306ca077dd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/18f2df8a7db9cf2f36003cd18801ab306ca077dd/preparetest.py |
|
def start_vessel(vesselhandle, identity, program_file, arg_list=[]): | def start_vessel(vesselhandle, identity, program_file, arg_list=None): | def start_vessel(vesselhandle, identity, program_file, arg_list=[]): """ <Purpose> Start a program running on a vessel. <Arguments> vesselhandle The vesselhandle of the vessel that is to be started. identity The identity of either the owner or a user of the vessel. program_file The name of the file that already exists on the vessel that is to be run on the vessel. arg_list (optional) A list of arguments to be passed to the program when it is started. <Exceptions> NodeCommunicationError If communication with the node failed, either because the node is down, the communication timed out, the signature was invalid, or the identity unauthorized for this action. <Side Effects> The vessel has been started, running the specified program. <Returns> None """ _validate_vesselhandle(vesselhandle) arg_list.insert(0, program_file) arg_string = " ".join(arg_list) _do_signed_vessel_request(identity, vesselhandle, "StartVessel", arg_string) | d8dfc51fa9873871f273631cac4fa1d828cbb7cf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/d8dfc51fa9873871f273631cac4fa1d828cbb7cf/experimentlib.py |
arg_list.insert(0, program_file) arg_string = " ".join(arg_list) | arg_string = program_file if arg_list is not None: arg_string += " " + " ".join(arg_list) | def start_vessel(vesselhandle, identity, program_file, arg_list=[]): """ <Purpose> Start a program running on a vessel. <Arguments> vesselhandle The vesselhandle of the vessel that is to be started. identity The identity of either the owner or a user of the vessel. program_file The name of the file that already exists on the vessel that is to be run on the vessel. arg_list (optional) A list of arguments to be passed to the program when it is started. <Exceptions> NodeCommunicationError If communication with the node failed, either because the node is down, the communication timed out, the signature was invalid, or the identity unauthorized for this action. <Side Effects> The vessel has been started, running the specified program. <Returns> None """ _validate_vesselhandle(vesselhandle) arg_list.insert(0, program_file) arg_string = " ".join(arg_list) _do_signed_vessel_request(identity, vesselhandle, "StartVessel", arg_string) | d8dfc51fa9873871f273631cac4fa1d828cbb7cf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/d8dfc51fa9873871f273631cac4fa1d828cbb7cf/experimentlib.py |
raise UserError("There is an error in autosave: '" + str(error) + "'. You can turn off autosave using the command 'set autosave off'.") | raise seash_exceptions.UserError("There is an error in autosave: '" + str(error) + "'. You can turn off autosave using the command 'set autosave off'.") | def command_loop(): # Things that may be set herein and used in later commands. # Contains the local variables of the original command loop. # Keeps track of the user's state in seash. Referenced # during command executions by the command_parser. environment_dict = { 'host': None, 'port': None, 'expnum': None, 'filename': None, 'cmdargs': None, 'defaulttarget': None, 'defaultkeyname': None, 'currenttarget': None, 'currentkeyname': None, 'autosave': False, 'handleinfo': {} } # Set up the tab completion environment (Added by Danny Y. Huang) if tabcompletion: completer = TabCompleter() readline.parse_and_bind("tab: complete") readline.set_completer_delims(" ") readline.set_completer(completer.complete) # exit via a return while True: try: # Saving state after each command? (Added by Danny Y. Huang) if environment_dict['autosave'] and environment_dict['defaultkeyname']: try: # State is saved in file "autosave_username", so that user knows which # RSA private key to use to reload the state. autosavefn = "autosave_" + str(environment_dict['defaultkeyname']) seash_helper.savestate(autosavefn, environment_dict['handleinfo'], environment_dict['host'], environment_dict['port'], environment_dict['expnum'], environment_dict['filename'], environment_dict['cmdargs'], environment_dict['defaulttarget'], environment_dict['defaultkeyname'], environment_dict['autosave'], environment_dict['defaultkeyname']) except Exception, error: raise UserError("There is an error in autosave: '" + str(error) + "'. You can turn off autosave using the command 'set autosave off'.") prompt = '' if environment_dict['defaultkeyname']: prompt = seash_helper.fit_string(environment_dict['defaultkeyname'],20)+"@" # display the thing they are acting on in their prompt (if applicable) if environment_dict['defaulttarget']: prompt = prompt + seash_helper.fit_string(environment_dict['defaulttarget'],20) prompt = prompt + " !> " # the prompt should look like: justin@good !> # get the user input userinput = raw_input(prompt) if len(userinput)==0: continue # Returns the dictionary of dictionaries that correspond to the # command the user inputted cmd_input = seash_dictionary.parse_command(userinput) # by default, use the target specified in the prompt environment_dict['currenttarget'] = environment_dict['defaulttarget'] # by default, use the identity specified in the prompt environment_dict['currentkeyname'] = environment_dict['defaultkeyname'] # calls the command_dispatch method of seash_dictionary to execute the callback # method associated with the command the user inputed seash_dictionary.command_dispatch(cmd_input, environment_dict) | b558d0ab07364df0135677f61e50ddecbe3cf72f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/b558d0ab07364df0135677f61e50ddecbe3cf72f/seash.py |
def test_module(module_name, module_file_list): """ <Purpose> Execute all test files contained within module_file_list matching the module_name in the form of each test file name 'ut_<module_name>_<descriptor>.py' <Arguments> module_name: module name to be tested module_file_list: a list of files to be filtered by module name and ran through the testing framework <Exceptions> None <Side Effects> None <Returns> None """ print 'Testing module:', module_name setup_file = None # Given all test files for the specified module name, find the file whose # descriptor equals 'setup' (there can be only one such file name). filtered_files = filter_files(module_file_list, descriptor = 'setup') if filtered_files: setup_file = filtered_files.pop() module_file_list.remove(setup_file) subprocess_file = None filtered_files = filter_files(module_file_list, descriptor = 'subprocess') if filtered_files: subprocess_file = filtered_files.pop() module_file_list.remove(subprocess_file) shutdown_file = None # Given all test files for the specified module name, find the file whose # descriptor equals 'shutdown' (there can be only one such file name). filtered_files = filter_files(module_file_list, descriptor = 'shutdown') if filtered_files: shutdown_file = filtered_files.pop() module_file_list.remove(shutdown_file) sub = None # If we must open a process to run on the side of if subprocess_file: print "Now starting subprocess: " + subprocess_file sub = subprocess.Popen(['python', subprocess_file]) time.sleep(10) if setup_file: print "Now running setup script: " + setup_file test_single(setup_file) for test_file in module_file_list: test_single(test_file) if shutdown_file: print "Now running shutdown script: " + shutdown_file test_single(shutdown_file) #If we opened a subprocess, we need to be sure to kill it if sub: print "Now killing subprocess: " + subprocess_file if sys.version_info < (2, 6): os.kill(sub.pid, signal.SIGTERM) else: sub.kill() | 62d38796680cf39be37739fcad4ef8a8118404d5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/62d38796680cf39be37739fcad4ef8a8118404d5/utf.py |
||
time.sleep(10) | time.sleep(30) | def test_module(module_name, module_file_list): """ <Purpose> Execute all test files contained within module_file_list matching the module_name in the form of each test file name 'ut_<module_name>_<descriptor>.py' <Arguments> module_name: module name to be tested module_file_list: a list of files to be filtered by module name and ran through the testing framework <Exceptions> None <Side Effects> None <Returns> None """ print 'Testing module:', module_name setup_file = None # Given all test files for the specified module name, find the file whose # descriptor equals 'setup' (there can be only one such file name). filtered_files = filter_files(module_file_list, descriptor = 'setup') if filtered_files: setup_file = filtered_files.pop() module_file_list.remove(setup_file) subprocess_file = None filtered_files = filter_files(module_file_list, descriptor = 'subprocess') if filtered_files: subprocess_file = filtered_files.pop() module_file_list.remove(subprocess_file) shutdown_file = None # Given all test files for the specified module name, find the file whose # descriptor equals 'shutdown' (there can be only one such file name). filtered_files = filter_files(module_file_list, descriptor = 'shutdown') if filtered_files: shutdown_file = filtered_files.pop() module_file_list.remove(shutdown_file) sub = None # If we must open a process to run on the side of if subprocess_file: print "Now starting subprocess: " + subprocess_file sub = subprocess.Popen(['python', subprocess_file]) time.sleep(10) if setup_file: print "Now running setup script: " + setup_file test_single(setup_file) for test_file in module_file_list: test_single(test_file) if shutdown_file: print "Now running shutdown script: " + shutdown_file test_single(shutdown_file) #If we opened a subprocess, we need to be sure to kill it if sub: print "Now killing subprocess: " + subprocess_file if sys.version_info < (2, 6): os.kill(sub.pid, signal.SIGTERM) else: sub.kill() | 62d38796680cf39be37739fcad4ef8a8118404d5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/62d38796680cf39be37739fcad4ef8a8118404d5/utf.py |
msg = "[" + vessel['location'] + "] Skipping: vesselname is not: " + VESSELNAME_TO_SET_USER_KEYS_ON | msg = "[" + vessel['nodelocation'] + "] Skipping: vesselname is not: " + VESSELNAME_TO_SET_USER_KEYS_ON | def set_keys(vessel, identity): """ The first argument will be a vesseldict rather than a vesselhandle because we passed the result of get_vessels_on_nodes to run_parallelized. """ if vessel['vesselname'] != VESSELNAME_TO_SET_USER_KEYS_ON: msg = "[" + vessel['location'] + "] Skipping: vesselname is not: " + VESSELNAME_TO_SET_USER_KEYS_ON print(msg) raise Exception(msg) if vessel['userkeys'] != USERKEY_LIST: print("[" + vessel['location'] + "] Setting user keys.") try: experimentlib.set_vessel_users(vessel['handle'], identity, USERKEY_LIST) except Exception, e: msg = "[" + vessel['location'] + "] Failure: " + str(e) print(msg) import traceback traceback.print_exc() raise Exception(msg) else: print("[" + vessel['location'] + "] Success.") else: print("[" + vessel['location'] + "] Already had correct user keys.") | e9a0bc711bc23dc085fe73da22a3d0dcc767d637 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/e9a0bc711bc23dc085fe73da22a3d0dcc767d637/set_user_keys.py |
print("[" + vessel['location'] + "] Setting user keys.") | print("[" + vessel['nodelocation'] + "] Setting user keys.") | def set_keys(vessel, identity): """ The first argument will be a vesseldict rather than a vesselhandle because we passed the result of get_vessels_on_nodes to run_parallelized. """ if vessel['vesselname'] != VESSELNAME_TO_SET_USER_KEYS_ON: msg = "[" + vessel['location'] + "] Skipping: vesselname is not: " + VESSELNAME_TO_SET_USER_KEYS_ON print(msg) raise Exception(msg) if vessel['userkeys'] != USERKEY_LIST: print("[" + vessel['location'] + "] Setting user keys.") try: experimentlib.set_vessel_users(vessel['handle'], identity, USERKEY_LIST) except Exception, e: msg = "[" + vessel['location'] + "] Failure: " + str(e) print(msg) import traceback traceback.print_exc() raise Exception(msg) else: print("[" + vessel['location'] + "] Success.") else: print("[" + vessel['location'] + "] Already had correct user keys.") | e9a0bc711bc23dc085fe73da22a3d0dcc767d637 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/e9a0bc711bc23dc085fe73da22a3d0dcc767d637/set_user_keys.py |
experimentlib.set_vessel_users(vessel['handle'], identity, USERKEY_LIST) | experimentlib.set_vessel_users(vessel['vesselhandle'], identity, USERKEY_LIST) | def set_keys(vessel, identity): """ The first argument will be a vesseldict rather than a vesselhandle because we passed the result of get_vessels_on_nodes to run_parallelized. """ if vessel['vesselname'] != VESSELNAME_TO_SET_USER_KEYS_ON: msg = "[" + vessel['location'] + "] Skipping: vesselname is not: " + VESSELNAME_TO_SET_USER_KEYS_ON print(msg) raise Exception(msg) if vessel['userkeys'] != USERKEY_LIST: print("[" + vessel['location'] + "] Setting user keys.") try: experimentlib.set_vessel_users(vessel['handle'], identity, USERKEY_LIST) except Exception, e: msg = "[" + vessel['location'] + "] Failure: " + str(e) print(msg) import traceback traceback.print_exc() raise Exception(msg) else: print("[" + vessel['location'] + "] Success.") else: print("[" + vessel['location'] + "] Already had correct user keys.") | e9a0bc711bc23dc085fe73da22a3d0dcc767d637 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/e9a0bc711bc23dc085fe73da22a3d0dcc767d637/set_user_keys.py |
msg = "[" + vessel['location'] + "] Failure: " + str(e) | msg = "[" + vessel['nodelocation'] + "] Failure: " + str(e) | def set_keys(vessel, identity): """ The first argument will be a vesseldict rather than a vesselhandle because we passed the result of get_vessels_on_nodes to run_parallelized. """ if vessel['vesselname'] != VESSELNAME_TO_SET_USER_KEYS_ON: msg = "[" + vessel['location'] + "] Skipping: vesselname is not: " + VESSELNAME_TO_SET_USER_KEYS_ON print(msg) raise Exception(msg) if vessel['userkeys'] != USERKEY_LIST: print("[" + vessel['location'] + "] Setting user keys.") try: experimentlib.set_vessel_users(vessel['handle'], identity, USERKEY_LIST) except Exception, e: msg = "[" + vessel['location'] + "] Failure: " + str(e) print(msg) import traceback traceback.print_exc() raise Exception(msg) else: print("[" + vessel['location'] + "] Success.") else: print("[" + vessel['location'] + "] Already had correct user keys.") | e9a0bc711bc23dc085fe73da22a3d0dcc767d637 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/e9a0bc711bc23dc085fe73da22a3d0dcc767d637/set_user_keys.py |
print("[" + vessel['location'] + "] Success.") | print("[" + vessel['nodelocation'] + "] Success.") | def set_keys(vessel, identity): """ The first argument will be a vesseldict rather than a vesselhandle because we passed the result of get_vessels_on_nodes to run_parallelized. """ if vessel['vesselname'] != VESSELNAME_TO_SET_USER_KEYS_ON: msg = "[" + vessel['location'] + "] Skipping: vesselname is not: " + VESSELNAME_TO_SET_USER_KEYS_ON print(msg) raise Exception(msg) if vessel['userkeys'] != USERKEY_LIST: print("[" + vessel['location'] + "] Setting user keys.") try: experimentlib.set_vessel_users(vessel['handle'], identity, USERKEY_LIST) except Exception, e: msg = "[" + vessel['location'] + "] Failure: " + str(e) print(msg) import traceback traceback.print_exc() raise Exception(msg) else: print("[" + vessel['location'] + "] Success.") else: print("[" + vessel['location'] + "] Already had correct user keys.") | e9a0bc711bc23dc085fe73da22a3d0dcc767d637 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/e9a0bc711bc23dc085fe73da22a3d0dcc767d637/set_user_keys.py |
print("[" + vessel['location'] + "] Already had correct user keys.") | print("[" + vessel['nodelocation'] + "] Already had correct user keys.") | def set_keys(vessel, identity): """ The first argument will be a vesseldict rather than a vesselhandle because we passed the result of get_vessels_on_nodes to run_parallelized. """ if vessel['vesselname'] != VESSELNAME_TO_SET_USER_KEYS_ON: msg = "[" + vessel['location'] + "] Skipping: vesselname is not: " + VESSELNAME_TO_SET_USER_KEYS_ON print(msg) raise Exception(msg) if vessel['userkeys'] != USERKEY_LIST: print("[" + vessel['location'] + "] Setting user keys.") try: experimentlib.set_vessel_users(vessel['handle'], identity, USERKEY_LIST) except Exception, e: msg = "[" + vessel['location'] + "] Failure: " + str(e) print(msg) import traceback traceback.print_exc() raise Exception(msg) else: print("[" + vessel['location'] + "] Success.") else: print("[" + vessel['location'] + "] Already had correct user keys.") | e9a0bc711bc23dc085fe73da22a3d0dcc767d637 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/e9a0bc711bc23dc085fe73da22a3d0dcc767d637/set_user_keys.py |
if not first_line.startswith(TRANSLATION_TAGLINE): | if not first_line.startswith(ENCODING_STRING) or not second_line.startswith(TRANSLATION_TAGLINE): | def _translation_is_needed(repyfilename, generatedfile): """ Checks if generatedfile needs to be regenerated. Does several checks to decide if generating generatedfilename based on repyfilename is a good idea. --does file already exist? --was it automatically generated? --was it generated from the same source file? --was the original modified since the last translation? """ if not os.path.isfile(repyfilename): raise TranslationError("no such file:", repyfilename) if not os.path.isfile(generatedfile): return True #Read the first line try: fh = open(generatedfile, "r") first_line = fh.readline().rstrip() current_line = '' for line in fh: current_line = line last_line = current_line fh.close() except IOError, e: raise TranslationError("Error opening old generated file: " + generatedfile + ": " + str(e)) #Check to see if the file was generated by repyhelper, to prevent #clobbering a file that we didn't create if not first_line.startswith(TRANSLATION_TAGLINE): raise TranslationError("File name exists but wasn't automatically generated: " + generatedfile) if not last_line.startswith(TRANSLATION_TAGLINE): # The file generation wasn't completed... I think this means we should # silently regenerate (#617) return True #Check to see if the generated file has the same original source old_translation_path = first_line[len(TRANSLATION_TAGLINE):].strip() generated_abs_path = os.path.abspath(repyfilename) if old_translation_path != generated_abs_path: #It doesn't match, but the other file was also a translation! Regen then... return True #If we get here and modification time of orig is older than gen, this is still #a valid generation repystat = os.stat(repyfilename) genstat = os.stat(generatedfile) if repystat.st_mtime < genstat.st_mtime: return False return True | 35fbd126b7c8696094436868629efcaa038e96c4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/35fbd126b7c8696094436868629efcaa038e96c4/repyhelper.py |
data, addr = entry['socket'].recvfrom(4096) | data, addr = entry['socket'].recvfrom(65535) | def start_event(entry, handle,eventhandle): if entry['type'] == 'UDP': # some sort of socket error, I'll assume they closed the socket or it's # not important try: # NOTE: is 4096 a reasonable maximum datagram size? data, addr = entry['socket'].recvfrom(4096) except socket.error: # they closed in the meantime? nanny.tattle_remove_item('events',eventhandle) return # wait if we're over the limit if data: if is_loopback(entry['localip']): nanny.tattle_quantity('looprecv',len(data)) else: nanny.tattle_quantity('netrecv',len(data)) else: # no data... Let's stop this... nanny.tattle_remove_item('events',eventhandle) return try: EventDeliverer(entry['function'],(addr[0], addr[1], data, handle), eventhandle).start() except: # This is an internal error I think... # This will cause the program to exit and log things if logging is # enabled. -Brent tracebackrepy.handle_internalerror("Can't start UDP EventDeliverer", 29) # or it's a TCP accept event... elif entry['type'] == 'TCP': try: realsocket, addr = entry['socket'].accept() except socket.error: # they closed in the meantime? nanny.tattle_remove_item('events',eventhandle) return # put this handle in the table newhandle = generate_commhandle() comminfo[newhandle] = {'type':'TCP','remotehost':addr[0], 'remoteport':addr[1],'localip':entry['localip'],'localport':entry['localport'],'socket':realsocket,'outgoing':True, 'closing_lock':threading.Lock()} # I don't think it makes sense to count this as an outgoing socket, does # it? # Armon: Create the emulated socket after the table entry safesocket = emulated_socket(newhandle) try: EventDeliverer(entry['function'],(addr[0], addr[1], safesocket, newhandle, handle),eventhandle).start() except: # This is an internal error I think... # This will cause the program to exit and log things if logging is # enabled. -Brent tracebackrepy.handle_internalerror("Can't start TCP EventDeliverer", 23) else: # Should never get here # This will cause the program to exit and log things if logging is # enabled. -Brent tracebackrepy.handle_internalerror("In start event, Unknown entry type", 51) | 0279ec85664b99b804cb9d07743d989c315efe82 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/0279ec85664b99b804cb9d07743d989c315efe82/emulcomm.py |
raise TranslationError("File name exists but wasn't automatically generated: " + generatedfile) | if not first_line.startswith(TRANSLATION_TAGLINE): raise TranslationError("File name exists but wasn't automatically generated: " + generatedfile) | def _translation_is_needed(repyfilename, generatedfile): """ Checks if generatedfile needs to be regenerated. Does several checks to decide if generating generatedfilename based on repyfilename is a good idea. --does file already exist? --was it automatically generated? --was it generated from the same source file? --was the original modified since the last translation? """ if not os.path.isfile(repyfilename): raise TranslationError("no such file:", repyfilename) if not os.path.isfile(generatedfile): return True #Read the first line try: fh = open(generatedfile, "r") first_line = fh.readline().rstrip() second_line = fh.readline().rstrip() current_line = '' for line in fh: current_line = line last_line = current_line fh.close() except IOError, e: raise TranslationError("Error opening old generated file: " + generatedfile + ": " + str(e)) #Check to see if the file was generated by repyhelper, to prevent #clobbering a file that we didn't create if not first_line.startswith(ENCODING_STRING) or not second_line.startswith(TRANSLATION_TAGLINE): raise TranslationError("File name exists but wasn't automatically generated: " + generatedfile) if not last_line.startswith(TRANSLATION_TAGLINE): # The file generation wasn't completed... I think this means we should # silently regenerate (#617) return True #Check to see if the generated file has the same original source old_translation_path = first_line[len(TRANSLATION_TAGLINE):].strip() generated_abs_path = os.path.abspath(repyfilename) if old_translation_path != generated_abs_path: #It doesn't match, but the other file was also a translation! Regen then... return True #If we get here and modification time of orig is older than gen, this is still #a valid generation repystat = os.stat(repyfilename) genstat = os.stat(generatedfile) if repystat.st_mtime < genstat.st_mtime: return False return True | 5af41b878021bad0493a6dee230567cab8fc3f01 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/5af41b878021bad0493a6dee230567cab8fc3f01/repyhelper.py |
actual_time = after_stop_event[1] - before_stop_event[1] diff_time = actual_time - expected_time | api_start = before_stop_event[1] api_end = after_stop_event[1] actual_time = api_end - api_start all_stops = get_stoptimes_on_interval(api_start, api_end) all_stoptimes = 0 for stop in all_stops: TOS, stop_amount = stop all_stoptimes += stop_amount | def commit_time(thread_dict, TOC): resource = thread_dict["resource"] thread_dict[resource] += TOC - thread_dict["begin"] thread_dict["begin"] = TOC | a0862f2f0f70573664ad719ff30496ba1d2d6164 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/a0862f2f0f70573664ad719ff30496ba1d2d6164/island_stats.py |
if diff_time > amount: commit_time(thread_dict, TOC) thread_dict["begin"] = resume_time thread_dict["stopped"] += amount | if all_stoptimes > expected_time: if all_stops[0][0] == TOC: resource_time = max(expected_time, actual_time - all_stoptimes) thread_dict[thread_dict["resource"]] += resource_time thread_dict["begin"] = api_end thread_dict["stopped"] += actual_time - resource_time | def commit_time(thread_dict, TOC): resource = thread_dict["resource"] thread_dict[resource] += TOC - thread_dict["begin"] thread_dict["begin"] = TOC | a0862f2f0f70573664ad719ff30496ba1d2d6164 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/a0862f2f0f70573664ad719ff30496ba1d2d6164/island_stats.py |
if thread != ALL_THREADS: for type in TIME_UTIL_KEYS: total_time[type] += thread_dict[type] | if thread_dict is total_time: continue for type in TIME_UTIL_KEYS: total_time[type] += thread_dict[type] | def commit_time(thread_dict, TOC): resource = thread_dict["resource"] thread_dict[resource] += TOC - thread_dict["begin"] thread_dict["begin"] = TOC | a0862f2f0f70573664ad719ff30496ba1d2d6164 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/a0862f2f0f70573664ad719ff30496ba1d2d6164/island_stats.py |
def exec_repy_script(filename, restrictionsfile, arguments={}, script_args=''): | def exec_repy_script(filename, restrictionsfile, arguments=None, script_args=''): | def exec_repy_script(filename, restrictionsfile, arguments={}, script_args=''): global mobileNoSubprocess if script_args != '': script_args = ' ' + script_args if not mobileNoSubprocess: # Convert arguments arg_string = arguments_to_string(arguments) return exec_command('python repy.py ' + arg_string + restrictionsfile + ' ' + filename + script_args) else: if os.path.isfile(repy_constants.PATH_SEATTLE_INSTALL + "execlog.out.old"): os.remove(repy_constants.PATH_SEATTLE_INSTALL + "execlog.out.old") if os.path.isfile(repy_constants.PATH_SEATTLE_INSTALL + "execlog.out.new"): os.remove(repy_constants.PATH_SEATTLE_INSTALL + "execlog.out.new") # Set default values arguments.setdefault("logfile", "execlog.out") arguments.setdefault("cwd", "\"" + repy_constants.PATH_SEATTLE_INSTALL + "\"") # Convert arguments arg_string = arguments_to_string(arguments) repy_path = "\"" + repy_constants.PATH_SEATTLE_INSTALL + "repy.py" + "\"" cmd = arg_string + restrictionsfile + " \"" + repy_constants.PATH_SEATTLE_INSTALL + filename + "\"" + script_args #print cmd childpid = windowsAPI.launchPythonScript(repy_path, cmd) # Wait for Child to finish execution windowsAPI.waitForProcess(childpid) time.sleep(5) if os.path.isfile(repy_constants.PATH_SEATTLE_INSTALL + "execlog.out.old"): theout = file(repy_constants.PATH_SEATTLE_INSTALL + "execlog.out.old", "r") output = theout.read() theout.close() else: output = '' return (output, '') | 29a657b3e3f44dc0b8b0304f8a11227e53da1438 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/29a657b3e3f44dc0b8b0304f8a11227e53da1438/run_tests.py |
if platform.machine().startswith('armv'): _output('Seattle is being installed on a Nokia N800/900 Internet Tablet.') import pwd if pwd.getpwuid(os.getuid())[0] != 'root': _output('Please run the installer as root. This can be done by ' \ + 'installing/using the rootsh or openssh package.') return continue_install = prepare_installation(opts,args) if not continue_install: return urandom_test_succeeded = test_urandom_implemented() if not urandom_test_succeeded: return benchmarking_succeeded = perform_system_benchmarking() if not benchmarking_succeeded: return if DISABLE_INSTALL: return if OS == "Windows" or OS == "WindowsCE": customize_win_batch_files() _output("Done!") if OS == "WindowsCE": _output("Configuring python for WindowsCE...") setup_sitecustomize() _output("Done!") | def main(): if OS not in SUPPORTED_OSES: raise UnsupportedOSError("This operating system is not supported.") # Begin pre-installation process. # Pre-install: parse the passed-in arguments. try: # Armon: Changed getopt to accept parameters for Repy and NM IP/Iface # restrictions, also a special disable flag opts, args = getopt.getopt(sys.argv[1:], "s", ["percent=", "nm-key-bitsize=","nm-ip=", "nm-iface=","repy-ip=","repy-iface=", "repy-nootherips","onlynetwork", "disable-startup-script","usage"]) except getopt.GetoptError, err: print str(err) usage() return # Derek Cheng: if the user is running a Nokia N800 tablet, we require them # to be on root first in order to have files created in the /etc/init.d and # /etc/rc2.d directories. if platform.machine().startswith('armv'): _output('Seattle is being installed on a Nokia N800/900 Internet Tablet.') # JAC: I can't import this on Windows, so will do it here... import pwd # if the current user name is not 'root' if pwd.getpwuid(os.getuid())[0] != 'root': _output('Please run the installer as root. This can be done by ' \ + 'installing/using the rootsh or openssh package.') return # Pre-install: process the passed-in arguments, and set up the configuration # dictionary. continue_install = prepare_installation(opts,args) if not continue_install: return # Pre-install: run all tests and benchmarking. # test_urandom_implemented() MUST be performed before # perform_system_benchmarking() to get relevant results from the # benchmarking. urandom_test_succeeded = test_urandom_implemented() if not urandom_test_succeeded: return benchmarking_succeeded = perform_system_benchmarking() if not benchmarking_succeeded: return # Begin installation. if DISABLE_INSTALL: return # First, customize any scripts since they may be copied to new locations when # configuring seattle to run automatically at boot. # If running on a Windows system, customize the batch files. if OS == "Windows" or OS == "WindowsCE": customize_win_batch_files() _output("Done!") # If running on WindowsCE, setup the sitecustomize.py file. if OS == "WindowsCE": _output("Configuring python for WindowsCE...") setup_sitecustomize() _output("Done!") # Configure seattle to run at startup. if not DISABLE_STARTUP_SCRIPT: _output("Preparing Seattle to run automatically at startup...") # This try: block attempts to install seattle to run at startup. If it # fails, continue on with the rest of the install process (unless it # detects that seattle has already been installed) since the seattle # starter script may still be run even if seattle is not configured to run # at boot. try: # Any errors generated while configuring seattle to run at startup will be # printed in the child functions, unless an unexpected error is raised, # which will be caught in the general except Exception: block below. if OS == "Windows" or OS == "WindowsCE": setup_win_startup() _output("Seattle is setup to run at startup!") elif OS == "Linux" or OS == "Darwin": setup_success = setup_linux_or_mac_startup() if setup_success == None: # Do not print a final message to the user about setting up seattle to # run automatically at startup. pass elif setup_success: _output("Seattle is setup to run at startup!") else: # The reasons for which seattle was unable to be configured at startup # will have been logged by the service logger in the # setup_linux_or_mac_startup() function, and output for the possible # reasons why configuration to run at startup failed will have already # be given to the user from the setup_linux_or_mac_startup() function. _output("Seattle failed to be configured to run automatically at " \ + "startup.") else: raise UnsupportedOSError("This operating system is not supported.") except UnsupportedOSError,u: raise UnsupportedOSError(u) except AlreadyInstalledError,a: _output("seattle was already installed. " + str(a)) # Exit installation since seattle is already currently installed. return # If an unpredicted error is raised while setting up seattle to run at # startup, it is caught here. except Exception,e: _output("seattle could not be installed to run automatically at " \ + "startup for the following reason: " + str(e)) _output("Continuing with the installation process now. To manually " \ + "run seattle at any time, just run " \ + get_starter_file_name() + " from within the seattle " \ + "directory.") _output("Please contact the seattle project for further assistance.") servicelogger.log(time.strftime(" seattle was NOT installed on this " \ + "system for the following reason: " \ + str(e) + ". %m-%d-%Y %H:%M:%S")) # Generate the Node Manager keys even if configuring seattle to run # automatically at boot fails because Node Manager keys are needed for the # seattle_starter script which can be run at any time. _output("Generating the Node Manager RSA keys. This may take a few " \ + "minutes...") createnodekeys.initialize_keys(KEYBITSIZE, nodemanager_directory=SEATTLE_FILES_DIR) _output("Keys generated!") # Modify nodeman.cfg so the start_seattle script knows that seattle has been # installed. This is a new feature that will require seattle to have been # installed before it can be started. configuration = persist.restore_object("nodeman.cfg") configuration['seattle_installed'] = True persist.commit_object(configuration,"nodeman.cfg") # Everything has been installed, so start seattle and print concluding output # messages. _output("Starting seattle...") try: start_seattle() except Exception,e: _output("seattle could not be started for the following reason: " + str(e)) _output("Please contact the seattle project immediately for assistance.") servicelogger.log(time.strftime(" seattle installation failed. seattle " \ + "could not be started for the " \ + "following reason: " + str(e) + " " \ + "%m-%d-%Y %H:%M:%S")) else: _output("seattle has been installed!") _output("To learn more about useful, optional scripts related to running " \ + "seattle, see the README file.") servicelogger.log(time.strftime(" seattle completed installation on: " \ + "%m-%d-%Y %H:%M:%S")) | 456716f9f962bbdd263f3293dbf27268249362cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/456716f9f962bbdd263f3293dbf27268249362cb/seattleinstaller.py |
|
def init(geni_username, vesselcount, vesseltype, program_filename, *args): | def init(geni_username, vesselcount, vesseltype, program_filename): | def init(geni_username, vesselcount, vesseltype, program_filename, *args): """ <Purpose> Initializes the deployment of an arbitrary service. Populates a global configuration dictionary and returns a dict of data that could be required by the run() function. init() must be called before the run() function. Note on the return dict: The return value of init() is meant to contain data that is needed by calls to explib.start_vessel() within the run() function. At the time of creation of this library, the only such data that is required by deployable services is the user's GENI port. To add support for services requiring more arguments, simply add the necessary data to the dictionary returned by this function. <Arguments> geni_username SeattleGENI username. Used to locate and handle public and private key files. vesselcount The number of vessels on which to deploy. vesseltype The type of vessel to acquire, based on the SEATTLEGENI_VESSEL_TYPE_* constants within experimentlib.py program_filename The filename of the program to deploy and monitor on vessels. *args [Optional] Any additional arguments will be passed to the program deployed on vessels. <Exceptions> ValueError Raised if argument vesseltype doesn't match one of the experimentlib SEATTLEGENI_VESSEL_TYPE_* constants, if argument program file does not exist, or if argument number of vessels on which to deploy exceeds the user's number of vessel credits. <Side Effects> Initializes certain global variables. <Returns> A dictionary containing data that clients might need for running program on vessels. """ # Fill config dict with argument data # Validate vesseltype, based on constants in explib if vesseltype not in [explib.SEATTLEGENI_VESSEL_TYPE_WAN, explib.SEATTLEGENI_VESSEL_TYPE_LAN, explib.SEATTLEGENI_VESSEL_TYPE_NAT, explib.SEATTLEGENI_VESSEL_TYPE_RAND]: raise ValueError('Invalid vessel type specified. Argument vessel type must be one of the SEATTLEGENI_VESSEL_TYPE_* constants defined in experimentlib.py') config['vesseltype'] = vesseltype # Verify that program file exists if not os.path.isfile(program_filename): raise ValueError('Specified program file ' + program_filename + ' does not exist') config['program_filename'] = program_filename # Setup explib identity object and GENI details config['identity'] = explib.create_identity_from_key_files( geni_username + '.publickey', geni_username + '.privatekey') config['geni_port'] = explib.seattlegeni_user_port(config['identity']) # Validate number of vessels on which to deploy num_vslcredits = explib.seattlegeni_max_vessels_allowed(config['identity']) if vesselcount > num_vslcredits: raise ValueError('Invalid number of vessels specified. The number of deployed vessels must be less than or equal to the user\'s number of vessel credits.') config['vesselcount'] = vesselcount # Create and populate the return dict ret_dict = { 'geni_port': config['geni_port'] } return ret_dict | c350a143212d411e5944d5c012b1612f03ddbde4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/c350a143212d411e5944d5c012b1612f03ddbde4/overlord.py |
*args [Optional] Any additional arguments will be passed to the program deployed on vessels. | def init(geni_username, vesselcount, vesseltype, program_filename, *args): """ <Purpose> Initializes the deployment of an arbitrary service. Populates a global configuration dictionary and returns a dict of data that could be required by the run() function. init() must be called before the run() function. Note on the return dict: The return value of init() is meant to contain data that is needed by calls to explib.start_vessel() within the run() function. At the time of creation of this library, the only such data that is required by deployable services is the user's GENI port. To add support for services requiring more arguments, simply add the necessary data to the dictionary returned by this function. <Arguments> geni_username SeattleGENI username. Used to locate and handle public and private key files. vesselcount The number of vessels on which to deploy. vesseltype The type of vessel to acquire, based on the SEATTLEGENI_VESSEL_TYPE_* constants within experimentlib.py program_filename The filename of the program to deploy and monitor on vessels. *args [Optional] Any additional arguments will be passed to the program deployed on vessels. <Exceptions> ValueError Raised if argument vesseltype doesn't match one of the experimentlib SEATTLEGENI_VESSEL_TYPE_* constants, if argument program file does not exist, or if argument number of vessels on which to deploy exceeds the user's number of vessel credits. <Side Effects> Initializes certain global variables. <Returns> A dictionary containing data that clients might need for running program on vessels. """ # Fill config dict with argument data # Validate vesseltype, based on constants in explib if vesseltype not in [explib.SEATTLEGENI_VESSEL_TYPE_WAN, explib.SEATTLEGENI_VESSEL_TYPE_LAN, explib.SEATTLEGENI_VESSEL_TYPE_NAT, explib.SEATTLEGENI_VESSEL_TYPE_RAND]: raise ValueError('Invalid vessel type specified. Argument vessel type must be one of the SEATTLEGENI_VESSEL_TYPE_* constants defined in experimentlib.py') config['vesseltype'] = vesseltype # Verify that program file exists if not os.path.isfile(program_filename): raise ValueError('Specified program file ' + program_filename + ' does not exist') config['program_filename'] = program_filename # Setup explib identity object and GENI details config['identity'] = explib.create_identity_from_key_files( geni_username + '.publickey', geni_username + '.privatekey') config['geni_port'] = explib.seattlegeni_user_port(config['identity']) # Validate number of vessels on which to deploy num_vslcredits = explib.seattlegeni_max_vessels_allowed(config['identity']) if vesselcount > num_vslcredits: raise ValueError('Invalid number of vessels specified. The number of deployed vessels must be less than or equal to the user\'s number of vessel credits.') config['vesselcount'] = vesselcount # Create and populate the return dict ret_dict = { 'geni_port': config['geni_port'] } return ret_dict | c350a143212d411e5944d5c012b1612f03ddbde4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/c350a143212d411e5944d5c012b1612f03ddbde4/overlord.py |
|
return True | return True | def assertisallowed(call,*args): # let's pre-reject certain open / file calls #print call_rule_table[call] matches = find_action(call_rule_table[call], args) action, matched_rule, reasoning = matches[0] if action == 'allow': return True elif action == 'deny': matches.reverse() estr = "Call '"+str(call)+"' with args "+str(args)+" not allowed\n" estr += "Matching dump:\n" for action, matched_rule, reasoning in matches: if matched_rule != '': estr += "rule: "+str(matched_rule) + ", " estr += str(reasoning) + "\n" raise Exception, estr elif action == 'prompt': # would do an upcall here... raise Exception, "Call '"+ str(call)+"' not allowed" else: # This will cause the program to exit and log things if logging is # enabled. -Brent tracebackrepy.handle_internalerror("find_action returned '" + str(action) + "' for call '" + str(call) + "'", 31) | ded42c126586fbaf5ba6246be776420f00c914a9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/ded42c126586fbaf5ba6246be776420f00c914a9/restrictions.py |
_call_seattlegeni_func(client.renew_vessels, vesselhandle_list) | _call_seattlegeni_func(client.renew_resources, vesselhandle_list) | def seattlegeni_renew_vessels(identity, vesselhandle_list): """ <Purpose> Renew vessels previously acquired from SeattleGENI. <Arguments> identity The identity to use for communicating with SeattleGENI. vesselhandle_list The vessels to be renewed. <Exceptions> The common SeattleGENI exceptions described in the module comments, as well as: SeattleGENINotEnoughCredits If the account is currently over its vessel credit limit, then vessels cannot be renewed until the account is no longer over its credit limit. <Side Effects> The expiration time of the vessels is is reset to the maximum. <Returns> None """ _validate_vesselhandle_list(vesselhandle_list) client = _get_seattlegeni_client(identity) _call_seattlegeni_func(client.renew_vessels, vesselhandle_list) | db6b30c971c0adeeae6bed8a26724eb31dc1ad19 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/db6b30c971c0adeeae6bed8a26724eb31dc1ad19/experimentlib.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.