return (0);
}
+int
+lnet_parse_nid(char *nid_str, lnet_process_id_t *id_ptr)
+{
+ id_ptr->pid = LNET_PID_ANY;
+ id_ptr->nid = libcfs_str2nid(nid_str);
+ if (id_ptr->nid == LNET_NID_ANY) {
+ fprintf (stderr, "Can't parse nid \"%s\"\n", nid_str);
+ return -1;
+ }
+
+ return 0;
+}
+
int g_net_is_set (char *cmd)
{
if (g_net_set)
sep = strchr(argv[1], '-');
if (sep == NULL) {
- id.pid = LNET_PID_ANY;
- id.nid = libcfs_str2nid(argv[1]);
- if (id.nid == LNET_NID_ANY) {
- fprintf (stderr, "Can't parse nid \"%s\"\n", argv[1]);
+ rc = lnet_parse_nid(argv[1], &id);
+ if (rc != 0)
return -1;
- }
} else {
char *end;
else
id.pid = strtoul(argv[1], &end, 0);
- id.nid = libcfs_str2nid(sep + 1);
+ if (end != sep) { /* assuming '-' is part of hostname */
+ rc = lnet_parse_nid(argv[1], &id);
+ if (rc != 0)
+ return -1;
+ } else {
+ id.nid = libcfs_str2nid(sep + 1);
- if (end != sep ||
- id.nid == LNET_NID_ANY) {
- fprintf(stderr, "Can't parse process id \"%s\"\n", argv[1]);
- return -1;
+ if (id.nid == LNET_NID_ANY) {
+ fprintf(stderr,
+ "Can't parse process id \"%s\"\n",
+ argv[1]);
+ return -1;
+ }
}
}
}
run_test 216 "check lockless direct write works and updates file size and kms correctly"
+test_217() { # bug 22430
+ local node
+ for node in $(nodes_list); do
+ if [[ $node = *-* ]] ; then
+ echo "lctl ping $node@$NETTYPE"
+ lctl ping $node@$NETTYPE
+ else
+ echo "skipping $node (no hiphen detected)"
+ fi
+ done
+}
+run_test 217 "check lctl ping for hostnames with hiphen ('-')"
+
#
# tests that do cleanup/setup should be run at the end
#