Blame tests/03-cipso_local.tests
|
Packit |
51d0f7 |
#!/bin/bash
|
|
Packit |
51d0f7 |
|
|
Packit |
51d0f7 |
#
|
|
Packit |
51d0f7 |
# NetLabel Tools test script
|
|
Packit |
51d0f7 |
#
|
|
Packit |
51d0f7 |
|
|
Packit |
51d0f7 |
#
|
|
Packit |
51d0f7 |
# This program is free software: you can redistribute it and/or modify
|
|
Packit |
51d0f7 |
# it under the terms of version 2 of the GNU General Public License as
|
|
Packit |
51d0f7 |
# published by the Free Software Foundation.
|
|
Packit |
51d0f7 |
#
|
|
Packit |
51d0f7 |
# This program is distributed in the hope that it will be useful,
|
|
Packit |
51d0f7 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
51d0f7 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit |
51d0f7 |
# GNU General Public License for more details.
|
|
Packit |
51d0f7 |
#
|
|
Packit |
51d0f7 |
# You should have received a copy of the GNU General Public License
|
|
Packit |
51d0f7 |
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
Packit |
51d0f7 |
#
|
|
Packit |
51d0f7 |
|
|
Packit |
51d0f7 |
function doi_remove() {
|
|
Packit |
51d0f7 |
local rc=1
|
|
Packit |
51d0f7 |
while [[ $rc -ne 0 && $rc -lt 3 ]]; do
|
|
Packit |
51d0f7 |
$GLBL_NETLABELCTL cipso del doi:$1
|
|
Packit |
51d0f7 |
[[ $? -ne 0 ]] && rc=$(($rc+1)) || rc=0
|
|
Packit |
51d0f7 |
sleep 1
|
|
Packit |
51d0f7 |
done
|
|
Packit |
51d0f7 |
[[ $rc -ne 0 ]] && exit 1
|
|
Packit |
51d0f7 |
}
|
|
Packit |
51d0f7 |
|
|
Packit |
51d0f7 |
# add the local DOI
|
|
Packit |
51d0f7 |
$GLBL_NETLABELCTL cipso add local doi:100
|
|
Packit |
51d0f7 |
[[ $? -ne 0 ]] && exit 1
|
|
Packit |
51d0f7 |
|
|
Packit |
51d0f7 |
# verify the DOI
|
|
Packit |
51d0f7 |
[[ "$($GLBL_NETLABELCTL cipso list doi:100)" != "tags:128" ]] && exit 1
|
|
Packit |
51d0f7 |
|
|
Packit |
51d0f7 |
# remove the DOI
|
|
Packit |
51d0f7 |
doi_remove 100
|
|
Packit |
51d0f7 |
|
|
Packit |
51d0f7 |
exit 0
|