Skip to content

Commit

Permalink
Use dmg to format, rather than --recreate-superblocks.
Browse files Browse the repository at this point in the history
Signed-off-by: Ashley Pittman <[email protected]>
  • Loading branch information
ashleypittman committed Dec 23, 2020
1 parent c71eda2 commit 00a6d70
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 8 deletions.
3 changes: 2 additions & 1 deletion ci/unit/test_main_node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ if grep /mnt/daos\ /proc/mounts; then
fi
sudo mkdir -p /mnt/daos

sudo mount -t tmpfs -o size=16G tmpfs /mnt/daos
sudo mkdir -p "$DAOS_BASE"
sudo mount -t nfs "$HOSTNAME":"$HOSTPWD" "$DAOS_BASE"
sudo cp "$DAOS_BASE/install/bin/daos_admin" /usr/bin/daos_admin
Expand Down Expand Up @@ -46,8 +45,10 @@ fi
cd "$DAOS_BASE"
if ${NLT:-false}; then
mkdir -p vm_test
# NLT will mount /mnt/daos itself.
./utils/node_local_test.py --output-file=vm_test/nlt-errors.json all
else
sudo mount -t tmpfs -o size=16G tmpfs /mnt/daos
IS_CI=true OLD_CI=false RUN_TEST_VALGRIND="$WITH_VALGRIND" utils/run_test.sh

if [ "$WITH_VALGRIND" == 'memcheck' ]; then
Expand Down
2 changes: 1 addition & 1 deletion utils/nlt_server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ servers:
- FI_SOCKETS_CONN_TIMEOUT=2000
scm_mount: /mnt/daos
scm_class: ram
scm_size: 4
scm_size: 32
29 changes: 23 additions & 6 deletions utils/node_local_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,7 @@ def start(self):
server_env['PATH'])

cmd = [daos_server, '--config={}'.format(self._yaml_file.name),
'start', '-t' '4', '--insecure', '-d', self.agent_dir,
'--recreate-superblocks']
'start', '-t' '4', '--insecure', '-d', self.agent_dir]

server_env['DAOS_DISABLE_REQ_FWD'] = '1'
self._sp = subprocess.Popen(cmd, env=server_env)
Expand All @@ -384,14 +383,31 @@ def start(self):

# Use dmg to block until the server is ready to respond to requests.
start = time.time()

while True:
time.sleep(0.5)
rc = self.run_dmg(['storage', 'format'])
ready = False
if rc.returncode == 1:
for line in rc.stdout.decode('utf-8').splitlines():
if 'format storage of running instance' in line:
ready = True

if ready:
break
if time.time() - start > 20:
raise Exception("Failed to format")

print('Format completion in {:.2f} seconds'.format(time.time() - start))

while True:
time.sleep(0.5)
rc = self.run_dmg(['system', 'query'])
ready = False
if rc.returncode == 0:
for line in rc.stdout.decode('utf-8').splitlines():
if line.startswith('status'):
if 'Ready' in line or 'Joined' in line:
if 'Joined' in line:
ready = True

if ready:
Expand All @@ -410,13 +426,12 @@ def stop(self):
if not self._sp:
return
rc = self.run_dmg(['system', 'stop'])
print(rc)
assert rc.returncode == 0

start = time.time()
while True:
time.sleep(0.5)
rc = self.run_dmg(['system', 'query'])
print(rc)
ready = False
if rc.returncode == 0:
for line in rc.stdout.decode('utf-8').splitlines():
Expand Down Expand Up @@ -496,7 +511,9 @@ def run_dmg(self, cmd):
exe_cmd.append('--insecure')
exe_cmd.extend(cmd)

return subprocess.run(exe_cmd, stdout=subprocess.PIPE)
return subprocess.run(exe_cmd,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)

def il_cmd(dfuse, cmd, check_read=True, check_write=True):
"""Run a command under the interception library
Expand Down

0 comments on commit 00a6d70

Please sign in to comment.