Commit 448254f7 authored by Dan Williams's avatar Dan Williams

ibft: add settings plugin for reading iBFT configuration (bgo #734009)

Instead of handling iBFT (iSCSI Boot Firmware Table) in the ifcfg-rh plugin,
create a new plugin for it.  This allows all distributions to use iBFT
configuration, and makes both iBFT handling and ifcfg-rh less complicated.

The plugin (like the old ifcfg-rh code) creates read-only connections backed
by the data exported by iscsiadm.  The plugin does not support adding new
connections or modifying existing connections (since the iBFT data is
read-only anyway).  Instead, users should change their iBFT data through
the normal firmware interfaces.

Unmanaged devices can be configured through NetworkManager.conf and the
normal 'keyfile' mechanisms.

(In the future, we'll read this data directly from the kernel's
/sys/firmware/ibft/ethernetX directory instead of iscsiadm, since the
kernel has all the information we need and that's where iscsiadm gets
it from anyway.)

https://bugzilla.gnome.org/show_bug.cgi?id=734009
parent a27c7e37
......@@ -222,6 +222,7 @@ valgrind-*.log
/src/dhcp-manager/tests/test-dhcp-dhclient
/src/dhcp-manager/tests/test-dhcp-options
/src/dnsmasq-manager/tests/test-dnsmasq-utils
/src/settings/plugins/ibft/tests/test-ibft
/src/settings/plugins/ifcfg-rh/tests/network-scripts/*-Test_Write_*
/src/settings/plugins/ifcfg-rh/tests/network-scripts/Test_Write_*
/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh
......
......@@ -843,6 +843,8 @@ src/settings/plugins/ifnet/tests/Makefile
src/settings/plugins/ifcfg-rh/Makefile
src/settings/plugins/ifcfg-rh/tests/Makefile
src/settings/plugins/ifcfg-rh/tests/network-scripts/Makefile
src/settings/plugins/ibft/Makefile
src/settings/plugins/ibft/tests/Makefile
src/settings/plugins/ifcfg-suse/Makefile
src/settings/plugins/keyfile/Makefile
src/settings/plugins/keyfile/tests/Makefile
......
......@@ -958,5 +958,51 @@ nmtst_assert_connection_unnormalizable (NMConnection *con,
#endif
static inline void
nmtst_assert_ip4_address_equals (guint32 addr, const char *expected, const char *loc)
{
guint32 addr2 = nmtst_inet4_from_string (expected);
if (addr != addr2)
g_error ("assert: %s: ip4 address '%s' expected, but got %s",
loc, expected ? expected : "any", nm_utils_inet4_ntop (addr, NULL));
}
#define nmtst_assert_ip4_address_equals(addr, expected) \
nmtst_assert_ip4_address_equals (addr, expected, G_STRLOC)
#ifdef __NM_UTILS_H__
static inline void
nmtst_assert_hwaddr_equals (gconstpointer hwaddr1, gssize hwaddr1_len, const char *expected, const char *loc)
{
guint8 buf2[NM_UTILS_HWADDR_LEN_MAX];
gsize hwaddr2_len = 1;
const char *p;
gboolean success;
g_assert (hwaddr1_len > 0 && hwaddr1_len <= NM_UTILS_HWADDR_LEN_MAX);
g_assert (expected);
for (p = expected; *p; p++) {
if (*p == ':' || *p == '-')
hwaddr2_len++;
}
g_assert (hwaddr2_len <= NM_UTILS_HWADDR_LEN_MAX);
g_assert (nm_utils_hwaddr_aton (expected, buf2, hwaddr2_len));
/* Manually check the entire hardware address instead of using
* nm_utils_hwaddr_matches() because that function doesn't compare
* entire InfiniBand addresses for various (legitimate) reasons.
*/
success = (hwaddr1_len == hwaddr2_len);
if (success)
success = !memcmp (hwaddr1, buf2, hwaddr1_len);
if (!success) {
g_error ("assert: %s: hwaddr '%s' (%zd) expected, but got %s (%zd)",
loc, expected, hwaddr2_len, nm_utils_hwaddr_ntoa (hwaddr1, hwaddr1_len), hwaddr1_len);
}
}
#define nmtst_assert_hwaddr_equals(hwaddr1, hwaddr1_len, expected) \
nmtst_assert_hwaddr_equals (hwaddr1, hwaddr1_len, expected, G_STRLOC)
#endif
#endif /* __NM_TEST_UTILS_H__ */
......@@ -123,5 +123,6 @@ src/nm-config.c
src/nm-logging.c
src/nm-manager.c
src/nm-sleep-monitor-systemd.c
src/settings/plugins/ibft/plugin.c
src/settings/plugins/ifcfg-rh/reader.c
src/settings/nm-settings-utils.c
SUBDIRS=keyfile example
SUBDIRS=keyfile example ibft
@GNOME_CODE_COVERAGE_RULES@
......
SUBDIRS = . tests
@GNOME_CODE_COVERAGE_RULES@
pkglib_LTLIBRARIES = libnm-settings-plugin-ibft.la
noinst_LTLIBRARIES = libibft-io.la
libibft_io_la_SOURCES = \
reader.c \
reader.h \
errors.c \
errors.h
AM_CPPFLAGS = \
-I$(top_srcdir)/src/ \
-I$(top_srcdir)/src/platform \
-I$(top_srcdir)/src/settings \
-I$(top_srcdir)/include \
-I$(top_srcdir)/libnm-core \
-I$(top_builddir)/libnm-core \
-DNETWORKMANAGER_COMPILATION \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GLIB_CFLAGS) \
$(DBUS_CFLAGS) \
-DG_LOG_DOMAIN=\""NetworkManager-ibft"\" \
-DSYSCONFDIR=\"$(sysconfdir)\" \
-DSBINDIR=\"$(sbindir)\"
libnm_settings_plugin_ibft_la_SOURCES = \
plugin.c \
plugin.h \
nm-ibft-connection.c \
nm-ibft-connection.h
libnm_settings_plugin_ibft_la_LDFLAGS = -module -avoid-version
libnm_settings_plugin_ibft_la_LIBADD = libibft-io.la
CLEANFILES = $(BUILT_SOURCES)
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* NetworkManager system settings service
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Copyright 2014 Red Hat, Inc.
*/
#include <glib.h>
#include "errors.h"
GQuark
ibft_plugin_error_quark (void)
{
static GQuark error_quark = 0;
if (G_UNLIKELY (error_quark == 0))
error_quark = g_quark_from_static_string ("ibft-plugin-error-quark");
return error_quark;
}
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* NetworkManager system settings service
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Copyright 2014 Red Hat, Inc.
*/
#ifndef __ERRORS_H__
#define __ERRORS_H__
#define IBFT_PLUGIN_ERROR (ibft_plugin_error_quark ())
GQuark ibft_plugin_error_quark (void);
#endif /* __ERRORS_H__ */
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* NetworkManager system settings service
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Copyright 2014 Red Hat, Inc.
*/
#include <string.h>
#include <net/ethernet.h>
#include <netinet/ether.h>
#include <glib/gstdio.h>
#include "nm-ibft-connection.h"
#include "errors.h"
#include "reader.h"
G_DEFINE_TYPE (NMIbftConnection, nm_ibft_connection, NM_TYPE_SETTINGS_CONNECTION)
NMIbftConnection *
nm_ibft_connection_new (const GPtrArray *block, GError **error)
{
NMConnection *source;
GObject *object;
source = connection_from_block (block, error);
if (!source)
return NULL;
object = g_object_new (NM_TYPE_IBFT_CONNECTION, NULL);
/* Update settings with what was read from iscsiadm */
if (!nm_settings_connection_replace_settings (NM_SETTINGS_CONNECTION (object),
source,
FALSE,
error))
g_clear_object (&object);
return (NMIbftConnection *) object;
}
/* GObject */
static void
nm_ibft_connection_init (NMIbftConnection *connection)
{
}
static void
nm_ibft_connection_class_init (NMIbftConnectionClass *ibft_connection_class)
{
}
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* NetworkManager system settings service
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Copyright 2014 Red Hat, Inc.
*/
#ifndef NM_IBFT_CONNECTION_H
#define NM_IBFT_CONNECTION_H
G_BEGIN_DECLS
#include <nm-settings-connection.h>
#define NM_TYPE_IBFT_CONNECTION (nm_ibft_connection_get_type ())
#define NM_IBFT_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_IBFT_CONNECTION, NMIbftConnection))
#define NM_IBFT_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_IBFT_CONNECTION, NMIbftConnectionClass))
#define NM_IS_IBFT_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_IBFT_CONNECTION))
#define NM_IS_IBFT_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_IBFT_CONNECTION))
#define NM_IBFT_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_IBFT_CONNECTION, NMIbftConnectionClass))
typedef struct {
NMSettingsConnection parent;
} NMIbftConnection;
typedef struct {
NMSettingsConnectionClass parent;
} NMIbftConnectionClass;
GType nm_ibft_connection_get_type (void);
NMIbftConnection *nm_ibft_connection_new (const GPtrArray *block,
GError **error);
G_END_DECLS
#endif /* NM_IBFT_CONNECTION_H */
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* NetworkManager system settings service
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Copyright 2014 Red Hat, Inc.
*/
#include <config.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <gmodule.h>
#include <glib-object.h>
#include <glib/gi18n.h>
#include <gio/gio.h>
#include <nm-setting-connection.h>
#include "nm-dbus-glib-types.h"
#include "nm-system-config-interface.h"
#include "nm-settings-error.h"
#include "nm-logging.h"
#include "NetworkManagerUtils.h"
#include "plugin.h"
#include "errors.h"
#include "reader.h"
#include "nm-ibft-connection.h"
static void system_config_interface_init (NMSystemConfigInterface *system_config_interface_class);
G_DEFINE_TYPE_EXTENDED (SCPluginIbft, sc_plugin_ibft, G_TYPE_OBJECT, 0,
G_IMPLEMENT_INTERFACE (NM_TYPE_SYSTEM_CONFIG_INTERFACE,
system_config_interface_init))
#define SC_PLUGIN_IBFT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), SC_TYPE_PLUGIN_IBFT, SCPluginIbftPrivate))
typedef struct {
GHashTable *connections; /* uuid::connection */
gboolean initialized;
} SCPluginIbftPrivate;
static void
read_connections (SCPluginIbft *self)
{
SCPluginIbftPrivate *priv = SC_PLUGIN_IBFT_GET_PRIVATE (self);
GSList *blocks, *iter;
GError *error = NULL;
NMIbftConnection *connection;
if (!read_ibft_blocks ("/sbin/iscsiadm", &blocks, &error)) {
nm_log_dbg (LOGD_SETTINGS, _("ibft: failed to read iscsiadm records: %s"), error->message);
g_error_free (error);
return;
}
for (iter = blocks; iter; iter = iter->next) {
connection = nm_ibft_connection_new (iter->data, &error);
if (connection) {
nm_log_info (LOGD_SETTINGS, _("ibft: read connection '%s'"),
nm_connection_get_id (NM_CONNECTION (connection)));
g_hash_table_insert (priv->connections,
g_strdup (nm_connection_get_uuid (NM_CONNECTION (connection))),
connection);
} else {
nm_log_warn (LOGD_SETTINGS, _("ibft: failed to read iscsiadm record: %s"), error->message);
g_clear_error (&error);
}
}
g_slist_free_full (blocks, (GDestroyNotify) g_ptr_array_unref);
}
static GSList *
get_connections (NMSystemConfigInterface *config)
{
SCPluginIbft *self = SC_PLUGIN_IBFT (config);
SCPluginIbftPrivate *priv = SC_PLUGIN_IBFT_GET_PRIVATE (self);
GSList *list = NULL;
GHashTableIter iter;
NMIbftConnection *connection;
if (!priv->initialized) {
read_connections (self);
priv->initialized = TRUE;
}
g_hash_table_iter_init (&iter, priv->connections);
while (g_hash_table_iter_next (&iter, NULL, (gpointer) &connection))
list = g_slist_prepend (list, connection);
return list;
}
static void
init (NMSystemConfigInterface *config)
{
}
static void
sc_plugin_ibft_init (SCPluginIbft *self)
{
SCPluginIbftPrivate *priv = SC_PLUGIN_IBFT_GET_PRIVATE (self);
priv->connections = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref);
}
static void
dispose (GObject *object)
{
SCPluginIbft *self = SC_PLUGIN_IBFT (object);
SCPluginIbftPrivate *priv = SC_PLUGIN_IBFT_GET_PRIVATE (self);
if (priv->connections) {
g_hash_table_destroy (priv->connections);
priv->connections = NULL;
}
G_OBJECT_CLASS (sc_plugin_ibft_parent_class)->dispose (object);
}
static void
get_property (GObject *object, guint prop_id,
GValue *value, GParamSpec *pspec)
{
switch (prop_id) {
case NM_SYSTEM_CONFIG_INTERFACE_PROP_NAME:
g_value_set_string (value, "iBFT");
break;
case NM_SYSTEM_CONFIG_INTERFACE_PROP_INFO:
g_value_set_string (value, "(c) 2014 Red Hat, Inc. To report bugs please use the NetworkManager mailing list.");
break;
case NM_SYSTEM_CONFIG_INTERFACE_PROP_CAPABILITIES:
g_value_set_uint (value, NM_SYSTEM_CONFIG_INTERFACE_CAP_NONE);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
set_property (GObject *object, guint prop_id,
const GValue *value, GParamSpec *pspec)
{
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
static void
sc_plugin_ibft_class_init (SCPluginIbftClass *req_class)
{
GObjectClass *object_class = G_OBJECT_CLASS (req_class);
g_type_class_add_private (req_class, sizeof (SCPluginIbftPrivate));
object_class->dispose = dispose;
object_class->get_property = get_property;
object_class->set_property = set_property;
g_object_class_override_property (object_class,
NM_SYSTEM_CONFIG_INTERFACE_PROP_NAME,
NM_SYSTEM_CONFIG_INTERFACE_NAME);
g_object_class_override_property (object_class,
NM_SYSTEM_CONFIG_INTERFACE_PROP_INFO,
NM_SYSTEM_CONFIG_INTERFACE_INFO);
g_object_class_override_property (object_class,
NM_SYSTEM_CONFIG_INTERFACE_PROP_CAPABILITIES,
NM_SYSTEM_CONFIG_INTERFACE_CAPABILITIES);
g_object_class_override_property (object_class,
NM_SYSTEM_CONFIG_INTERFACE_PROP_HOSTNAME,
NM_SYSTEM_CONFIG_INTERFACE_HOSTNAME);
}
static void
system_config_interface_init (NMSystemConfigInterface *system_config_interface_class)
{
/* interface implementation */
system_config_interface_class->get_connections = get_connections;
system_config_interface_class->init = init;
}
G_MODULE_EXPORT GObject *
nm_system_config_factory (void)
{
static SCPluginIbft *singleton = NULL;
if (!singleton)
singleton = SC_PLUGIN_IBFT (g_object_new (SC_TYPE_PLUGIN_IBFT, NULL));
else
g_object_ref (singleton);
return G_OBJECT (singleton);
}
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* NetworkManager system settings service
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Copyright 2014 Red Hat, Inc.
*/
#ifndef _PLUGIN_H_
#define _PLUGIN_H_
#include <glib-object.h>
#define SC_TYPE_PLUGIN_IBFT (sc_plugin_ibft_get_type ())
#define SC_PLUGIN_IBFT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SC_TYPE_PLUGIN_IBFT, SCPluginIbft))
#define SC_PLUGIN_IBFT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SC_TYPE_PLUGIN_IBFT, SCPluginIbftClass))
#define SC_IS_PLUGIN_IBFT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SC_TYPE_PLUGIN_IBFT))
#define SC_IS_PLUGIN_IBFT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SC_TYPE_PLUGIN_IBFT))
#define SC_PLUGIN_IBFT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SC_TYPE_PLUGIN_IBFT, SCPluginIbftClass))
typedef struct _SCPluginIbft SCPluginIbft;
typedef struct _SCPluginIbftClass SCPluginIbftClass;
struct _SCPluginIbft {
GObject parent;
};
struct _SCPluginIbftClass {
GObjectClass parent;
};
GType sc_plugin_ibft_get_type (void);
#endif /* _PLUGIN_H_ */
This diff is collapsed.
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* NetworkManager system settings service
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Copyright 2014 Red Hat, Inc.
*/
#ifndef __READER_H__
#define __READER_H__
#include <glib.h>
#include <nm-connection.h>
gboolean read_ibft_blocks (const char *iscsiadm_path,
GSList **out_blocks,
GError **error);
NMConnection *connection_from_block (const GPtrArray *block, GError **error);
/* For testcases */
gboolean parse_ibft_config (const GPtrArray *data, GError **error, ...) G_GNUC_NULL_TERMINATED;
#endif /* __READER_H__ */
if ENABLE_TESTS
@GNOME_CODE_COVERAGE_RULES@
AM_CPPFLAGS = \
$(GLIB_CFLAGS) \
$(CODE_COVERAGE_CFLAGS) \
-I$(top_srcdir)/include \
-I$(top_srcdir)/libnm-core \
-I$(top_builddir)/libnm-core \
-I$(top_srcdir)/src/ \
-I$(top_srcdir)/src/platform \
-I$(top_srcdir)/src/settings \
-I$(srcdir)/../ \
-DG_LOG_DOMAIN=\""NetworkManager-ibft"\" \
-DNETWORKMANAGER_COMPILATION \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
-DTEST_IBFT_DIR=\"$(abs_srcdir)\" \
-DTEST_SCRATCH_DIR=\"$(abs_builddir)/\"
AM_LDFLAGS = \
$(GLIB_LIBS) \
$(DBUS_LIBS) \
$(CODE_COVERAGE_LDFLAGS)
noinst_PROGRAMS = test-ibft
test_ibft_SOURCES = \
test-ibft.c \
../errors.c \
../reader.c
test_ibft_LDADD = \
$(top_builddir)/src/libNetworkManager.la
TESTS = test-ibft
EXTRA_DIST = \
iscsiadm-test-dhcp \
iscsiadm-test-static \
iscsiadm-test-bad-ipaddr \
iscsiadm-test-bad-gateway \
iscsiadm-test-bad-dns1 \
iscsiadm-test-bad-dns2 \
iscsiadm-test-bad-entry \
iscsiadm-test-bad-record \
iscsiadm-test-vlan
endif
#!/bin/bash
cat << EOF
# BEGIN RECORD
iface.initiatorname = iqn.pjones6
iface.hwaddress = 00:33:21:98:b9:f0
iface.bootproto = STATIC
iface.ipaddress = 192.168.32.72
iface.subnet_mask = 255.255.252.0
iface.gateway = 192.168.35.254
iface.primary_dns = 10000.500.250.1
iface.secondary_dns = 10.16.255.3
iface.vlan_id = 0
iface.net_ifacename = eth0
node.name = iqn.0.2008-11.com.blahblah:iscsi0
node.conn[0].address = 10.16.52.16
node.conn[0].port = 3260
node.boot_lun = 00000000
# END RECORD
EOF
#!/bin/bash
cat << EOF
# BEGIN RECORD
iface.initiatorname = iqn.pjones6
iface.hwaddress = 00:33:21:98:b9:f0
iface.bootproto = STATIC
iface.ipaddress = 192.168.32.72
iface.subnet_mask = 255.255.252.0
iface.gateway = 192.168.35.254
iface.primary_dns = 10.16.255.2
iface.secondary_dns = blah.foo.bar.baz
iface.vlan_id = 0
iface.net_ifacename = eth0
node.name = iqn.0.2008-11.com.blahblah:iscsi0
node.conn[0].address = 10.16.52.16
node.conn[0].port = 3260
node.boot_lun = 00000000
# END RECORD
EOF
#!/bin/bash
cat << EOF
# BEGIN RECORD
iface.initiatorname = iqn.pjones6
iface.hwaddress = 00:33:21:98:b9:f0
iface.bootproto = STATIC
iface.ipaddress 192.168.32.72
iface.subnet_mask = 255.255.252.0
iface.gateway = 192.168.35.254
iface.primary_dns = 10.16.255.2
iface.secondary_dns = 10.16.255.3
iface.vlan_id = 0
iface.net_ifacename = eth0
node.name = iqn.0.2008-11.com.blahblah:iscsi0
node.conn[0].address = 10.16.52.16
node.conn[0].port = 3260
node.boot_lun = 00000000
# END RECORD
#!/bin/bash
cat << EOF
# BEGIN RECORD
iface.initiatorname = iqn.pjones6
iface.hwaddress = 00:33:21:98:b9:f0
iface.bootproto = STATIC
iface.ipaddress = 192.168.32.72