Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cta
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dCache
cta
Commits
362ebf02
Commit
362ebf02
authored
5 years ago
by
Michael Davis
Browse files
Options
Downloads
Patches
Plain Diff
[ci] Set EOS instance for eos commands called in grpc_dir_inject.sh
parent
5096490c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
continuousintegration/orchestration/tests/grpc_dir_inject.sh
+16
-11
16 additions, 11 deletions
continuousintegration/orchestration/tests/grpc_dir_inject.sh
with
16 additions
and
11 deletions
continuousintegration/orchestration/tests/grpc_dir_inject.sh
+
16
−
11
View file @
362ebf02
#!/bin/sh
# Migration tools parameters
EOSINSTANCE
=
ctaeos
EOS_CMD
=
"/usr/bin/eos root://
${
EOSINSTANCE
}
"
EOS_TEST_DIR_INJECT
=
/usr/bin/eos-test-dir-inject
CONFIG_FILE
=
/etc/cta/castor-migration.conf
TMPFILE
=
/tmp/eos-test-inject-sh.
$$
...
...
@@ -37,9 +39,11 @@ EOS_PREFIX=$(awk '/^eos.prefix[ ]/ { print $2 }' ${CONFIG_FILE})
# Ping the gRPC interface
${
EOS_TEST_DIR_INJECT
}
ping
||
error
"gRPC ping failed"
# Create the top-level directory. GNU coreutils "mkdir -p" does not return an error if the directory
# already exists; "eos mkdir -p" does return an error, which we explicitly ignore.
eos
mkdir
-p
${
EOS_PREFIX
}
2>/dev/null
# Create the top-level directory.
#
# Note: GNU coreutils "mkdir -p" does not return an error if the directory already exists;
# but "eos mkdir -p" does return an error.
${
EOS_CMD
}
mkdir
-p
${
EOS_PREFIX
}
# Create directory with system-assigned file id -- should succeed
echoc
$LT_BLUE
"Creating directory with auto-assigned file id"
...
...
@@ -47,9 +51,10 @@ ${EOS_TEST_DIR_INJECT} --path ${CASTOR_PREFIX}/my_test_dir >${TMPFILE}
[
$?
-eq
0
]
||
error
"Creating directory with auto-assigned file id failed"
json-pretty-print.sh
${
TMPFILE
}
rm
${
TMPFILE
}
eos
ls
-l
${
EOS_PREFIX
}
eos fileinfo
${
EOS_PREFIX
}
/my_test_dir
eos
rmdir
${
EOS_PREFIX
}
/my_test_dir
${
EOS_CMD
}
ls
-l
${
EOS_PREFIX
}
${
EOS_CMD
}
fileinfo
${
EOS_PREFIX
}
/my_test_dir
XrdSecPROTOCOL
=
sss
${
EOS_CMD
}
fileinfo
${
EOS_PREFIX
}
/my_test_dir
${
EOS_CMD
}
rmdir
${
EOS_PREFIX
}
/my_test_dir
# Create directory with self-assigned file id -- should succeed
echoc
$LT_BLUE
"Creating directory with self-assigned file id"
...
...
@@ -57,7 +62,7 @@ ${EOS_TEST_DIR_INJECT} --fileid 9876543210 --path ${CASTOR_PREFIX}/my_test_dir >
[
$?
-eq
0
]
||
error
"Creating directory with self-assigned file id failed"
json-pretty-print.sh
${
TMPFILE
}
rm
${
TMPFILE
}
eos
fileinfo
${
EOS_PREFIX
}
/my_test_dir
${
EOS_CMD
}
fileinfo
${
EOS_PREFIX
}
/my_test_dir
# Try again -- should fail
echoc
$LT_GREEN
"Creating directory with the same file id (should fail)"
...
...
@@ -66,12 +71,12 @@ ${EOS_TEST_DIR_INJECT} --fileid 9876543210 --path ${CASTOR_PREFIX}/my_test_dir2
# Remove and try again -- should succeed after restarting EOS
echoc
$LT_GREEN
"Remove the directory and restart EOS to remove the tombstone"
eos
rmdir
${
EOS_PREFIX
}
/my_test_dir
${
EOS_CMD
}
rmdir
${
EOS_PREFIX
}
/my_test_dir
echoc
$LT_BLUE
"Recreate the directory with self-assigned file id (should succeed this time)"
${
EOS_TEST_DIR_INJECT
}
--fileid
9876543210
--path
${
CASTOR_PREFIX
}
/my_test_dir
>
/dev/null
[
$?
-eq
0
]
||
error
"Creating directory with self-assigned file id failed with error
$?
"
eos
fileinfo
${
EOS_PREFIX
}
/my_test_dir
${
EOS_CMD
}
fileinfo
${
EOS_PREFIX
}
/my_test_dir
echoc
$LT_GREEN
"Cleaning up: removing tombstones and removing injected directories"
eos
rmdir
${
EOS_PREFIX
}
/my_test_dir 2>/dev/null
eos
rmdir
${
EOS_PREFIX
}
/my_test_dir2 2>/dev/null
${
EOS_CMD
}
rmdir
${
EOS_PREFIX
}
/my_test_dir 2>/dev/null
${
EOS_CMD
}
rmdir
${
EOS_PREFIX
}
/my_test_dir2 2>/dev/null
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment