Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add option to run nplone in subdir #118

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions etc/auto-smashbox.conf
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ del extraSetup
# number of seconds to sleep at each step (there is a lag of max 5 seconds in the new eoshome instance)
#sleep_time_at_step = 5

# option to run nplone test under subdir (to test the lag of eoshome instance)
#nplusone_subdirPath = 'abc/def/ghi/'

# FOR EXTRA DEBUG INFORMATION GENERATED FROM SYNC CLIENT ADD (--logdebug) OPTION TO CERNBOXCMD

###################### Modified Parameters ###################################
23 changes: 15 additions & 8 deletions lib/test_nplusone.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

nfiles = int(config.get('nplusone_nfiles',10))
filesize = config.get('nplusone_filesize',1000)
subdirPath = config.get('nplusone_subdirPath',"")

# optional fs check before files are uploaded by worker0
fscheck = config.get('nplusone_fscheck',False)
Expand Down Expand Up @@ -53,8 +54,11 @@ def worker0(step):

step(1,'Preparation')
d = make_workdir()
subdir = os.path.join(d,subdirPath)
mkdir(subdir)

run_ocsync(d)
k0 = count_files(d)
k0 = count_files(subdir)

step(2,'Add %s files and check if we still have k1+nfiles after resync'%nfiles)

Expand All @@ -73,20 +77,20 @@ def worker0(step):

# create the test files
for size in sizes:
create_hashfile(d,size=size)
create_hashfile(subdir,size=size)

if fscheck:
# drop the caches (must be running as root on Linux)
runcmd('echo 3 > /proc/sys/vm/drop_caches')

ncorrupt = analyse_hashfiles(d)[2]
ncorrupt = analyse_hashfiles(subdir)[2]
fatal_check(ncorrupt==0, 'Corrupted files ON THE FILESYSTEM (%s) found'%ncorrupt)

run_ocsync(d)

ncorrupt = analyse_hashfiles(d)[2]
ncorrupt = analyse_hashfiles(subdir)[2]

k1 = count_files(d)
k1 = count_files(subdir)

error_check(k1-k0==nfiles,'Expecting to have %d files more: see k1=%d k0=%d'%(nfiles,k1,k0))

Expand All @@ -109,15 +113,18 @@ def worker0(step):
def worker1(step):
step(1,'Preparation')
d = make_workdir()
subdir = os.path.join(d,subdirPath)
mkdir(subdir)

run_ocsync(d)
k0 = count_files(d)
k0 = count_files(subdir)

step(3,'Resync and check files added by worker0')

run_ocsync(d)

ncorrupt = analyse_hashfiles(d)[2]
k1 = count_files(d)
ncorrupt = analyse_hashfiles(subdir)[2]
k1 = count_files(subdir)

push_to_monitoring("cernbox.cboxsls.nplusone.worker1.synced_files",k1-k0)
push_to_monitoring("cernbox.cboxsls.nplusone.worker1.cor",ncorrupt)
Expand Down