Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
c3bec0ba
Unverified
Commit
c3bec0ba
authored
Apr 17, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
Apr 17, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #74601 from mrbobbytables/fix-test-image-shellcheck
Fix shellcheck lint errors in test/images/* scripts
parents
b359b6bf
5518deff
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
23 deletions
+21
-23
.shellcheck_failures
hack/.shellcheck_failures
+0
-3
run_gluster.sh
test/images/volume/gluster/run_gluster.sh
+8
-8
create_block.sh
test/images/volume/iscsi/create_block.sh
+6
-6
run_nfs.sh
test/images/volume/nfs/run_nfs.sh
+7
-6
No files found.
hack/.shellcheck_failures
View file @
c3bec0ba
...
@@ -85,6 +85,3 @@
...
@@ -85,6 +85,3 @@
./test/e2e_node/environment/setup_host.sh
./test/e2e_node/environment/setup_host.sh
./test/e2e_node/gubernator.sh
./test/e2e_node/gubernator.sh
./test/images/image-util.sh
./test/images/image-util.sh
./test/images/volume/gluster/run_gluster.sh
./test/images/volume/iscsi/create_block.sh
./test/images/volume/nfs/run_nfs.sh
test/images/volume/gluster/run_gluster.sh
View file @
c3bec0ba
...
@@ -14,24 +14,24 @@
...
@@ -14,24 +14,24 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
DIR
=
`
mktemp
-d
`
DIR
=
"
$(
mktemp
-d
)
"
function
start
()
function
start
()
{
{
mount
-t
tmpfs
test
$DIR
mount
-t
tmpfs
test
"
$DIR
"
chmod
755
$DIR
chmod
755
"
$DIR
"
cp
/vol/
*
$DIR
/
cp
/vol/
*
"
$DIR
/"
/usr/sbin/glusterd
-p
/run/glusterd.pid
/usr/sbin/glusterd
-p
/run/glusterd.pid
gluster volume create test_vol
`
hostname
-i
`
:
$DIR
force
gluster volume create test_vol
"
$(
hostname
-i
)
:
$DIR
"
force
gluster volume start test_vol
gluster volume start test_vol
}
}
function
stop
()
function
stop
()
{
{
gluster
--mode
=
script volume stop test_vol force
gluster
--mode
=
script volume stop test_vol force
kill
$(
cat
/run/glusterd.pid
)
kill
"
$(
cat
/run/glusterd.pid
)
"
umount
$DIR
umount
"
$DIR
"
rm
-rf
$DIR
rm
-rf
"
$DIR
"
exit
0
exit
0
}
}
...
...
test/images/volume/iscsi/create_block.sh
View file @
c3bec0ba
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
# Exit on the first error.
# Exit on the first error.
set
-e
set
-e
MNTDIR
=
`
mktemp
-d
`
MNTDIR
=
"
$(
mktemp
-d
)
"
cleanup
()
cleanup
()
{
{
...
@@ -25,8 +25,8 @@ cleanup()
...
@@ -25,8 +25,8 @@ cleanup()
RET
=
$?
RET
=
$?
# Silently remove everything and ignore errors
# Silently remove everything and ignore errors
set
+e
set
+e
/bin/umount
$MNTDIR
2>/dev/null
/bin/umount
"
$MNTDIR
"
2>/dev/null
/bin/rmdir
$MNTDIR
2>/dev/null
/bin/rmdir
"
$MNTDIR
"
2>/dev/null
/bin/rm block 2>/dev/null
/bin/rm block 2>/dev/null
exit
$RET
exit
$RET
}
}
...
@@ -39,9 +39,9 @@ dd if=/dev/zero of=block seek=120 count=1 bs=1M
...
@@ -39,9 +39,9 @@ dd if=/dev/zero of=block seek=120 count=1 bs=1M
mkfs.ext2 block
mkfs.ext2 block
# Add index.html to it
# Add index.html to it
mount
-o
loop block
$MNTDIR
mount
-o
loop block
"
$MNTDIR
"
echo
"Hello from iscsi"
>
$MNTDIR
/index.html
echo
"Hello from iscsi"
>
"
$MNTDIR
/index.html"
umount
$MNTDIR
umount
"
$MNTDIR
"
rm
block.tar.gz 2>/dev/null
||
:
rm
block.tar.gz 2>/dev/null
||
:
tar
cfz block.tar.gz block
tar
cfz block.tar.gz block
test/images/volume/nfs/run_nfs.sh
View file @
c3bec0ba
...
@@ -22,21 +22,22 @@ function start()
...
@@ -22,21 +22,22 @@ function start()
while
getopts
"G:"
opt
;
do
while
getopts
"G:"
opt
;
do
case
${
opt
}
in
case
${
opt
}
in
G
)
gid
=
${
OPTARG
}
;;
G
)
gid
=
${
OPTARG
}
;;
*
)
:
;;
esac
esac
done
done
shift
$((
$
OPTIND
-
1
))
shift
$((
OPTIND
-
1
))
# prepare /etc/exports
# prepare /etc/exports
for
i
in
"
$@
"
;
do
for
i
in
"
$@
"
;
do
# fsid=0: needed for NFSv4
# fsid=0: needed for NFSv4
echo
"
$i
*(rw,fsid=0,insecure,no_root_squash)"
>>
/etc/exports
echo
"
$i
*(rw,fsid=0,insecure,no_root_squash)"
>>
/etc/exports
if
[
-v
gid
]
;
then
if
[
-v
gid
]
;
then
chmod
070
$i
chmod
070
"
$i
"
chgrp
$gid
$i
chgrp
"
$gid
"
"
$i
"
fi
fi
# move index.html to here
# move index.html to here
/bin/cp /tmp/index.html
$i
/
/bin/cp /tmp/index.html
"
$i
/"
chmod
644
$i
/index.html
chmod
644
"
$i
/index.html"
echo
"Serving
$i
"
echo
"Serving
$i
"
done
done
...
@@ -67,7 +68,7 @@ function stop()
...
@@ -67,7 +68,7 @@ function stop()
/usr/sbin/exportfs
-au
/usr/sbin/exportfs
-au
/usr/sbin/exportfs
-f
/usr/sbin/exportfs
-f
kill
$(
pidof rpc.mountd
)
kill
"
$(
pidof rpc.mountd
)
"
umount /proc/fs/nfsd
umount /proc/fs/nfsd
echo
>
/etc/exports
echo
>
/etc/exports
exit
0
exit
0
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment