Ejemplo n.º 1
0
def nvram():
    if not hal.supportsCto():
        # Arguably this should be fixed for pre-CTO Legacy Cases,
        # Belknap vs. MicroMemory, and for Belknap: dd vs memtest
        # But let's just leave well enough alone, no changes.
        consts = {
            'long'  : {'iterations': 500, 'checkpoint': 500//2},
            'short' : {'iterations': 80, 'checkpoint': 80//2},
            'quick' : {'iterations': 2, 'checkpoint': 2//2},
            }
    else: # CTO
        # Handle Belknap vs Rocketfuel individually
        # ASSUMING ONLY dd-based nvramscrub testing is done, in CTO forward
        # IF we start using isi_memtest again, add code here to distinguish?
        nvram_consts = {
            hwver.NVR_UNKNOWN: {
            'long'  : {'iterations': 0, 'checkpoint': 0},
            'short' : {'iterations': 0, 'checkpoint': 0},
            'quick' : {'iterations': 0, 'checkpoint': 0},
            },
            hwver.NVR_MT25208: {
            # See bug 76718 comment 5
            # With dd, Wingfoot,  500iter=7927s => 6h=1362iter, use 1200
            # With dd, Blueflame, 500iter=7303s => 6h=1385iter, use 1200
            'long'  : {'iterations': 3000, 'checkpoint': 600},           # jcc was 1200
            'short' : {'iterations':  400, 'checkpoint': 200},
            'quick' : {'iterations':    2, 'checkpoint':   1},
            },
            }
        if hal.getNvramType() in nvram_consts:
            consts = nvram_consts.get(hal.getNvramType())
        else:
            # Including NVR_MM5425, NVR_VMWARE, NVR_ROCKETFUEL
            consts = nvram_consts.get(hwver.NVR_UNKNOWN)
    return consts
Ejemplo n.º 2
0
def eeprom():
    if not hal.supportsCto():
        consts = {
            'long'  : {'iterations':  16, 'length':None },
            'short' : {'iterations':   4, 'length':None },
            'quick' : {'iterations':   1, 'length':4*1024 },
            }
    else: # CTO
        # See comments at top; We're not actively using this,
        # so for CTO release just scale (6 hour nodeburn, not 8 hour)
        consts = {
            'long'  : {'iterations':  12, 'length':None },
            'short' : {'iterations':   4, 'length':None },
            'quick' : {'iterations':   1, 'length':4*1024 },
            }
    return consts
Ejemplo n.º 3
0
def lcd():
    if not hal.supportsCto():
        # Leave legacy alone, unchanged
        consts = {
            'long'  : {'iterations': 4000},
            'short' : {'iterations': 600},
            'quick' : {'iterations': 2},
            }
    else: # CTO
        # Bug 76718 comment 5: CTO: Targeting 6 hour long runtime: 
        # using 3200 iters, scale short iters accordingly: 3200./4000*600=480
        consts = {
            'long'  : {'iterations': 5000},           # jcc was 3200
            'short' : {'iterations': 480},
            'quick' : {'iterations': 2},
            }
    return consts
Ejemplo n.º 4
0
def run(const_key='long',
        pass_count=None, partition=None, type=None,
        stripe_mult=None,
        runtime=None):
    #import pdb; pdb.set_trace()   #jcc
    if None in [pass_count, partition, type, stripe_mult]:
        consts_disk = consts.disk()
        if not const_key in consts_disk:
            log = loglib.get_logger()
            log.fail('Unknown Diskscrub key "%s"' % const_key, 0)
            return 1 # hard fail
        consts_disk = consts_disk[const_key]
        if pass_count is None:
            pass_count = consts_disk['pass_count']
        if partition is None:
            partition = consts_disk['partition']
        if type is None:
            type = consts_disk['type']
        if stripe_mult is None:
            stripe_mult = consts_disk['stripe_mult']

    # For CTO, and eventually everyone (TBD), new stripe_mult method:
    # Rather than hard-coding 'long' and 'short' stripe_mult values
    # that are hand-tuned to specific runtimes (e.g. long=8hour),
    # use a normalized bandwidth factor, per drive, and the desired
    # test runtime to calculate an appropriate stripe_mult value.
    # (However, there may be complications; e.g, normalized BW factor
    # for a given drive may be different for different platforms,
    # such as a 3.5" SATA drive on a Graham vs. Wingfoot. For now,
    # only using this for CTO, we don't have any such problems.)
    # For CTO 6.5.2 release: default long=6hour, not 8hour
    cto_default_runtimes = {'long':6*60*60, 'short':2*60*60}

    # jcc start
    # Hard to put timer, fork() and singal handingly limiter.
    cto_default_runtimes = consts.disk_target_run_time()
    log = loglib.get_logger()
    #import pdb; pdb.set_trace()   #jcc
    # jcc end

    if hal.supportsCto() and const_key in cto_default_runtimes:
        if runtime is None:
            runtime = cto_default_runtimes.get(const_key)

    result = 0
    log.out('[diskscrub] start: target_run_time is %s seconds;' % (runtime)) # jcc 

    # Find an unused diskscrub dir on the remote server
    localdir = loglib.get_logger().get_unused_logdir('diskscrub', create=False)
    if localdir is None:
        return 1 # hard fail

    # Extract disk-specific stripe_mult values
    # Use local copy stripe_mult_info for PyChecker warning
    stripe_mult_info = get_stripe_mult_info(stripe_mult, runtime, pass_count)
    if stripe_mult_info is None:
        return 1 # hard fail

    args = {
        'const_key'        : const_key,
        'partition'        : partition,
        'scrub_type'       : type,
        'pass_count'       : pass_count,
        'output_dir'       : localdir,
        'prompt_for_range' : False,
        }
    # For PyChecker warning: Don't have explanation, but assigning
    # this value in args declaration above causes this warning:
    #  Modifying parameter (stripe_mult) with a default value may have
    #  unexpected consequences
    args['stripe_mult'] = stripe_mult_info

    watcher = watchdog.CPUIdleWatchdog(interval_minutes=10,max_fails=3,
                                       max_cpu=98.0)
    watcher.start('Starting CPU watchdog')
    try:
        result = diskscrub.run(**args)
    finally:
        watcher.stop('Stopping CPU watchdog')

    return result
Ejemplo n.º 5
0
def net():
    if not hal.supportsCto():
        if hwver.netiface_hasIB:
            consts = {
                'long'  : {'mode'            : 'intranode',
                           'nett_iterations' : 800, # was 900     # jcc was 800
                           'ttcp_iterations' : 125, # was 150
                           },
                'short' : {'mode'            : 'intranode',
                           'nett_iterations' : 20, 
                           'ttcp_iterations' : 100, # was 150
                           },
                'quick' : {'mode'            : 'intranode',
                           'nett_iterations' : 1,
                           'ttcp_iterations' : 2, 
                           },
                }
        else:
            consts = {
                'long'  : {'mode'            : 'intranode',
                           'nett_iterations' : 3000, # was 3500
                           'ttcp_iterations' : 0,
                           },
                'short' : {'mode'            : 'intranode',
                           'nett_iterations' : 500,  # was 0
                           'ttcp_iterations' : 0,
                           },
                'quick' : {'mode'            : 'intranode',
                           'nett_iterations' : 5,
                           'ttcp_iterations' : 0, 
                           },
                }
    else: # CTO
        # See bug 76718, bug 76868; For now, just scale pre-CTO values
        # by a factor of 2: If pre-CTO is 8h, 8h/2 = 4h < 6h
        if hwver.netiface_hasIB:
            consts = {
                'long'  : {'mode'            : 'intranode',
                           'nett_iterations' : 800 // 2,           # jcc was 800
                           'ttcp_iterations' : 125 // 2,
                           },
                'short' : {'mode'            : 'intranode',
                           'nett_iterations' : 20 // 2, 
                           'ttcp_iterations' : 100 // 2,
                           },
                'quick' : {'mode'            : 'intranode',
                           'nett_iterations' : 1,
                           'ttcp_iterations' : 2, 
                           },
                }
        else:
            consts = {
                'long'  : {'mode'            : 'intranode',
                           'nett_iterations' : 3000 // 2,
                           'ttcp_iterations' : 0,
                           },
                'short' : {'mode'            : 'intranode',
                           'nett_iterations' : 500 // 2,
                           'ttcp_iterations' : 0,
                           },
                'quick' : {'mode'            : 'intranode',
                           'nett_iterations' : 5,
                           'ttcp_iterations' : 0, 
                           },
                }
    return consts