Lines Matching +full:port +full:-

1 # SPDX-License-Identifier: BSD-2-Clause
37 # The PGTAG can be any 16-bit number. The only constraint is that each
42 if ! kldstat -q -m cfiscsi; then
57 if [ -e port-create.txt ]; then
60 PORTNUM=`awk '/port:/ {print $2}' port-create.txt`
61 ctladm port -r -d $driver -p $PORTNUM
64 TARGET=`awk '/target:/ {print $2}' port-create.txt`
65 ctladm port -r -d $driver -O cfiscsi_portal_group_tag=$PGTAG -O cfiscsi_target=$TARGET
74 atf_set "descr" "ctladm can create a new ioctl port"
81 atf_check -o save:port-create.txt ctladm port -c -d "ioctl"
82 atf_check egrep -q "Port created successfully" port-create.txt
83 atf_check egrep -q "frontend: *ioctl" port-create.txt
84 atf_check egrep -q "port: *[0-9]+" port-create.txt
85 portnum=`awk '/port:/ {print $2}' port-create.txt`
86 atf_check -o save:portlist.txt ctladm portlist -qf ioctl
87 atf_check egrep -q "$portnum *YES *ioctl *ioctl" portlist.txt
104 atf_check -o save:port-create.txt ctladm port -c -d "ioctl"
105 atf_check egrep -q "Port created successfully" port-create.txt
106 atf_check -s exit:1 -e match:"Missing required argument: port_id" ctladm port -r -d "ioctl"
116 atf_set "descr" "ctladm can create a new iscsi port"
124 TARGET=iqn.2018-10.myhost.create_iscsi
125 atf_check -o save:port-create.txt ctladm port -c -d "iscsi" -O cfiscsi_portal_group_tag=$PGTAG -O cfiscsi_target="$TARGET"
126 echo "target: $TARGET" >> port-create.txt
127 atf_check egrep -q "Port created successfully" port-create.txt
128 atf_check egrep -q "frontend: *iscsi" port-create.txt
129 atf_check egrep -q "port: *[0-9]+" port-create.txt
130 atf_check -o save:portlist.txt ctladm portlist -qf iscsi
132 # state, so the port's lunmap may be set before enabling it.
133 atf_check egrep -q "$portnum *NO *iscsi *iscsi.*$TARGET" portlist.txt
143 atf_set "descr" "ctladm can create a new iscsi port with a target alias"
151 TARGET=iqn.2018-10.myhost.create_iscsi_alias
153 atf_check -o save:port-create.txt ctladm port -c -d "iscsi" -O cfiscsi_portal_group_tag=$PGTAG -O cfiscsi_target="$TARGET" -O cfiscsi_target_alias="$ALIAS"
154 echo "target: $TARGET" >> port-create.txt
155 atf_check egrep -q "Port created successfully" port-create.txt
156 atf_check egrep -q "frontend: *iscsi" port-create.txt
157 atf_check egrep -q "port: *[0-9]+" port-create.txt
158 atf_check -o save:portlist.txt ctladm portlist -qvf iscsi
159 atf_check egrep -q "cfiscsi_target_alias=$ALIAS" portlist.txt
177 TARGET=iqn.2018-10.myhost.create_iscsi
178 atf_check -s exit:1 -e match:"Missing required argument: cfiscsi_target" ctladm port -c -d "iscsi" -O cfiscsi_portal_group_tag=$PGTAG
179 atf_check -s exit:1 -e match:"Missing required argument: cfiscsi_portal_group_tag" ctladm port -c -d "iscsi" -O cfiscsi_target=$TARGET
185 atf_set "descr" "ctladm can set options when creating a new ioctl port"
192 atf_check -o save:port-create.txt ctladm port -c -d "ioctl" -O pp=101 -O vp=102
193 atf_check egrep -q "Port created successfully" port-create.txt
194 atf_check egrep -q "frontend: *ioctl" port-create.txt
195 atf_check egrep -q "port: *[0-9]+" port-create.txt
196 portnum=`awk '/port:/ {print $2}' port-create.txt`
197 atf_check -o save:portlist.txt ctladm portlist -qf ioctl
198 if ! egrep -q '101[[:space:]]+102' portlist.txt; then
200 atf_fail "Did not create the port with the specified options"
212 atf_set "descr" "ctladm can disable an ioctl port"
219 atf_check -o save:port-create.txt ctladm port -c -d "ioctl"
220 portnum=`awk '/port:/ {print $2}' port-create.txt`
221 atf_check -o save:portlist.txt ctladm portlist -qf ioctl
222 atf_check -o ignore ctladm port -o off -p $portnum
223 atf_check -o match:"^$portnum *NO" ctladm portlist -qf ioctl
233 atf_set "descr" "ctladm can enable an ioctl port"
240 atf_check -o save:port-create.txt ctladm port -c -d "ioctl"
241 portnum=`awk '/port:/ {print $2}' port-create.txt`
242 atf_check -o save:portlist.txt ctladm portlist -qf ioctl
243 atf_check -o ignore ctladm port -o off -p $portnum
244 atf_check -o ignore ctladm port -o on -p $portnum
245 atf_check -o match:"^$portnum *YES" ctladm portlist -qf ioctl
255 atf_set "descr" "ctladm can remove an ioctl port"
262 # Specify exact pp and vp to make the post-removal portlist check
264 atf_check -o save:port-create.txt ctladm port -c -d "ioctl" -O pp=10001 -O vp=10002
265 portnum=`awk '/port:/ {print $2}' port-create.txt`
266 atf_check -o save:portlist.txt ctladm portlist -qf ioctl
267 atf_check -o inline:"Port destroyed successfully\n" ctladm port -r -d ioctl -p $portnum
268 # Check that the port was removed. A new port may have been added with
270 if ctladm portlist -qf ioctl | egrep -q "^${portnum} .*10001 *10002"; then
271 ctladm portlist -qf ioctl
272 atf_fail "port was not removed"
279 atf_set "descr" "ctladm can remove an iscsi port"
287 TARGET=iqn.2018-10.myhost.remove_iscsi
288 atf_check -o save:port-create.txt ctladm port -c -d "iscsi" -O cfiscsi_portal_group_tag=$PGTAG -O cfiscsi_target="$TARGET"
289 portnum=`awk '/port:/ {print $2}' port-create.txt`
290 atf_check -o save:portlist.txt ctladm portlist -qf iscsi
291 atf_check -o inline:"Port destroyed successfully\n" ctladm port -r -d iscsi -O cfiscsi_portal_group_tag=$PGTAG -O cfiscsi_target="$TARGET"
292 # Check that the port was removed. A new port may have been added with
295 if ctladm portlist -qf iscsi | egrep -q "^${portnum} .*$PGTAG +[0-9]+ +$TARGET,t,$PGTAGHEX"; then
296 ctladm portlist -qf iscsi
297 atf_fail "port was not removed"
312 TARGET=iqn.2018-10.myhost.remove_iscsi_without_required_args
313 atf_check -o save:port-create.txt ctladm port -c -d "iscsi" -O cfiscsi_portal_group_tag=$PGTAG -O cfiscsi_target="$TARGET"
314 echo "target: $TARGET" >> port-create.txt
315 atf_check -s exit:1 -e match:"Missing required argument: cfiscsi_portal_group_tag" ctladm port -r -d iscsi -O cfiscsi_target="$TARGET"
316 atf_check -s exit:1 -e match:"Missing required argument: cfiscsi_target" ctladm port -r -d iscsi -O cfiscsi_portal_group_tag=$PGTAG