def test_ostmap_from_cache_gz(): """lfshealth.LfsOstMap: read from cache file """ tokiotest.TEMP_FILE.close() tokiotest.gunzip(tokiotest.SAMPLE_LCTL_DL_T_FILE, tokiotest.TEMP_FILE.name) ostmap = tokio.connectors.lfshealth.LfsOstMap( cache_file=tokiotest.TEMP_FILE.name) verify_ost(ostmap, input_type='ostmap')
def test_ostfullness_from_cache_gz(): """lfshealth.LfsOstFullness: read from cache file """ tokiotest.TEMP_FILE.close() tokiotest.gunzip(tokiotest.SAMPLE_LFS_DF_FILE, tokiotest.TEMP_FILE.name) ostfullness = tokio.connectors.lfshealth.LfsOstFullness( cache_file=tokiotest.TEMP_FILE.name) verify_ost(ostfullness, input_type='ostfullness')
def test_tar_input(): """connectors.mmperfmon.Mmperfmon, .tar input file """ tokiotest.gunzip(tokiotest.SAMPLE_MMPERFMON_TGZ_INPUT, tokiotest.SAMPLE_MMPERFMON_TAR_INPUT) print("Loading from %s" % tokiotest.SAMPLE_MMPERFMON_TAR_INPUT) mmp_data = tokio.connectors.mmperfmon.Mmperfmon(tokiotest.SAMPLE_MMPERFMON_TAR_INPUT) tokiotest.try_unlink(tokiotest.SAMPLE_MMPERFMON_TAR_INPUT) validate_object(mmp_data)
def test_tar_input(): """ Load NerscIsdct from .tar input files (no compression) """ tokiotest.gunzip(SAMPLE_TGZ_INPUT, SAMPLE_TAR_INPUT) isdct_data = tokio.connectors.nersc_isdct.NerscIsdct(SAMPLE_TAR_INPUT) tokiotest.try_unlink(SAMPLE_TAR_INPUT) validate_object(isdct_data)
def test_json_input(): """ Load NerscIsdct from uncompressed serialized json """ tokiotest.gunzip(SAMPLE_JSON_GZ_INPUT, SAMPLE_JSON_INPUT) isdct_data = tokio.connectors.nersc_isdct.NerscIsdct(SAMPLE_JSON_INPUT) tokiotest.try_unlink(SAMPLE_JSON_INPUT) validate_object(isdct_data)
def test_craysdbproc_from_cache(): """ Initialize CraySdb from decompressed cache """ # Create an uncompressed cache file tokiotest.TEMP_FILE.close() tokiotest.gunzip(tokiotest.SAMPLE_XTDB2PROC_FILE, tokiotest.TEMP_FILE.name) print("Decompressed %s to %s" % (tokiotest.SAMPLE_XTDB2PROC_FILE, tokiotest.TEMP_FILE.name)) # Read from a cache file craysdbproc = tokio.connectors.craysdb.CraySdbProc( tokiotest.TEMP_FILE.name) verify_craysdbproc(craysdbproc)