diff --git a/.mailmap b/.mailmap index d01484002..2c1f4e77b 100644 --- a/.mailmap +++ b/.mailmap @@ -4,6 +4,7 @@ Arif Ali Arif Ali Arif Ali BAI Yuan +BAI Yuan Bill Wajda Bill Wajda Brian Elliott Finley diff --git a/Version b/Version index fbdb3b99a..d7b0d017e 100644 --- a/Version +++ b/Version @@ -1 +1 @@ -2.14.5 +2.14.6 diff --git a/docs/source/advanced/gpu/nvidia/osimage/rhels.rst b/docs/source/advanced/gpu/nvidia/osimage/rhels.rst index 11c3d11cd..9608fb3f7 100644 --- a/docs/source/advanced/gpu/nvidia/osimage/rhels.rst +++ b/docs/source/advanced/gpu/nvidia/osimage/rhels.rst @@ -189,7 +189,7 @@ xCAT includes a script, ``cuda_power9_setup`` as example, to help user handle th Diskful osimage ^^^^^^^^^^^^^^^ -For diskful deployment, there is no need to change the osimage definition. Instead, add this postscript to your compute node postbootscrtips list. :: +For diskful deployment, there is no need to change the osimage definition. Instead, add this postscript to your compute node postscripts list. :: chdef p9compute -p postscripts=cuda_power9_setup diff --git a/docs/source/advanced/hierarchy/databases/postgres_configure.rst b/docs/source/advanced/hierarchy/databases/postgres_configure.rst index c3a1bb449..09e3a00c4 100644 --- a/docs/source/advanced/hierarchy/databases/postgres_configure.rst +++ b/docs/source/advanced/hierarchy/databases/postgres_configure.rst @@ -24,8 +24,8 @@ If you had the following two service nodes: :: You would add the following to ``/var/lib/pgsql/data/pg_hba.conf`` :: - host all all 192.168.1.10/24 md5 - host all all 192.168.1.11/24 md5 + host all all 192.168.1.10/32 md5 + host all all 192.168.1.11/32 md5 Restart PostgreSQL after editing the file: :: diff --git a/docs/source/advanced/networks/switchdiscover/switch_based_switch_discovery.rst b/docs/source/advanced/networks/switchdiscover/switch_based_switch_discovery.rst index c2ef30876..702605c82 100644 --- a/docs/source/advanced/networks/switchdiscover/switch_based_switch_discovery.rst +++ b/docs/source/advanced/networks/switchdiscover/switch_based_switch_discovery.rst @@ -61,59 +61,63 @@ dhcp should be restarted after seting up dynamic IP range. Discover Switches ~~~~~~~~~~~~~~~~~ -xCAT supports **switchdiscover** command to discover the switches that are attached to the subnets on xCAT management node. Refer to :doc:`/advanced/networks/switchdiscover/switches_discovery` for more info. +.. note:: Only BNT and Mellanox switches are supported for switch-based switch discovery -For the switch-based switch discovery, we add **–setup** flag: :: +xCAT can automatically discover switches that are connected to the defined subnets from the management node using the ``switchdiscover`` command. + +For switch-based switch discovery, use the ``--setup`` option:: switchdiscover [noderange|--range ip_ranges][-s scan_methods] [--setup] -if **--setup** flag is specified, the command will perform following steps: +The ``--setup`` option will perform the following steps: -1. Use snmp or nmap scan methods to find all switches in the dynamic IP ranges specified by --range, the available switches will be stored in switch hash table with hostname, switchtype, vendor info and mac address. +1. Scan the IP range using ``snmp`` or ``nmap`` to find all switches that respond. The available switches will be stored into the switch hash table with ``hostname``, ``switchtype``, ``mac``, and vendor information. + +2. Based on MAC address for each switch defined in the hash table, call **find_mac** subroutine. The **find_mac** subroutine will go thought the switch and switch ports and find matched mac address. + + * If discovered switch didn't find any predefined switch matches, it will log the message ``NO predefined switch matched``. + * If discovered switch matched with one of pre-defined switch, it will update the predefined switch with :: + + otherinterface=x.x.x.x (discovered ip) + state=matched + switchtype=type of switch + usercomment=vendor information -2. Based on mac address for each switch defined in the hash table, call **find_mac** subroutine. The **find_mac** subroutine will go thought the switch and switch ports and find matched mac address. +3. If the switches are matched, the ``switchdiscover`` command will execute the following scripts to configure static IP address, hostname, and enable the snmpv3. -* If discovered switch didn't find any predefined switch matches, it will log the message ``NO predefined switch matched``. -* If discovered switch matched with one of pre-defined switch, it will update the predefined switch with :: + * ``/opt/xcat/share/xcat/scripts/configBNT`` + * ``/opt/xcat/share/xcat/scripts/configMellanox`` - otherinterface=x.x.x.x (discovered ip) - state=matched - switchtype=type of switch - usercomment=vendor information +4. After discovery process the predefined node attribute in the xCAT database will be updated. :: + + lsdef switch-192-168-5-22 + groups=switch + ip=192.168.5.22 + mac=a8:97:dc:02:92:00 + mgt=switch + nodetype=switch + password=admin + postbootscripts=otherpkgs + postscripts=syslog,remoteshell,syncfiles + protocol=telnet + snmpauth=sha + snmppassword=xcatadminpassw0rd@snmp + snmpusername=xcatadmin + snmpversion=3 + status=hostname_configured + statustime=08-31-2016 15:35:49 + supportedarchs=ppc64 + switch=switch-10-5-23-1 + switchport=45 + switchtype=BNT + usercomment=IBM Networking Operating System RackSwitch G8052 + username=root -3. After switches are matched, the command will call config files to set up static IP address, hostname and enable the snmpv3. Currently, BNT and Mellanox switches are supported. The two config files are located in the **/opt/xcat/share/xcat/scripts/config.BNT** and **/opt/xcat/share/xcat/scripts/config.Mellanox**. the log message ``the switch type is not support for config`` is displayed if switchtype is something other than BNT or Mellanox. - -4. After discovery process, the predefined node attribute in the xCATdb will be updated. - -:: - - lsdef switch-192-168-5-22 - groups=switch - ip=192.168.5.22 - mac=a8:97:dc:02:92:00 - mgt=switch - nodetype=switch - password=admin - postbootscripts=otherpkgs - postscripts=syslog,remoteshell,syncfiles - protocol=telnet - snmpauth=sha - snmppassword=xcatadminpassw0rd@snmp - snmpusername=xcatadmin - snmpversion=3 - status=hostname_configured - statustime=08-31-2016 15:35:49 - supportedarchs=ppc64 - switch=switch-10-5-23-1 - switchport=45 - switchtype=BNT - usercomment=IBM Networking Operating System RackSwitch G8052 - username=root - +.. tip:: Refer to :doc:`/advanced/networks/switchdiscover/switches_discovery` for more info. Configure switches diff --git a/docs/source/advanced/security/ssl_config.rst b/docs/source/advanced/security/ssl_config.rst index 58f01bc3a..0c411e8d7 100644 --- a/docs/source/advanced/security/ssl_config.rst +++ b/docs/source/advanced/security/ssl_config.rst @@ -8,21 +8,13 @@ The configuration is stored in the xCAT site table using the ``site.xcatsslversi Configuration ------------- -By default, xCAT ships with ``TLSv1`` configured. The current highest SSL version that can be supported is ``TLSv1.2``. +``site.xcatsslversion`` is the ``SSL_version`` option ``xcatd`` used and passed to ``IO::Socket::SSL->start_SSL()``. By default, this value is set to empty. In this case, ``xcatd`` will use ``SSLv23:!SSLv2:!SSLv3:!TLSv1`` internally. For more detail, see https://metacpan.org/pod/IO::Socket::SSL +By default, xCAT ships with an empty value for ``site.xcatsslversion``. In this case, ``xcatd`` will use ``SSLv23:!SSLv2:!SSLv3:!TLSv1`` internally. -* For rhels7.x and sles12.x and higher: :: - - chtab key=xcatsslversion site.value=TLSv12 - -* For ubuntu 14.x and higher: :: +Here is an example of change ``site.xcatsslversoin`` to a different value. Say, TLS 1.2 is preferred. :: chtab key=xcatsslversion site.value=TLSv1_2 -* For AIX 7.1.3.x: :: - - chtab key=xcatsslversion site.value=TLSv1_2 - - If running > ``TLSv1``, it is possible to disable insecure ciphers. Here's an example of one possible configuration: :: "xcatsslciphers","kDH:kEDH:kRSA:!SSLv3:!SSLv2:!aNULL:!eNULL:!MEDIUM:!LOW:!MD5:!EXPORT:!CAMELLIA:!ECDH",, diff --git a/docs/source/conf.py b/docs/source/conf.py index 1300b102b..6891ac194 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -49,7 +49,7 @@ master_doc = 'index' # General information about the project. project = u'xCAT' -copyright = u'2015, IBM Corporation' +copyright = u'2015-2019, IBM Corporation' author = u'IBM Corporation' # The version info for the project you're documenting, acts as replacement for @@ -59,7 +59,7 @@ author = u'IBM Corporation' # The short X.Y version. version = '2' # The full version, including alpha/beta/rc tags. -release = '2.14.5' +release = '2.14.6' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/cfg_partition.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/cfg_partition.rst index 20836e356..1748b8675 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/cfg_partition.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/cfg_partition.rst @@ -2,7 +2,6 @@ By default, xCAT will install the operating system on the first disk and with default partitions layout in the node. However, you may choose to customize the disk partitioning during the install process and define a specific disk layout. You can do this in one of two ways: '**partition definition file**' or '**partition definition script**'. -**Notes** .. note:: ``partition definition file`` can be used for RedHat, SLES, and Ubuntu. Because disk configuraiton for Ubuntu is different from RedHat, there may be some special sections required for Ubuntu. .. warning:: ``partition definition script`` has only been tested on RedHat and Ubuntu, use at your own risk for SLES. diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/network/cfg_second_adapter.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/network/cfg_second_adapter.rst index ded30393c..ce6f9b801 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/network/cfg_second_adapter.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/network/cfg_second_adapter.rst @@ -1,6 +1,8 @@ Configure Additional Network Interfaces old version - confignics - (deprecated) =============================================================================== +**"confignics" is deprecated, recommend using new version "confignetwork" instead.** + The **nics** table and the **confignics** postscript can be used to automatically configure additional network interfaces (multiple ethernets adapters, InfiniBand, etc) on the nodes as they are being deployed. The way the confignics postscript decides what IP address to give the secondary adapter is by checking the nics table, in which the nic configuration information is stored. @@ -74,12 +76,15 @@ Use command below to add confignics into the node's postscripts list :: chdef cn1 -p postscripts=confignics +**NOTE**: ``confignics`` is deprecated, you can also use ``chdef cn1 -p postscripts=confignetwork`` instead above ``chdef`` command. + By default, confignics does not configure the install nic. if need, using flag "-s" to allow the install nic to be configured. :: chdef cn1 -p prostscripts="confignics -s" Option "-s" writes the install nic's information into configuration file for persistence. All install nic's data defined in nics table will be written also. +**NOTE**: ``confignics`` is deprecated, you can also use ``chdef cn1 -p postscripts="confignetwork -s"`` instead above ``chdef`` command. Add network object into the networks table ------------------------------------------ diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_install.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_install.rst index 5139616fa..08b000fca 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_install.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_install.rst @@ -1,9 +1,7 @@ Synchronizing Files during the installation process ----------------------------------------------------- +--------------------------------------------------- -The policy table must have the entry to allow syncfiles postscript to access the Management Node. Make sure this entry is in your table: - - ``tabdump policy`` :: +The **policy** table must have the entry to allow **syncfiles** postscript to access the Management Node. Make sure this entry is in your **policy** table: :: #priority,name,host,commands,noderange,parameters,time,rule,comments,disable . @@ -15,23 +13,21 @@ The policy table must have the entry to allow syncfiles postscript to access the Hierarchy and Service Nodes ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -If using Service nodes to manage you nodes, you should make sure that the service nodes have been synchronized with the latest files from the Management Node before installing. If you have a group of compute nodes (compute) that are going to be installed that are serviced by SN1, then run the following before the install to sync the current files to SN1. Note: the noderange is the compute node names, updatenode will figure out which service nodes need updating. +If using Service nodes to manage you nodes, you should make sure that the service nodes have been synchronized with the latest files from the Management Node before installing. If you have a group of compute nodes **compute** that are going to be installed that are serviced by SN1, then run the following before the install to sync the current files to SN1.:: -``updatenode compute -f`` + updatenode compute -f + +.. note:: ``updatenode`` will figure out which service nodes need updating. Diskful installation ~~~~~~~~~~~~~~~~~~~~ - - -The 'syncfiles' postscript is in the defaults section of the postscripts table. To enable the syn files postscript to sync files to the nodes during install the user need to do the following: +The **syncfiles** postscript is in the defaults section of the **postscripts** table. To enable the **syncfiles** postscript to sync files to the nodes during install the user need to do the following: * Create the synclist file with the entries indicating which files should be synced. (refer to :ref:`The_Format_of_synclist_file_label` ) * Put the synclist into the proper location for the node type (refer to :ref:`the_localtion_of_synclist_file_for_updatenode_label`) -Make sure your postscripts table has the syncfiles postscript listed - -``tabdump postscripts`` :: +Make sure your **postscripts** table has the syncfiles postscript listed:: #node,postscripts,postbootscripts,comments,disable "xcatdefaults","syslog,remoteshell,syncfiles","otherpkgs",, @@ -39,9 +35,8 @@ Make sure your postscripts table has the syncfiles postscript listed Diskless Installation ~~~~~~~~~~~~~~~~~~~~~ -The diskless boot is similar with the diskful installation for the synchronizing files operation, except that the packimage commands will sync files to the root directories of image during the creating image process. +The diskless boot is similar with the diskful installation for the synchronizing files operation, except that the ``packimage`` command will sync files to the root directories of image during the creating image process. -Creating the synclist file as the steps in Diskful installation section, then the synced files will be synced to the os image during the packimage and mkdsklsnode commands running. +Creating the synclist file as the steps in Diskful installation section, then the synced files will be synced to the os image during the ``packimage`` and ``mkdsklsnode`` commands running. Also the files will always be re-synced during the booting up of the diskless node. - diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_overview.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_overview.rst index d0d18af6f..eeb5c3de6 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_overview.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_overview.rst @@ -1,24 +1,26 @@ Overview -------- -Synchronizing (sync) files to the nodes is a feature of xCAT used to distribute specific files from the management node to the new-deploying or deployed nodes. +Synchronizing (sync) files to the nodes is a feature of xCAT used to distribute specific files from the management node to the newly-deploying or deployed nodes. -This function is supported for diskful or RAMdisk-based diskless nodes. Generally, the specific files are usually the system configuration files for the nodes in the **/etc/directory**, like **/etc/hosts**, **/etc/resolve.conf**; it also could be the application programs configuration files for the nodes. The advantages of this function are: it can parallel sync files to the nodes or nodegroup for the installed nodes; it can automatically sync files to the newly-installing node after the installation. Additionally, this feature also supports the flexible format to define the synced files in a configuration file, called **'synclist'**. +This function is supported for diskful or RAMdisk-based diskless nodes. Generally, the specific files are usually the system configuration files for the nodes in the **/etc** directory, like **/etc/hosts**, **/etc/resolve.conf**; it also could be the application programs configuration files for the nodes. The advantages of this function are: it can parallel sync files to the nodes or nodegroup for the installed nodes; it can automatically sync files to the newly-installing node after the installation. Additionally, this feature also supports the flexible format to define the files to be synced in a configuration file, called "synclist". -The synclist file can be a common one for a group of nodes using the same profile or osimage, or can be the special one for a particular node. Since the location of the synclist file will be used to find the synclist file, the common synclist should be put in a given location for Linux nodes or specified by the osimage. +The synclist file can be a common one for a group of nodes using the same profile or osimage, or can be the unique for each particular node. Since the location of the synclist file will be used to find the synclist file, the common synclist should be put in a given location for Linux nodes or specified by the osimage. -``xdcp`` command supplies the basic Syncing File function. If the **'-F synclist'** option is specified in the ``xdcp`` command, it syncs files configured in the synclist to the nodes. If the **'-i PATH'** option is specified with **'-F synclist'**, it syncs files to the root image located in the PATH directory. (**Note: the '-i PATH' option is only supported for Linux nodes**) +``xdcp`` command supplies the basic Syncing File function. If the **-F synclist** option is specified in the ``xdcp`` command, it syncs files configured in the synclist to the nodes. If the **-i ** option is specified with **-F synclist**, it syncs files to the root image located in the directory. -``xdcp`` supports hierarchy where service nodes are used. If a node is serviced by a service node, ``xdcp`` will sync the files to the service node first, then sync the files from service node to the compute node. The files are place in an intermediate directory on the service node defined by the SNsyncfiledir attribute in the site table. The default is **/var/xcat/syncfiles**. +.. note:: The **-i ** option is only supported for Linux nodes + +``xdcp`` supports hierarchy where service nodes are used. If a node is serviced by a service node, ``xdcp`` will sync the files to the service node first, then sync the files from service node to the compute node. The files are placed in an intermediate directory on the service node defined by the **SNsyncfiledir** attribute in the **site** table. The default is **/var/xcat/syncfiles**. Since ``updatenode -F`` calls the ``xdcp`` to handle the Syncing File function, the ``updatenode -F`` also supports the hierarchy. -For a new-installing nodes, the Syncing File action will be triggered when performing the postscripts for the nodes. A special postscript named **'syncfiles'** is used to initiate the Syncing File process. +For a new-installing nodes, the Syncing File action will be triggered when running the postscripts for the nodes. A special postscript named **syncfiles** is used to initiate the Syncing File process. -The postscript **'syncfiles'** is located in the **/install/postscripts/**. When running, it sends a message to the xcatd on the management node or service node, then the xcatd figures out the corresponding synclist file for the node and calls the ``xdcp`` command to sync files in the synclist to the node. +The postscript **syncfiles** is located in the **/install/postscripts/**. When running, it sends a message to the **xcatd** on the management node or service node, then the **xcatd** figures out the corresponding synclist file for the node and calls the ``xdcp`` command to sync files in the synclist to the node. -**If installing nodes in a hierarchical configuration, you must sync the Service Nodes first to make sure they are updated. The compute nodes will be sync'd from their service nodes. You can use the** ``updatenode -f`` **command to sync all the service nodes for range of compute nodes provided.** +If installing nodes in a hierarchical configuration, you must sync the service nodes first to make sure they are updated. The compute nodes will be synced from their service nodes. You can use the ``updatenode -f`` command to sync all the service nodes for range of compute nodes provided. -For an installed nodes, the Syncing File action happens when performing the ``updatenode -F`` or ``xdcp -F synclist`` command to update a nodes. If performing the ``updatenode -F``, it figures out the location of the synclist files for all the nodes and classify the nodes which using same synclist file and then calls the ``xdcp -F synclist`` to sync files to the nodes. +For an installed nodes, the Syncing File action happens when performing the ``updatenode -F`` or ``xdcp -F synclist`` command to update a nodes. While performing the ``updatenode -F``, it figures out the location of the synclist files for all the nodes and groups the nodes which will be using the same synclist file and then calls the ``xdcp -F synclist`` to sync files to the nodes. diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_periodically.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_periodically.rst index adaa6b332..b699f503f 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_periodically.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_periodically.rst @@ -1,24 +1,15 @@ Run the Syncing File action periodically ------------------------------------------ +---------------------------------------- If the admins want to run the Syncing File action automatically or periodically, the ``xdcp -F``, ``xdcp -i -F`` and ``updatenode -F`` commands can be used in the script, crontab or FAM directly. For example: -Use the cron daemon to sync files in the **/install/custom///..synclist** to the nodegroup 'compute' every 10 minutes by the xdcp command by adding this to crontab. : :: +Use the **cron** daemon to sync files in the **/install/custom///..synclist** to the nodegroup **compute** every 10 minutes with the **xdcp** command by adding this to **crontab**. : :: */10 * * * * root /opt/xcat/bin/xdcp compute -F /install/custom///..synclist -Use the cron daemon to sync files for the nodegroup 'compute' every 10 minutes by updatenode command. :: +Use the **cron** daemon to sync files for the nodegroup **compute** every 10 minutes with ``updatenode`` command. :: */10 * * * * root /opt/xcat/bin/updatenode compute -F -** Related To do** -Add reference - - - - - - - diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_synclist_file.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_synclist_file.rst index 61cff2220..77b42e398 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_synclist_file.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_synclist_file.rst @@ -6,7 +6,7 @@ The synclist file .. _The_Format_of_synclist_file_label: The Format of synclist file -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~ The synclist file contains the configuration entries that specify where the files should be synced to. In the synclist file, each line is an entry which describes the location of the source files and the destination location of files on the target node. The basic entry format looks like following: :: @@ -21,9 +21,9 @@ The ``path_of_dst_file*`` should be the full path of the destination file on tar The ``path_of_dst_directory`` should be the full path of the destination directory. Make ``sure path_of_dst_directory`` is not a existing file on target node, otherwise, the file sync with ``updatenode -r /usr/bin/scp`` or ``xdcp -r /usr/bin/scp`` will fail. -Since the synclist file is for common purpose, the target node need not be configured in it. +If no target node is specified, the files will be synced to all nodes in the cluster. See "Support nodes in synclist file" below for how to specify a noderange. -Example: the following synclist formats are supported: +The following synclist formats are supported: sync file **/etc/file2** to the file **/etc/file2** on the node (with same file name) :: @@ -33,35 +33,35 @@ sync file **/etc/file2** to the file **/etc/file3** on the node (with different /etc/file2 -> /etc/file3 -sync file **/etc/file4** to the file **/etc/tmp/file5** on the node( different file name and directory). The directory will be automatically created for you. :: +sync file **/etc/file4** to the file **/etc/tmp/file5** on the node (different file name and directory). The directory will be automatically created for you. :: /etc/file4 -> /etc/tmp/file5 -sync the multiple files **/etc/file1**, **/etc/file2**, **/etc/file3**, ... to the directory **/tmp/etc** (**/tmp/etc** must be a directory when multiple files are synced at one time). If the directory does not exist, **xdcp** will create it. :: +sync the multiple files **/etc/file1**, **/etc/file2**, **/etc/file3**, ... to the directory **/tmp/etc** (**/tmp/etc** must be a directory when multiple files are synced at one time). If the directory does not exist, it will be created. :: /etc/file1 /etc/file2 /etc/file3 -> /tmp/etc -sync file **/etc/file2** to the file /etc/file2 on the node :: +sync file **/etc/file2** to the file **/etc/file2** on the node :: /etc/file2 -> /etc/ -sync all files in **/home/mikev** to directory **/home/mikev** on the node :: +sync all files, including subdirectories, in **/home/mikev** to directory **/home/mikev** on the node :: /home/mikev/* -> /home/mikev/ + or + /home/mikev -> /home/mikev/ -Note: Don't try to sync files to the read only directory on the target node. +.. note:: Don't try to sync files to the read only directory on the target node. An example of synclist file -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Assume a user wants to sync files to a node as following, the corresponding entries should be added in a synclist file. +~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sync the file **/etc/common_hosts** to the two places on the target node: put one to the **/etc/hosts**, the other to the **/tmp/etc/hosts**. Following configuration entries should be added :: /etc/common_hosts -> /etc/hosts /etc/common_hosts -> /tmp/etc/hosts -Sync files in the directory **/tmp/prog1** to the directory **/prog1** on the target node, and the postfix **'.tmpl'** needs to be removed on the target node. (directory **/tmp/prog1/** contains two files: **conf1.tmpl** and **conf2.tmpl**) Following configuration entries should be added :: +Sync files in the directory **/tmp/prog1** to the directory **/prog1** on the target node, and the postfix **.tmpl** needs to be removed on the target node. (directory **/tmp/prog1/** contains two files: **conf1.tmpl** and **conf2.tmpl**) Following configuration entries should be added :: /tmp/prog1/conf1.tmpl -> /prog1/conf1 /tmp/prog1/conf2.tmpl -> /prog1/conf2 @@ -80,7 +80,7 @@ Sample synclist file :: /tmp/* -> /tmp/ /etc/testfile -> /etc/ -If the above syncfile is performed by the **updatenode/xdcp** commands, or performed in a node installation process, the following files will exist on the target node with the following contents. :: +If the above syncfile is used by the ``updatenode``/``xdcp`` commands, or used in a node installation process, the following files will exist on the target node with the following contents. :: /etc/hosts(It has the same content with /etc/common_hosts on the MN) /tmp/etc/hosts(It has the same content with /etc/common_hosts on the MN) @@ -93,40 +93,41 @@ If the above syncfile is performed by the **updatenode/xdcp** commands, or perfo Support nodes in synclist file ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Note: From xCAT 2.9.2 on AIX and from xCAT 2.12 on Linux, xCAT support a new format for syncfile. The new format is :: +Starting with xCAT 2.9.2 on AIX and with xCAT 2.12 on Linux, xCAT supports a new format for syncfile. The new format is :: file -> (noderange for permitted nodes) file -The noderange would have several format. Following examples show that /etc/hosts file is synced to the nodes which is specified before the file name :: +The noderange can have several formats. Following examples show that **/etc/hosts** file is synced to the nodes which are specified before the file name :: /etc/hosts -> (node1,node2) /etc/hosts # The /etc/hosts file is synced to node1 and node2 /etc/hosts -> (node1-node4) /etc/hosts # The /etc/hosts file is synced to node1,node2,node3 and node4 /etc/hosts -> (node[1-4]) /etc/hosts # The /etc/hosts file is synced to node1, node2, node3 and node4 /etc/hosts -> (node1,node[2-3],node4) /etc/hosts # The /etc/hosts file is synced to node1, node2, node3 and node4 /etc/hosts -> (group1) /etc/hosts # The /etc/hosts file is synced to nodes in group1 - /etc/hosts -> (group1,group2) /etc/hosts # The /etc/hosts file is synced to nodes in group1 and group2 - -postscript support -~~~~~~~~~~~~~~~~~~ - -Putting the filename.post in the **rsyncfile** to ``rsync`` to the node is required for hierarchical clusters. It is optional for non-hierarchical cluster. + /etc/hosts -> (group1,group2) /etc/hosts # The /etc/hosts file is synced to nodes in group1 and group2 Advanced synclist file features -'''''''''''''''''''''''''''''''''' +''''''''''''''''''''''''''''''' -After you define the files to rsync in the syncfile, you can add an **EXECUTEALWAYS** clause in the syncfile. The **EXECUTEALWAYS** clause will list all the postscripts you would always like to run after the files are sync'd, whether or not any file is actually updated. The files in this list must be added to the list of files to rsync, if hierarchical. +**EXECUTE** -For example, your rsyncfile may look like this. -.. note:: the path to the file to EXECUTE, is the location of the *.post file on the MN**. :: +The **EXECUTE** clause is used to list all the postsync scripts (.post) you would like to run after the files are synced, only if the file is updated. For hierarchical clusters, the postsync files in this list must also be added to the list of files to sync. It is optional for non-hierarchical clusters. If noderange is used in the synclist for the file listed in the **EXECUTE** clause, the postsync script will only be executed on the nodes in that noderange. The **EXECUTE** clause is not supported oif ``-r /usr/bin/scp`` option is used with ``xdcp`` or ``updatenode`` command. +**EXECUTEALWAYS** + +The **EXECUTEALWAYS** clause is used to list all the postsync scripts you would like to run after the files are synced, whether or not any file is actually updated. The files in this list must be added to the list of files to sync. If noderange is used in the synclist for the file listed in the **EXECUTEALWAYS** clause, the script will only be exectuted on the nodes in that noderange. + +.. note:: The path to the file to EXECUTE or EXECUTEALWAYS, is the location of the file on the MN. + +For example, your syncfile may look like this.:: /tmp/share/file2 -> /tmp/file2 /tmp/share/file2.post -> /tmp/file2.post (required for hierarchical clusters) - /tmp/share/file3 -> /tmp/file3 + /tmp/share/file3 -> /tmp/filex /tmp/share/file3.post -> /tmp/file3.post (required for hierarchical clusters) /tmp/myscript1 -> /tmp/myscript1 /tmp/myscript2 -> /tmp/myscript2 - # the below are postscripts + # Postscripts EXECUTE: /tmp/share/file2.post /tmp/share/file3.post @@ -134,9 +135,9 @@ For example, your rsyncfile may look like this. /tmp/myscript1 /tmp/myscript2 -If **/tmp/file2** is updated on the node in **/tmp/file2**, then **/tmp/file2**.post is automatically run on that node. If **/tmp/file3** is updated on the node in **/tmp/filex**, then **/tmp/file3**.post is automatically run on that node. +If **/tmp/file2** is updated on the node in **/tmp/file2**, then **/tmp/file2.post** is automatically executed on that node. If **/tmp/file3** is updated on the node in **/tmp/filex**, then **/tmp/file3.post** is automatically executed on that node. -You can add an **APPEND** clause to your syncfile. +**APPEND** The **APPEND** clause is used to append the contents of the input file to an existing file on the node. The file to be appended must already exist on the node and not be part of the synclist that contains the **APPEND** clause. @@ -147,7 +148,7 @@ For example, your synclist file may look like this: :: /tmp/share/file3 -> /tmp/filex /tmp/share/file3.post -> /tmp/file3.post /tmp/myscript -> /tmp/myscript - # the below are postscripts + # Postscripts EXECUTE: /tmp/share/file2.post /tmp/share/file3.post @@ -157,15 +158,13 @@ For example, your synclist file may look like this: :: /etc/myappenddir/appendfile -> /etc/mysetup/setup /etc/myappenddir/appendfile2 -> /etc/mysetup/setup2 -When you use the **APPEND** clause, the file (left) of the arrow is appended to the file right of the arrow. In this example, **/etc/myappenddir/appendfile** is appended to **/etc/mysetup/setup** file, which must already exist on the node. The **/opt/xcat/share/xcat/scripts/xdcpappend.sh** is used to accomplish this. +When you use the **APPEND** clause, the source file to the left of the arrow is appended to the file to the right of the arrow. In this example, **/etc/myappenddir/appendfile** is appended to **/etc/mysetup/setup** file, which must already exist on the node. The **/opt/xcat/share/xcat/scripts/xdcpappend.sh** is used to accomplish this. -The script creates a backup of the original file on the node in the directory defined by the site table nodesyncfiledir attribute, which is **/var/xcat/node/syncfiles** by default. To update the original file when using the function, you need to rsync a new original file to the node, removed the old original from the **/var/xcat/node/syncfiles/org** directory. If you want to cleanup all the files for the append function on the node, you can use the ``xdsh -c`` flag. See man page for ``xdsh``. +The script creates a backup of the original file on the node in the directory defined by the **site** table **nodesyncfiledir** attribute, which is **/var/xcat/node/syncfiles** by default. To update the original file when using the function, you need to sync a new original file to the node, removed the old original from the **/var/xcat/node/syncfiles/org** directory. If you want to cleanup all the files for the append function on the node, you can use ``xdsh -c`` command. See man page for ``xdsh``. -.. note:: no order of execution may be assumed by the order that the **EXECUTE,EXECUTEALWAYS and APPEND** clause fall in the synclist file. +**MERGE** (supported on Linux only). -You can add an **MERGE** clause to your syncfile. This is only supported on Linux. - -The **MERGE** clause is used to append the contents of the input file to either the **/etc/passwd**, **/etc/shadow** or **/etc/group** files. They are the only supported files. You must not put the **/etc/passwd**, **/etc/shadow**, **/etc/group** files in an **APPEND** clause if using a **MERGE** clause. For these three file you should use a **MERGE** clause. The **APPEND** will add the information to the end of the file. The **MERGE** will add or replace the information and insure that there are no duplicate entries in these files. +The **MERGE** clause is used to append the contents of the input file to either the **/etc/passwd**, **/etc/shadow** or **/etc/group** files. They are the only supported files. You must not put the **/etc/passwd**, **/etc/shadow**, **/etc/group** files in an **APPEND** clause if using a **MERGE** clause. For these three files you should use the **MERGE** clause. The **APPEND** will add the information to the end of the file. The **MERGE** will add or replace the information and ensure that there are no duplicate entries in these files. For example, your synclist file may look like this :: @@ -174,7 +173,7 @@ For example, your synclist file may look like this :: /tmp/share/file3 -> /tmp/filex /tmp/share/file3.post -> /tmp/file3.post /tmp/myscript -> /tmp/myscript - # the below are postscripts + # Postscripts EXECUTE: /tmp/share/file2.post /tmp/share/file3.post @@ -185,20 +184,21 @@ For example, your synclist file may look like this :: /etc/mydir/mergeshadow -> /etc/shadow /etc/mydir/mergegroup -> /etc/group -When you use the **MERGE** clause, the file (left) of the arrow is merged into the file right of the arrow. It will replace any common userid's found in those files and add new userids. The **/opt/xcat/share/xcat/scripts/xdcpmerge.sh** is used to accomplish this. +When you use the **MERGE** clause, the source file to the left of the arrow is merged into the file to the right of the arrow. It will replace any common userids found in those files and add new userids. The **/opt/xcat/share/xcat/scripts/xdcpmerge.sh** is used to accomplish this. -.. note:: no order of execution may be assumed by the order that the **EXECUTE,EXECUTEALWAYS,APPEND and MERGE** clause fall in the synclist file. +.. note:: no order of execution may be assumed by the order of **EXECUTE, EXECUTEALWAYS, APPEND and MERGE** clauses in the synclist file. .. _the_localtion_of_synclist_file_for_updatenode_label: The location of synclist file for updatenode and install process -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -In the installation process or updatenode process, xCAT needs to figure out the location of the synclist file automatically, so the synclist should be put into the specified place with the proper name. +In the installation process or **updatenode** process, xCAT needs to figure out the location of the synclist file automatically, so the synclist should be put into the specified place with the proper name. -If the provisioning method for the node is an osimage name, then the path to the synclist will be read from the osimage definition synclists attribute. You can display this information by running the following command, supplying your osimage name. :: +If the provisioning method for the node is an osimage name, then the path to the synclist will be read from the osimage definition **synclists** attribute. You can display this information by running the following command, supplying your osimage name. :: lsdef -t osimage -l --netboot-compute + Object name: --netboot-compute exlist=/opt/xcat/share/xcat/netboot//compute.exlist imagetype=linux @@ -217,20 +217,21 @@ You can set the synclist path using the following command :: chdef -t osimage -o --netboot-compute synclists="/install/custom/netboot/compute.synclist -If the provisioning method for the node is install,or netboot then the path to the synclist should be of the following format :: +If the provisioning method for the node is `install`, or `netboot` then the path to the synclist should be in the following format :: /install/custom///...synclist + : "install", "netboot" : "rh", "centos", "fedora", "sles" - ,and are what you set for the node + , and are what you set for the node For example: -The location of synclist file for the diskful installation of with 'compute' as the profile :: +The location of synclist file for the diskful installation of RedHat 7.5 with **compute** as the profile :: - /install/custom///..synclist + /install/custom/install/rh/compute.rhels7.5.synclist -The location of synclist file for the diskless netboot of with '' as the profile :: +The location of synclist file for the diskless netboot of SLES 12.3 with **service** as the profile :: - /install/custom///..synclist + /install/custom/netboot/sles/service.sles12.3.synclist diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_updatenode.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_updatenode.rst index b7cda3461..6cfdc2d2a 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_updatenode.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_updatenode.rst @@ -1,7 +1,7 @@ Run the Syncing File action in the updatenode process ------------------------------------------------------- +----------------------------------------------------- -If run ``updatenode`` command with -F option, it syncs files which configured in the synclist to the nodes. ``updatenode`` does not sync images, use ``xdcp -i -F`` option to sync images. +Running ``updatenode`` command with **-F** option, will sync files configured in the synclist file to the nodes. ``updatenode`` does not sync images, use ``xdcp -i -F`` command to sync images. ``updatenode`` can be used to sync files to to diskful or diskless nodes. ``updatenode`` cannot be used to sync files to statelite nodes. @@ -9,7 +9,7 @@ Steps to make the Syncing File working in the ``updatenode -F`` command: #. Create the synclist file with the entries indicating which files should be synced. (refer to :ref:`The_Format_of_synclist_file_label`) #. Put the synclist into the proper location (refer to :ref:`the_localtion_of_synclist_file_for_updatenode_label`). - #. Run the ``updatenode node -F`` command to initiate the Syncing File action. + #. Run the ``updatenode -F`` command to initiate the Syncing File action. -Note: Since Syncing File action can be initiated by the ``updatenode -F`` flag, the ``updatenode -P`` does NOT support to re-run the **'syncfiles'** postscript, even if you specify the **'syncfiles'** postscript in the ``updatenode`` command line or set the **'syncfiles'** in the **postscripts.postscripts** attribute. +.. note:: Since Syncing File action can be initiated by the ``updatenode -F``, the ``updatenode -P`` does NOT support to re-run the **syncfiles** postscript, even if you specify the **syncfiles** postscript on the ``updatenode`` command line or set the **syncfiles** in the **postscripts.postscripts** attribute. diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_xdcp.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_xdcp.rst index 20d1bb84c..41cc01990 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_xdcp.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_xdcp.rst @@ -1,30 +1,31 @@ Run xdcp command to perform Syncing File action ------------------------------------------------ -``xdcp`` command supplies three options **'-F' , -s, and '-i'** to support the Syncing File function. +``xdcp`` command supplies three options **-F** , **-s**, and **-i** to support the Syncing File function. - * -F|--File rsync input file + * -F|--File -Specifies the full path to the synclist file that will be used to build the ``rsync`` command +Specifies the full path to the synclist file - * -s + * -s -Specifies to rsync to the service nodes only for the input compute noderange. +Specifies to sync to the service nodes only for the input compute noderange. - * -i|--rootimg install image for Linux + * -i | --rootimg -Specifies the full path to the install image on the local node. By default, if the -F option is specified, the **'rsync'** command is used to perform the syncing file function. For the ``rsync`` in ``xdcp``, only the ***ssh** remote shell is supported for ``rsync``. ``xdcp`` uses the **'-Lpotz'** as the default flags to call the rsync command. More flags for rsync command can be specified by adding **'-o'** flag to the call to ``xdcp``. +Specifies the full path to the install image on the local node. -For example: :: +By default, if the **-F** option is specified, the ``rsync`` command is used to perform the syncing file function. Only the **ssh** remote shell is supported for ``rsync``. ``xdcp`` uses the **-Lpotz** as the default flags to call the ``rsync`` command. More flags for ``rsync`` command can be specified by adding **-o** flag to the call to ``xdcp``. + +For example you can use ``xdcp`` **-F** option to sync files which are listed in the **/install/custom/commonsyncfiles/.synclist** file to the node group named **compute**. If the node group **compute** is serviced by servicenodes, then the files will be automatically staged to the correct service nodes, and then synced to the compute nodes from those service nodes. The files will be stored in **/var/xcat/syncfiles** directory on the service nodes by default, or in the directory indicated in the **site.SNsyncfiledir** attribute. See **-s** option below. :: - Using xdcp '-F' option to sync files which are listed in the /install/custom/commonsyncfiles/.synclist directory to the node group named 'compute'. If the node group compute is serviced by servicenodes, then the files will be automatically staged to the correct service nodes, and then synced to the compute nodes from those service nodes. The files will be stored in /var/xcat/syncfiles directory on the service nodes by default, or in the directory indicated in the site.SNsyncfiledir attribute. See -s option below. xdcp compute -F /install/custom/commonsynfiles/.synclist -For Linux nodes, using **xdcp '-i'** option with **'-F'** to sync files created in the **/install/custom//.synclist** to the osimage in the directory **/install/////rootimg**: :: +For Linux nodes, you can use ``xdcp`` command **-i** option with **-F** to sync files specified in the **/install/custom//.synclist** file to the osimage in the directory **/install/////rootimg**: :: xdcp -i /install/////rootimg -F /install/custom///.synclist -Using the **xdcp '-s'** option to sync the files only to the service nodes for the node group named 'compute'. The files will be placed in the default **/var/xcat/syncfiles** directory or in the directory as indicated in the **site.SNsyncfiledir** attribute. If you want the files synched to the same directory on the service node that they come from on the Management Node, set **site.SNsyncfiledir=/**. This can be setup before a node install, to have the files available to be synced during the install: :: +You can use the ``xdcp`` **-s** option to sync the files only to the service nodes for the node group named **compute**. The files will be placed in the default **/var/xcat/syncfiles** directory or in the directory as indicated in the **site.SNsyncfiledir** attribute. If you want the files synched to the same directory on the service node that they come from on the Management Node, set **site.SNsyncfiledir=/** attribute. This can be setup before a node install, to have the files available to be synced during the install: :: xdcp compute -s -F /install/custom///.synclist diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/management/advanced/rflash/openbmc/openbmc_common.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/management/advanced/rflash/openbmc/openbmc_common.rst index 5f6d11318..46060c9df 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/management/advanced/rflash/openbmc/openbmc_common.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/management/advanced/rflash/openbmc/openbmc_common.rst @@ -6,17 +6,12 @@ Unattended flash of OpenBMC firmware will do the following events: #. Activate both BMC firmware and Host firmware #. If BMC firmware becomes activate, reboot BMC to apply new BMC firmware, or else, ``rflash`` will exit #. If BMC itself state is ``NotReady``, ``rflash`` will exit -#. If BMC itself state is ``Ready``, and use ``--no-host-reboot`` option, ``rflash`` will not reboot the compute node -#. If BMC itself state is ``Ready``, and do not use ``--no-host-reboot`` option, ``rflash`` will reboot the compute node to apply Host firmware +#. If BMC itself state is ``Ready``, ``rflash`` will reboot the compute node to apply Host firmware Use the following command to flash the firmware unattended: :: rflash -d /path/to/directory -Use the following command to flash the firmware unattended and not reboot the compute node: :: - - rflash -d /path/to/directory --no-host-reboot - If there are errors encountered during the flash process, take a look at the manual steps to continue flashing the BMC. .. END_unattended_OpenBMC_flashing diff --git a/docs/source/guides/admin-guides/references/man1/bmcdiscover.1.rst b/docs/source/guides/admin-guides/references/man1/bmcdiscover.1.rst index 238924d21..9a0962c41 100644 --- a/docs/source/guides/admin-guides/references/man1/bmcdiscover.1.rst +++ b/docs/source/guides/admin-guides/references/man1/bmcdiscover.1.rst @@ -48,13 +48,13 @@ OPTIONS \ **-**\ **-range**\ - Specify one or more IP ranges acceptable to nmap. IP range can be hostnames, IP addresses, networks, etc. A single IP address (10.1.2.3), several IPs with commas (10.1.2.3,10.1.2.10), Ip range with "-" (10.1.2.0-100) or an IP range (10.1.2.0/24) can be specified. If the range is very large, the \ **bmcdiscover**\ command may take a long time to return. + Specify one or more IP ranges acceptable to \ **nmap**\ . IP range can be hostnames, IP addresses, networks, etc. A single IP address (10.1.2.3), several IPs with commas (10.1.2.3,10.1.2.10), Ip range with "-" (10.1.2.0-100) or an IP range (10.1.2.0/24) can be specified. If the range is very large, the \ **bmcdiscover**\ command may take a long time to return. \ **-**\ **-sn**\ - Specify one or more service nodes on which bmcdiscover will run. In hierarchical cluster, the MN may not be able to access the BMC of CN directly, but SN can. With this option, bmcdiscover will be dispatched to the specified SNs. Then, the nodename of the service node that 'bmcdiscover' is running on will be set to the 'servicenode' attribute of the discovered BMC node. + Specify one or more service nodes on which bmcdiscover will run. In hierarchical cluster, the MN may not be able to access the BMC of CN directly, but SN can. With this option, \ **bmcdiscover**\ will be dispatched to the specified SNs. Then, the nodename of the service node that \ **bmcdiscover**\ is running on will be set to the 'servicenode' attribute of the discovered BMC node. @@ -163,7 +163,7 @@ Output is similar to: conserver=sn01 -4. Discover the BMCs and write the discovered-node definitions into the xCAT database and write out the stanza foramt to the console: +4. Discover the BMCs and write the discovered node definitions into the xCAT database and write out the stanza format to the console: .. code-block:: perl diff --git a/docs/source/guides/admin-guides/references/man1/lsdef.1.rst b/docs/source/guides/admin-guides/references/man1/lsdef.1.rst index e5585d61b..0c20e42d0 100644 --- a/docs/source/guides/admin-guides/references/man1/lsdef.1.rst +++ b/docs/source/guides/admin-guides/references/man1/lsdef.1.rst @@ -21,13 +21,13 @@ SYNOPSIS \ **lsdef**\ [\ **-h | -**\ **-help**\ ] [\ **-t**\ \ *object-types*\ ] [\ **-i**\ \ *attr-list*\ ] -\ **lsdef**\ [\ **-V | -**\ **-verbose**\ ] [\ **-l | -**\ **-long**\ ] [\ **-s | -**\ **-short**\ ] [\ **-a | -**\ **-all**\ ] [\ **-S**\ ] -[\ **-t**\ \ *object-types*\ ] [\ **-o**\ \ *object-names*\ ] [\ **-z | -**\ **-stanza**\ ] [\ **-i**\ \ *attr-list*\ ] +\ **lsdef**\ [\ **-V | -**\ **-verbose**\ ] [\ **-a | -**\ **-all**\ ] [\ **-S**\ ] +[\ **-t**\ \ *object-types*\ ] [\ **-o**\ \ *object-names*\ ] [\ **-z | -**\ **-stanza**\ ] [\ **-i**\ \ *attr-list*\ | [\ **-l | -**\ **-long**\ ] | [\ **-s | -**\ **-short**\ ]] [\ **-c | -**\ **-compress**\ ] [\ **-**\ **-osimage**\ ] [\ **-**\ **-nics**\ ] [[\ **-w**\ \ *attr*\ ==\ *val*\ ] [\ **-w**\ \ *attr*\ =~\ *val*\ ] ...] [\ *noderange*\ ] -\ **lsdef**\ [\ **-l | -**\ **-long**\ ] [\ **-a | -**\ **-all**\ ] [\ **-t**\ \ *object-types*\ ] [\ **-z | -**\ **-stanza**\ ] -[\ **-i**\ \ *attr-list*\ ] [\ **-**\ **-template**\ [\ *template-object-name*\ ]] +\ **lsdef**\ [\ **-a | -**\ **-all**\ ] [\ **-t**\ \ *object-types*\ ] [\ **-z | -**\ **-stanza**\ ] +[\ **-i**\ \ *attr-list*\ | [\ **-l | -**\ **-long**\ ] | [\ **-s | -**\ **-short**\ ]] [\ **-**\ **-template**\ [\ *template-object-name*\ ]] *********** @@ -49,15 +49,15 @@ OPTIONS Display all definitions. For performance consideration, the auditlog and eventlog objects will not be listed. - To list auditlog or eventlog objects, use lsdef -t auditlog or lsdef -t eventlog instead. + To list auditlog or eventlog objects, use \ **lsdef -t auditlog**\ or \ **lsdef -t eventlog**\ instead. \ **-c|-**\ **-compress**\ Display information in compressed mode, each output line has format ": ". - The output can be passed to command xcoll or xdshbak for formatted output. - The -c flag must be used with -i flag. + The output can be passed to command \ **xcoll**\ or \ **xdshbak**\ for formatted output. + The \ **-c**\ flag must be used with \ **-i**\ flag. @@ -136,13 +136,18 @@ OPTIONS \ **-w**\ \ *attr==val*\ \ **-w**\ \ *attr=~val*\ ... - Use one or multiple -w flags to specify the selection string that can be used to select objects. The operators ==, !=, =~ and !~ are available. Use the help option to get a list of valid attributes for each object type. + Use one or multiple \ **-w**\ flags to specify the selection string that can be used to select objects. The operators ==, !=, =~ and !~ are available. Use the help option to get a list of valid attributes for each object type. Operator descriptions: - == Select nodes where the attribute value is exactly this value. - != Select nodes where the attribute value is not this specific value. - =~ Select nodes where the attribute value matches this regular expression. - !~ Select nodes where the attribute value does not match this regular expression. + + + .. code-block:: perl + + == Select nodes where the attribute value is exactly this value. + != Select nodes where the attribute value is not this specific value. + =~ Select nodes where the attribute value matches this regular expression. + !~ Select nodes where the attribute value does not match this regular expression. + Note: if the "val" fields includes spaces or any other characters that will be parsed by shell, the "attrval" needs to be quoted. If the operator is "!~", the "attrval" needs to be quoted using single quote. @@ -150,7 +155,7 @@ OPTIONS \ **-z|-**\ **-stanza**\ - Display output in stanza format. See the xcatstanzafile man page for details on using xCAT stanza files. + Display output in stanza format. See the "xcatstanzafile" man page for details on using xCAT stanza files. And default is to list complete object definition, use \ **-i**\ to specify the attribute scope. @@ -191,8 +196,6 @@ EXAMPLES .. code-block:: perl - lsdef - OR lsdef -a @@ -350,7 +353,7 @@ EXAMPLES 15. - To list the nodes status and use xcoll to format the output. + To list the nodes status and use \ **xcoll**\ to format the output. .. code-block:: perl diff --git a/docs/source/guides/admin-guides/references/man1/updatenode.1.rst b/docs/source/guides/admin-guides/references/man1/updatenode.1.rst index 48ed01138..0b64d2314 100644 --- a/docs/source/guides/admin-guides/references/man1/updatenode.1.rst +++ b/docs/source/guides/admin-guides/references/man1/updatenode.1.rst @@ -19,7 +19,7 @@ SYNOPSIS ******** -\ **updatenode**\ \ *noderange*\ [\ **-V | -**\ **-verbose**\ ] [\ **-F | -**\ **-sync**\ ] [\ **-f | -**\ **-snsync**\ ] [\ **-r | -**\ **-node-rcp**\ [\ *full_path_to_remote_copy_command*\ ]] [\ **-S | -**\ **-sw**\ ] [\ **-l**\ \ *userID*\ ] [\ **-P | -**\ **-scripts**\ [\ *script1,script2...*\ ]] [\ **-s | -**\ **-sn**\ ] [\ **-A | -**\ **-updateallsw**\ ] [\ **-c | -**\ **-cmdlineonly**\ ] [\ **-d**\ \ *alt_source_dir*\ ] [\ **-**\ **-fanout**\ =\ *fanout_value*\ ] [\ **-t**\ \ *timeout*\ } [\ *attr=val*\ [\ *attr=val...*\ ]] [\ **-n | -**\ **-noverify**\ ] +\ **updatenode**\ \ *noderange*\ [\ **-V | -**\ **-verbose**\ ] [\ **-F | -**\ **-sync**\ ] [\ **-f | -**\ **-snsync**\ ] [\ **-r | -**\ **-node-rcp**\ [\ *node_remote_copy_command*\ ]] [\ **-S | -**\ **-sw**\ ] [\ **-l**\ \ *userID*\ ] [\ **-P | -**\ **-scripts**\ [\ *script1,script2...*\ ]] [\ **-s | -**\ **-sn**\ ] [\ **-A | -**\ **-updateallsw**\ ] [\ **-c | -**\ **-cmdlineonly**\ ] [\ **-d**\ \ *alt_source_dir*\ ] [\ **-**\ **-fanout**\ =\ *fanout_value*\ ] [\ **-t**\ \ *timeout*\ } [\ *attr=val*\ [\ *attr=val...*\ ]] [\ **-n | -**\ **-noverify**\ ] \ **updatenode**\ \ **noderange**\ [\ **-k | -**\ **-security**\ ] [\ **-t**\ \ *timeout*\ ] @@ -37,7 +37,7 @@ DESCRIPTION *********** -The updatenode command is run on the xCAT management node and can be used +The \ **updatenode**\ command is run on the xCAT management node and can be used to perform the following node updates: @@ -58,10 +58,10 @@ Update the ca and credentials for the service nodes. -The default behavior when no options are input to updatenode will be to run +The default behavior when no options are input to \ **updatenode**\ will be to run the following options \ **-S**\ , \ **-P**\ and \ **-F**\ options in this order. -If you wish to limit updatenode to specific -actions you can use combinations of the \ **-S**\ , \ **-P**\ , and \ **-F**\ flags. +If you wish to limit \ **updatenode**\ to specific +actions you can use combination of the \ **-S**\ , \ **-P**\ , and \ **-F**\ flags. For example, If you just want to synchronize configuration file you could specify the \ **-F**\ flag. If you want to synchronize files and update @@ -74,7 +74,7 @@ The flag \ **-f**\ (\ **-**\ **-snsync**\ ) can NOT be used together with \ **- Note: In a large cluster environment the updating of nodes in an ad hoc manner can quickly get out of hand, leaving the system administrator with -a very confusing environment to deal with. The updatenode command is +a very confusing environment to deal with. The \ **updatenode**\ command is designed to encourage users to handle cluster updates in a manner that is recorded and easily repeatable. @@ -93,14 +93,14 @@ The basic process for distributing and synchronizing nodes is: -\* Run the updatenode command to update the nodes. +\* Run the \ **updatenode**\ command to update the nodes. Files may be distributed and synchronized for both diskless and diskful nodes. Syncing files to NFS-based statelite nodes is not supported. -More information on using the synchronization file function is in the following doc: Using_Updatenode. +More information on using the synchronization file function is in the following document: Create the synclist file ------------------------ @@ -111,9 +111,7 @@ where the files should be synced to. In the synclist file, each line is an entry which describes the location of the source files and the destination location for the files on the target node. -For more information on creating your synclist files and where to put them, read: - -Sync-ing_Config_Files_to_Nodes +For more information on creating your synclist files and where to put them, read here: Run updatenode to synchronize the files @@ -382,12 +380,12 @@ OPTIONS \ **-F|-**\ **-sync**\ Specifies that file synchronization should be - performed on the nodes. rsync/scp and ssh must + performed on the nodes. \ **rsync/scp**\ and \ **ssh**\ must be installed and configured on the nodes. The function is not supported for NFS-based statelite installations. For NFS-based statelite installations to sync files, you should use the read-only option for files/directories listed in - litefile table with source location specified in the litetree table. + \ **litefile**\ table with source location specified in the \ **litetree**\ table. @@ -396,33 +394,33 @@ OPTIONS Specifies that file synchronization should be performed to the service nodes that service the nodes in the noderange. This updates the service - nodes with the data to sync to the nodes. rsync/scp and ssh must + nodes with the data to sync to the nodes. \ **rsync/scp**\ and \ **ssh**\ must be installed and configured on the service nodes. For hierarchy, this optionally can be done before syncing the files - to the nodes with the -F flag. If the -f flag is not used, then - the -F flag will sync the servicenodes before the nodes automatically. + to the nodes with the \ **-F**\ flag. If the \ **-f**\ flag is not used, then + the \ **-F**\ flag will sync the service nodes before the nodes automatically. When installing nodes in a hierarchical cluster, this flag should be used to sync the service nodes before the install, since the files will - be sync'd from the service node by the syncfiles postscript during the + be synced from the service node by the \ **syncfiles**\ postscript during the install. The function is not supported for NFS-based statelite installations. For statelite installations to sync files, you should use the read-only option for files/directories listed in - litefile table with source location specified in the litetree table. + \ **litefile**\ table with source location specified in the \ **litetree**\ table. -[\ **-r | -**\ **-node-rcp**\ [\ *full_path_to_remote_copy_command*\ ]] +[\ **-r | -**\ **-node-rcp**\ [\ *node_remote_copy_command*\ ]] - Specifies the full path of the remote copy command used for syncing files to node targets, such as "/usr/bin/rsync" or "/usr/bin/scp". If not specified, rsync will be used by default. + Specifies the full path of the remote copy command used for syncing files to node targets, such as \ **/usr/bin/rsync**\ or \ **/usr/bin/scp**\ . If not specified, \ **rsync**\ will be used by default. - Notice: The synclist for "-r /usr/bin/scp" has some differences with "-r /usr/bin/rsync": + Note: The synclist processing for \ **-r /usr/bin/scp**\ has some differences with \ **-r /usr/bin/rsync**\ : - 1) the \`\`EXECUTE\`\` clause is not supported in "-r /usr/bin/scp" + 1) the \ **EXECUTE**\ clause in synclist file is not supported with \ **-r /usr/bin/scp**\ flag - 2) if the destination directory specified in synclist is an existing file on target node, "updatenode -r /usr/bin/scp" will fail with \`\`scp: : Not a directory\`\` + 2) if the destination directory specified in synclist file is an existing file on target node, \ **updatenode -r /usr/bin/scp**\ will fail with "scp: : Not a directory" - 3) if the destination file specified in synclist is an existing directory on target node, "updatenode -r /usr/bin/scp" will fail with \`\`scp: : Is a directory\`\` + 3) if the destination file specified in synclist file is an existing directory on target node, \ **updatenode -r /usr/bin/scp**\ will fail with "scp: : Is a directory" @@ -461,8 +459,8 @@ OPTIONS \ **-P|-**\ **-scripts**\ Specifies that postscripts and postbootscripts should be run on the nodes. - updatenode -P syncfiles is not supported. The syncfiles postscript can only - be run during install. You should use updatenode -F instead. + File sync with \ **updatenode -P syncfiles**\ is not supported. The \ **syncfiles**\ postscript can only + be run during install. You should use \ **updatenode -F**\ instead. @@ -546,14 +544,14 @@ EXAMPLES -3. Running updatenode -P with the syncfiles postscript is not supported. You should use updatenode -F instead. +3. Running \ **updatenode -P**\ with the \ **syncfiles**\ postscript is not supported. You should use \ **updatenode -F**\ instead. Do not run: .. code-block:: perl - updatenode clstrno1 -P syncfiles + updatenode clstrn01 -P syncfiles Run: diff --git a/docs/source/guides/admin-guides/references/man1/xcatperftest.1.rst b/docs/source/guides/admin-guides/references/man1/xcatperftest.1.rst index 8276fcbb8..aa7fccb0d 100644 --- a/docs/source/guides/admin-guides/references/man1/xcatperftest.1.rst +++ b/docs/source/guides/admin-guides/references/man1/xcatperftest.1.rst @@ -21,6 +21,8 @@ SYNOPSIS \ **xcatperftest**\ [\ **-?|-h**\ ] +[\ **PERF_DRYRUN**\ =y] \ **xcatperftest run**\ [\ *command-list-file*\ ] + [\ **PERF_DRYRUN**\ =y] [\ **PERF_NOCREATE**\ =y] \ **xcatperftest**\ [\ *command-list-file*\ ] @@ -29,23 +31,23 @@ DESCRIPTION *********** -The xcatperftest command runs commandes defined in a command list file and get their execution response time baseline for performance purpose. -The xcatperftest command is part of the xCAT package xCAT-test, and you can run it standalone or leverage it to build up your automation test cases. +The \ **xcatperftest**\ command runs commands defined in a command list file and get their execution response time baseline for performance purpose. +The \ **xcatperftest**\ command is part of the xCAT package \ **xCAT-test**\ , and you can run it standalone or leverage it to build up your automation test cases. -Any commands could be defined in the command list file, however, it is recommended that the one-time initial configuration are well prepared prior to run xcatperftest command. -For example, the network object, osdistor and osimage image objects. +Any command could be defined in the command list file, however, it is recommended that the one-time initial configuration is well prepared prior to running \ **xcatperftest**\ command. +For example, the network object, osdistro and osimage image objects. -Follow the below steps to run xcatperftest command: +Follow the steps below to run \ **xcatperftest**\ command: -1, Install xCAT-test on a xCAT management nodes. +1. Install \ **xCAT-test**\ on a xCAT management node. -2, Prepare a command list in which the commands are what you want to messure. +2. Prepare a command list with the commands you want to measure. -3, Prepare the initial configuration based on the command list to make sure all commands could be executed in techinal. +3. Prepare the initial configuration based on the command list to make sure all commands could be executed in techinal. -4, Run xcatperftest with the total fake nodes number and the above command list file. +4. Run \ **xcatperftest**\ with the total fake nodes number and the above command list file. -Node: It is suggested to run the command in background as it normally takes long time to finish all the performanc testing with large amount of fake nodes. +Node: It is suggested to run the command in background as it normally takes long time to finish all the performance testing with large amount of fake nodes. ******* @@ -60,7 +62,7 @@ OPTIONS - +\ *command-list-file*\ Specifies the command list file with full-path. xCAT supports an example command file: /opt/xcat/share/xcat/tools/autotest/perfcmds.lst @@ -88,7 +90,7 @@ COMMAND LIST FILE ***************** -The command list file is in flat text format, the testing framework will parse the file line by line, here is an example of the commannd list file: +The command list file is in flat text format, the testing framework will parse the file line by line, here is an example of the command list file: .. code-block:: perl @@ -110,13 +112,13 @@ The command list file is in flat text format, the testing framework will parse t \ **Note**\ : Each line defines one command, and the commands dependency should be handled by the line order. -If you define a node range series line (started with #SERIES#) in this file, xcatperftest will run the command for each node range defined in series line. +If you define a node range series line (started with \ **#SERIES#**\ ) in this file, xcatperftest will run the command for each node range defined in series line. \ **#SERIES#**\ To define a node range series, and the series should be an comma split incremental number sequence. \ **#STANZ#**\ It will be replaced with real stanz file path when this command line runs. -\ **#NODES#**\ It will be replaced with real node range defined in #SERIES# line when this command line runs. If no series line, the node group will be used. +\ **#NODES#**\ It will be replaced with real node range defined in \ **#SERIES#**\ line when this command line runs. If no series line, the node group will be used. \ **#PERFGRP#**\ It will be replaced with node group when this command line runs. @@ -126,7 +128,7 @@ ENVIRONMENT VARIABLE ******************** -The xcatperftest command supports be customized by some environment variables. +The \ **xcatperftest**\ command supports customization by some environment variables. \ **FAKE_NODE_PREFIX**\ @@ -148,15 +150,15 @@ It must be a string like 'A.B' and no need to be defined in 'networks' table. \ **PERF_NODETEMPL**\ -Optional, The node template name used for generating fake nodes. By default, it will be auto-detected according to the current arch. +Optional, the node template name used for generating fake nodes. By default, it will be auto-detected according to the current arch. \ **PERF_DRYRUN**\ -Optional, Indicate no real commands will be executed if the environment variable is set. +Optional, indicate no real commands will be executed if the environment variable is set. \ **PERF_NOCREATE**\ -Optional, Indicate no new fake nodes will be created if the environment variable is set. +Optional, indicate no new fake nodes will be created if the environment variable is set. ******** @@ -201,6 +203,18 @@ EXAMPLES +4. + + To run the performance testing for the commands defined in /tmp/cmd.lst in existing xCAT environment: + + + .. code-block:: perl + + xcatperftest run /tmp/cmd.lst + + + + ***** FILES diff --git a/docs/source/guides/admin-guides/references/man1/xdcp.1.rst b/docs/source/guides/admin-guides/references/man1/xdcp.1.rst index 7b1ea700d..49732546a 100644 --- a/docs/source/guides/admin-guides/references/man1/xdcp.1.rst +++ b/docs/source/guides/admin-guides/references/man1/xdcp.1.rst @@ -11,7 +11,7 @@ xdcp.1 ************ -\ **xdcp**\ - Concurrently copies files to or from multiple nodes. In addition, provides an option to use rsync to update the files on the nodes, or to an installation image on the local node. +\ **xdcp**\ - Concurrently copies files to or from multiple nodes. In addition, provides an option to use \ **rsync**\ to update the files on the managed nodes, or to an installation image on the local node. **************** @@ -19,13 +19,13 @@ xdcp.1 **************** -\ **xdcp**\ \ *noderange*\ [[\ **-B**\ | \ **-**\ **-bypass**\ ] [\ **-f**\ \ *fanout*\ ] [\ **-L**\ ] [\ **-l**\ \ *userID*\ ] [\ **-o**\ \ *node_options*\ ] [\ **-p**\ ] [\ **-P**\ ] [\ **-r**\ \ *node_remote_shell*\ ] [\ **-R**\ ] [\ **-t**\ \ *timeout*\ ] [\ **-T**\ ] [\ **-v**\ ] [\ **-q**\ ] [\ **-X**\ \ *env_list*\ ] \ *sourcefile.... targetpath*\ +\ **xdcp**\ \ *noderange*\ [[\ **-B**\ | \ **-**\ **-bypass**\ ] [\ **-f**\ \ *fanout*\ ] [\ **-L**\ ] [\ **-l**\ \ *userID*\ ] [\ **-o**\ \ *node_options*\ ] [\ **-p**\ ] [\ **-P**\ ] [\ **-r**\ \ *node remote copy command] [\ \*\*-R\*\*\ ] [\ \*\*-t\*\*\ \ \*timeout\*\ ] [\ \*\*-T\*\*\ ] [\ \*\*-v\*\*\ ] [\ \*\*-q\*\*\ ] [\ \*\*-X\*\*\ \ \*env_list\*\ ] \ \*sourcefile.... targetpath\*\ *\ -\ **xdcp**\ \ *noderange*\ [\ **-F**\ \ *rsync input file*\ ] +\ **xdcp**\ \ *noderange*\ [\ **-F**\ \ *rsynclist input file*\ ] [\ **-r**\ \ *node remote copy command*\ ] -\ **xdcp**\ \ *computenoderange*\ [\ **-s**\ \ **-F**\ \ *rsync input file*\ ] +\ **xdcp**\ \ *computenoderange*\ [\ **-s**\ \ **-F**\ \ *synclist input file*\ ] [\ **-r**\ \ *node remote copy command*\ ] -\ **xdcp**\ [\ **-i**\ \ *path to install image*\ ] [\ **-F**\ \ *rsync input file*\ ] +\ **xdcp**\ [\ **-i**\ \ *install image*\ ] [\ **-F**\ \ *synclist input file*\ ] [\ **-r**\ \ *node remote copy command*\ ] \ **xdcp**\ [\ **-h**\ | \ **-V**\ | \ **-q**\ ] @@ -36,33 +36,32 @@ xdcp.1 The \ **xdcp**\ command concurrently copies files to or from remote target -nodes. The command issues a remote copy command for each node or device specified. When files are pulled from a target, they are placed into the target_path with the name of the -remote node or device appended to the copied source_file name. The -/usr/bin/rcp command is the model for syntax and security. -If using hierarchy, then xdcp runs on the service node that is servicing the compute node. The file will first be copied to the path defined in the site table, SNsyncfiledir attribute, or the default path /var/xcat/syncfiles on the service node, if the attribute is not defined. The -P flag will not automatically copy +nodes. The command issues a remote copy command for each node or device specified. When files are pulled from a target, they are placed into the \ *targetpath*\ with the name of the +remote node or device appended to the copied \ *sourcefile*\ name. The +\ **/usr/bin/rcp**\ command is the model for syntax and security. +If using hierarchy, then \ **xdcp**\ runs on the service node that is servicing the compute node. The file will first be copied to the path defined in the site table, \ **SNsyncfiledir**\ attribute, or the default path \ **/var/xcat/syncfiles**\ on the service node, if the attribute is not defined. The \ **-P**\ flag will not automatically copy the files from the compute node to the Management node, hierarchically. There is a two step process, see \ **-P**\ flag. -If the Management Node is target node, it must be defined in the xCAT database with nodetype=mn. When the \ **xdcp**\ command runs the Management Node as the target, it does not use remote commands but uses the local OS copy (\ **cp**\ ) command. +If the Management Node is target node, it must be defined in the xCAT database with \ **nodetype=mn**\ . When the \ **xdcp**\ command runs with the Management Node as the target, it does not use remote commands but uses the local OS copy (\ **cp**\ ) command. \ **REMOTE**\ \ **USER**\ : -A user_ID can be specified for the remote copy command. Remote user -specification is identical for the \ **xdcp**\ and \ **xdsh**\ commands. See the \ **xdsh**\ -command for more information. +A user_ID can be specified for the remote copy command. Remote user +specification is identical for the \ **xdcp**\ and \ **xdsh**\ commands. +See the \ **xdsh**\ command for more information. \ **REMOTE**\ \ **COMMAND**\ \ **COPY**\ : The \ **xdcp**\ command uses a configurable remote copy command to execute remote copies on remote targets. Support is explicitly provided for -Remote Shell rcp command, the OpenSSH scp command and the -/usr/bin/rsync command. +Remote Shell \ **rcp**\ command, the OpenSSH \ **scp**\ command and the +\ **/usr/bin/rsync**\ command. -For node targets, the remote copy command is determined by the follow- -ing order of precedence: +For node targets, the remote copy command is determined by the following order of precedence: 1. The \ **-r**\ flag. -2. The \ **/usr/bin/scp**\ command. +2. The \ **/usr/bin/rsync**\ command. \ **COMMAND**\ \ **EXECUTIONS**\ : @@ -75,10 +74,10 @@ appropriate. A timeout value for remote copy command execution can be specified with the \ **-t**\ flag or DSH_TIMEOUT environment variable. If any remote target -does not respond within the timeout value, the xdcp command displays an +does not respond within the timeout value, the \ **xdcp**\ command displays an error message and exits. -The \ **-T**\ flag provides diagnostic trace information for dcp command execution. Default settings and the actual remote copy commands that are executed to the remote targets are displayed. +The \ **-T**\ flag provides diagnostic trace information for \ **xdcp**\ command execution. Default settings and the actual remote copy commands that are executed to the remote targets are displayed. The \ **xdcp**\ command can be executed silently using the \ **-Q**\ flag; no target standard output or standard error is displayed. @@ -94,170 +93,45 @@ standard output or standard error is displayed. Specifies the complete path for the file to be copied to or from the target. Multiple files can be specified. When used - with the -R flag, only a single directory can be specified. - When used with the -P flag, only a single file can be specified. + with the \ **-R**\ flag, only a single directory can be specified. + When used with the \ **-P**\ flag, only a single file can be specified. \ *targetpath*\ - If one source_file file, then it specifies the file to copy the source_file - file to on the target. If multiple source_file files, it specifies - the directory to copy the source_file files to on the target. - If the -P flag is specified, the target_path is the local host location + If one source file, then it specifies the file to copy the source + file to on the target. If multiple source files, it specifies + the directory to copy the source files to on the target. + If the \ **-P**\ flag is specified, the \ *targetpath*\ is the local host location for the copied files. The remote file directory structure is recreated - under target_path and the remote target name is appended - to the copied source_file name in the target_path directory. - Note: the targetpath directory must exist. + under \ *targetpath*\ and the remote target name is appended + to the copied \ *sourcefile*\ name in the \ *targetpath*\ directory. + Note: the \ *targetpath*\ directory must exist. \ **-B | -**\ **-bypass**\ - Runs in bypass mode, use if the xcatd daemon is hung. + Runs in bypass mode, use if the \ **xcatd**\ daemon is not responding. \ **-f | -**\ **-fanout**\ \ *fanout_value*\ - Specifies a fanout value for the maximum number of concur- - rently executing remote shell processes. Serial execution + Specifies a fanout value for the maximum number of concurrently executing remote shell processes. Serial execution can be specified by indicating a fanout value of \ **1**\ . If \ **-f**\ is not specified, a default fanout value of \ **64**\ is used. -\ **-F | -**\ **-File**\ \ *rsync input file*\ +\ **-F | -**\ **-File**\ \ *synclist input file*\ Specifies the path to the file that will be used to build the \ **rsync**\ command. - The format of the input file is as follows, each line contains: + The format of the input file is described here: - - .. code-block:: perl - - ... -> < path to destination file/directory> - - - or - - - .. code-block:: perl - - -> - - - or - - - .. code-block:: perl - - -> - - - For example: - - - .. code-block:: perl - - /etc/password /etc/hosts -> /etc - - /tmp/file2 -> /tmp/file2 - - /tmp/file2 -> /tmp/ - - /tmp/filex -> /tmp/source/filey - - /etc/* -> /etc/ - - - \ **Running postscripts after files are sync'd to the nodes**\ : - - After you define the files to rsync, you can add an \ **EXECUTE:**\ clause in the synclist file. The \ **EXECUTE:**\ clause will list all the postscripts that you would like to run after the files are sync'd to the node. - The postscript file must be of the form \ **filename.post**\ , where the - is the is the from , reside in the same - directory as \ **filename**\ , and be executable. - If the file \ **filename**\ is rsync'd to the node, then the \ **filename.post**\ - will automatically be run on the node. - If the file \ **filename**\ is not updated on the node, the \ **filename.post**\ will not be run. - - Putting the \ **filename.post**\ in the file list to rsync to the node is required - for hierarchical clusters. It is optional for non-hierarchical clusters. - - Another option is the \ **EXECUTEALWAYS:**\ clause in the synclist file. The \ **EXECUTEALWAYS:**\ will list all the postscripts that you would like to run after the files are sync'd to the nodes. These scripts will run whether or not any files are sync'd to the nodes. The scripts have no special format, but must contain the fully qualified path. - - The scripts must be also added to the file list to rsync to the node for hierarchical clusters. It is optional for non-hierarchical clusters. - - For example, your rsynclist file may look like this: - - - .. code-block:: perl - - /tmp/share/file2 -> /tmp/file2 - /tmp/share/file2.post -> /tmp/file2.post - /tmp/share/file3 -> /tmp/filex - /tmp/share/file3.post -> /tmp/file3.post - /tmp/myscript -> /tmp/myscript - # the below are postscripts - EXECUTE: - /tmp/share/file2.post - /tmp/share/file3.post - EXECUTEALWAYS: - /tmp/myscript - - - If /tmp/file2 and /tmp/file3 update /tmp/file2 and /tmp/filex on the node, then the postscripts /tmp/file2.post and /tmp/file3.post are automatically run on - the node. /tmp/myscript will always be run on the node. - - Another option is the \ **APPEND:**\ clause in the synclist file. The \ **APPEND:**\ clause is used to append the contents of the input file to an existing file on the node. The file to append \ **must**\ already exist on the node and not be part of the synclist that contains the \ **APPEND:**\ clause. - - For example, your rsynclist file may look like this: - - - .. code-block:: perl - - /tmp/share/file2 -> /tmp/file2 - /tmp/share/file2.post -> /tmp/file2.post - /tmp/share/file3 -> /tmp/filex - /tmp/share/file3.post -> /tmp/file3.post - /tmp/myscript -> /tmp/myscript - # the below are postscripts - EXECUTE: - /tmp/share/file2.post - /tmp/share/file3.post - EXECUTEALWAYS: - /tmp/myscript - APPEND: - /etc/myappenddir/appendfile -> /etc/mysetup/setup - /etc/myappenddir/appendfile2 -> /etc/mysetup/setup2 - - - When you use the append script, the file (left) of the arrow is appended to the file right of the arrow. In this example, /etc/myappenddir/appendfile is appended to /etc/mysetup/setup file, which must already exist on the node. The /opt/xcat/share/xcat/scripts/xdcpappend.sh is used to accomplish this. - - Another option is the \ **MERGE:**\ clause in the synclist file. The \ **MERGE:**\ clause is used to append the contents of the input file to /etc/passwd, /etc/group, or /etc/shadow on a Linux node. It is only supported for those files and only on Linux. You must not use both the APPEND and MERGE funcion for these three files. The processing could end up not creating the file you desire. The MERGE function is the preferred method, because APPEND only adds to the file. MERGE will add to the file but also insure there are no duplicate entries. - - For example, your rsynclist file may look like this: - /tmp/share/file2 -> /tmp/file2 - /tmp/share/file2.post -> /tmp/file2.post - /tmp/share/file3 -> /tmp/filex - /tmp/share/file3.post -> /tmp/file3.post - /tmp/myscript -> /tmp/myscript - # the below are postscripts - EXECUTE: - /tmp/share/file2.post - /tmp/share/file3.post - EXECUTEALWAYS: - /tmp/myscript - APPEND: - /custom/mypasswd -> /etc/passwd - /custom/mygroups -> /etc/group - /custom/myshadow -> /etc/shadow - - Note: no order can be assumed by the order that the EXECUTE,EXECUTEALWAYS and APPEND clause fall in the synclist file. - - For more information on syncing files to node, read Sync-ing_Config_Files_to_Nodes - - On Linux rsync always uses ssh remoteshell. On AIX, ssh or rsh is used depending on the site.useSSHonAIX attribute. + On Linux \ **rsync**\ always uses ssh remoteshell. On AIX, \ **ssh**\ or \ **rsh**\ is used depending on the \ **site.useSSHonAIX**\ table attribute. @@ -269,7 +143,7 @@ standard output or standard error is displayed. \ **-i | -**\ **-rootimg**\ \ *install image*\ - Specifies the path to the install image on the local Linux node. + Specifies the path to the install image on the local Linux node. @@ -277,7 +151,7 @@ standard output or standard error is displayed. Specifies options to pass to the remote shell command for node targets. The options must be specified within double - quotation marks ("") to distinguish them from \ **xdsh**\ options. + quotation marks ("") to distinguish them from \ **xdcp**\ options. @@ -291,14 +165,14 @@ standard output or standard error is displayed. \ **-P | -**\ **-pull**\ Pulls (copies) the files from the targets and places them in - the target_path directory on the local host. The target_path + the \ *targetpath*\ directory on the local host. The \ *targetpath*\ must be a directory. Files pulled from remote machines have - ._target appended to the file name to distinguish between - them. When the \ **-P**\ flag is used with the \ **-R**\ flag, ._target is + \ **._target**\ appended to the file name to distinguish between + them. When the \ **-P**\ flag is used with the \ **-R**\ flag, \ **._target**\ is appended to the directory. Only one file per invocation of the - xdcp pull command can be pulled from the specified targets. - Hierarchy is not automatically support yet. You must first pull - the file to the Service Node and then pull the file to the Management + \ **xdcp**\ pull command can be pulled from the specified targets. + In hierarchy, you must first pull + the file to the service node and then pull the file to the management node. @@ -313,10 +187,17 @@ standard output or standard error is displayed. -\ **-r | -**\ **-node-rcp**\ \ *node_remote_copy*\ +\ **-r | -**\ **-node-rcp**\ \ *node remote copy command*\ - Specifies the full path of the remote copy command used - for remote command execution on node targets. + Specifies the full path of the remote copy command used for syncing files to node targets, such as \ **/usr/bin/rsync**\ or \ **/usr/bin/scp**\ . If not specified, \ **rsync**\ will be used by default. + + Note: The synclist processing for \ **-r /usr/bin/scp**\ has some differences with \ **-r /usr/bin/rsync**\ : + + 1) the \ **EXECUTE**\ clause in synclist file is not supported with \ **-r /usr/bin/scp**\ flag + + 2) if the destination directory specified in synclist file is an existing file on target node, \ **xdcp -r /usr/bin/scp**\ will fail with "scp: : Not a directory" + + 3) if the destination file specified in synclist file is an existing directory on target node, \ **xdcp -r /usr/bin/scp**\ will fail with "scp: : Is a directory" @@ -325,8 +206,7 @@ standard output or standard error is displayed. Recursively copies files from a local directory to the remote targets, or when specified with the \ **-P**\ flag, recursively pulls (copies) files from a remote directory to the local host. A - single source directory can be specified using the source_file - parameter. + single source directory can be specified using the \ *sourcefile*\ parameter. @@ -334,8 +214,8 @@ standard output or standard error is displayed. Will only sync the files listed in the synclist (\ **-F**\ ), to the service nodes for the input compute node list. The files will be placed in the - directory defined by the site.SNsyncfiledir attribute, or the default - /var/xcat/syncfiles directory. + directory defined by the \ **site.SNsyncfiledir**\ table attribute, or the default + \ **/var/xcat/syncfiles**\ directory. @@ -447,9 +327,8 @@ standard output or standard error is displayed. \ **DSH_TIMEOUT**\ - Specifies the time, in seconds, to wait for output from - each remote target. This variable is overridden by the \ **-t**\ - flag. + Specifies the time, in seconds, to wait for output from + each remote target. This variable is overridden by the \ **-t**\ flag. @@ -463,13 +342,12 @@ Exit values for each remote copy command execution are displayed in messages from the xdcp command, if the remote copy command exit value is non-zero. A non-zero return code from a remote copy command indicates that an error was encountered during the remote copy. If a remote copy -command encounters an error, execution of the remote copy on that tar- -get is bypassed. +command encounters an error, execution of the remote copy on that target is bypassed. -The xdcp command exit code is 0, if the xdcp command executed without +The \ **xdcp**\ command exit code is 0, if the \ **xdcp**\ command executed without errors and all remote copy commands finished with exit codes of 0. If -internal xdcp errors occur or the remote copy commands do not complete -successfully, the xdcp command exit value is greater than 0. +internal \ **xdcp**\ errors occur or the remote copy commands do not complete +successfully, the \ **xdcp**\ command exit value is greater than 0. **************** @@ -530,7 +408,7 @@ host as /var/log._target, enter: -3. To copy /localnode/smallfile and /tmp/bigfile to /tmp on node1 +3. To copy /localnode/smallfile and /tmp/bigfile to B/tmp on node1 using rsync and input -t flag to rsync, enter: @@ -587,15 +465,23 @@ from the local host to node1 in the cluster, enter: 8. To rsync the /etc/hosts file to your compute nodes: - Create a rsync file /tmp/myrsync, with this line: + First create a syncfile /tmp/myrsync, with this line: + + + .. code-block:: perl + + /etc/hosts -> /etc/hosts - /etc/hosts -> /etc/hosts or - /etc/hosts -> /etc/ (last / is required) - Run: + .. code-block:: perl + + /etc/hosts -> /etc/ (last / is required) + + + Then run: .. code-block:: perl @@ -607,11 +493,15 @@ from the local host to node1 in the cluster, enter: 9. To rsync all the files in /home/mikev to the compute nodes: - Create a rsync file /tmp/myrsync, with this line: + First create a rsync file /tmp/myrsync, with this line: - /home/mikev/\* -> /home/mikev/ (last / is required) - Run: + .. code-block:: perl + + /home/mikev/* -> /home/mikev/ (last / is required) + + + Then run: .. code-block:: perl @@ -621,18 +511,25 @@ from the local host to node1 in the cluster, enter: -10. To rsync to the compute nodes, using service nodes, the command will first -rsync the files to the /var/xcat/syncfiles directory on the service nodes and then rsync the files from that directory to the compute nodes. The /var/xcat/syncfiles default directory on the service nodes, can be changed by putting a directory value in the site table SNsyncfiledir attribute. +10. To rsync to the compute nodes, using service nodes: - Create a rsync file /tmp/myrsync, with this line: + First create a rsync file /tmp/myrsync, with this line: + + + .. code-block:: perl + + /etc/hosts /etc/passwd -> /etc - /etc/hosts /etc/passwd -> /etc or - /etc/hosts /etc/passwd -> /etc/ - Run: + .. code-block:: perl + + /etc/hosts /etc/passwd -> /etc/ + + + Then run: .. code-block:: perl @@ -640,18 +537,20 @@ rsync the files to the /var/xcat/syncfiles directory on the service nodes and t xdcp compute -F /tmp/myrsync - to update the Compute Nodes - 11. To rsync to the service nodes in preparation for rsyncing the compute nodes during an install from the service node. - Create a rsync file /tmp/myrsync, with this line: + First create a rsync file /tmp/myrsync, with this line: - /etc/hosts /etc/passwd -> /etc - Run: + .. code-block:: perl + + /etc/hosts /etc/passwd -> /etc + + + Then run: .. code-block:: perl @@ -659,19 +558,21 @@ during an install from the service node. xdcp compute -s -F /tmp/myrsync - to sync the service node for compute - 12. To rsync the /etc/file1 and file2 to your compute nodes and rename to filex and filey: - Create a rsync file /tmp/myrsync, with these line: + First create a rsync file /tmp/myrsync, with these line: - /etc/file1 -> /etc/filex - /etc/file2 -> /etc/filey + .. code-block:: perl - Run: + /etc/file1 -> /etc/filex + + /etc/file2 -> /etc/filey + + + Then run: .. code-block:: perl @@ -685,11 +586,15 @@ during an install from the service node. 13. To rsync files in the Linux image at /install/netboot/fedora9/x86_64/compute/rootimg on the MN: - Create a rsync file /tmp/myrsync, with this line: + First create a rsync file /tmp/myrsync, with this line: - /etc/hosts /etc/passwd -> /etc - Run: + .. code-block:: perl + + /etc/hosts /etc/passwd -> /etc + + + Then run: .. code-block:: perl diff --git a/docs/source/guides/admin-guides/references/man5/site.5.rst b/docs/source/guides/admin-guides/references/man5/site.5.rst index d58a76b2c..2855062a2 100644 --- a/docs/source/guides/admin-guides/references/man5/site.5.rst +++ b/docs/source/guides/admin-guides/references/man5/site.5.rst @@ -135,6 +135,11 @@ site Attributes: service nodes will ignore this value and always be configured to forward to the management node. + dnsforwardmode: (first or only or no). This is to set forward value in named.conf options section. + "first": causes DNS requests to be forwarded before an attempt is made to resolve them via the root name servers. + "only": all requests are forwarded and none sent to the root name servers. + "no": no request will be forwarded. This is the default value if not specified. + emptyzonesenable: (yes or no). This is to set empty-zones-enable value in named.conf options section. master: The hostname of the xCAT management node, as known by the nodes. @@ -269,7 +274,7 @@ site Attributes: genpasswords: Automatically generate random passwords for BMCs when configuring them. - installdir: The local directory name used to hold the node deployment packages. + installdir: The local directory name used to hold the node deployment packages(obsoleted). installloc: The location from which the service nodes should mount the deployment packages in the format hostname:/path. If hostname is @@ -401,7 +406,7 @@ site Attributes: dbtracelevel: The trace level for the database access log. To activate this setting, please. restart xcatd or send HUP signal to the 'xcatd: DB Access' process, Like: . - ps -ef | grep 'xcatd: DB Access' | grep -v grep | awk '{print $2}' | xargs kill -HUP + pkill -f -HUP 'xcatd: DB Access' Currrent support values: 0: disable the trace log for db 1: trace the calls of database subroutines @@ -460,7 +465,11 @@ site Attributes: xcatlport: The port used by xcatd command log writer process to collect command output. - xcatsslversion: The ssl version by xcatd. Default is TLSv1. + xcatsslversion: The SSL_version option xcatd used and passed to + IO::Socket::SSL->start_SSL(). By default, this value is + set to empty. In this case, xcatd will use + 'SSLv23:!SSLv2:!SSLv3:!TLSv1' internally. + For more detail, see https://metacpan.org/pod/IO::Socket::SSL xcatsslciphers: The ssl cipher by xcatd. Default is 3DES. diff --git a/docs/source/guides/get-started/index.rst b/docs/source/guides/get-started/index.rst new file mode 100644 index 000000000..d3d48abd8 --- /dev/null +++ b/docs/source/guides/get-started/index.rst @@ -0,0 +1,9 @@ +Get Started +=========== + + +.. toctree:: + :maxdepth: 1 + + quick_start.rst + workflow_guide.rst diff --git a/docs/source/guides/get-started/quick_start.rst b/docs/source/guides/get-started/quick_start.rst new file mode 100644 index 000000000..d8b2b06da --- /dev/null +++ b/docs/source/guides/get-started/quick_start.rst @@ -0,0 +1,140 @@ +Quick Start Guide +================= +xCAT can be a comprehensive system to manage infrastructure elements in Data Center, bare-metal servers, switches, PDUs, and Operation System distributions. This quick start guide will instruct you to set up a xCAT system and manage an IPMI managed bare metal server with Red Hat-based distribution in 15 minutes. + +The steps below will be focused on RHEL7, however they should work for other distribution, such as CentOS, SLES, etc, details :doc:`Operating System & Hardware Support Matrix <../../overview/support_matrix>` + +Prerequisites +------------- +Assume there are two servers named ``xcatmn.mydomain.com`` and ``cn1.mydomain.com``. + + #. They are in the same subnet ``192.168.0.0``. + #. ``cn1.mydomain.com`` has BMC which ``xcatmn.mydomain.com`` can access it. + #. ``xcatmn.mydomain.com`` has Red Hat OS installed, and uses IP ``192.168.0.2``. + #. ``xcatmn.mydomain.com`` has access to internet. + #. ``cn1.mydomain.com`` BMC IP address is ``10.4.40.254``. + #. Prepare a full DVD for OS provision, and not a ``Live CD`` ISO, for this example, will use ``RHEL-7.6-20181010.0-Server-x86_64-dvd1.iso`` ISO, you can download it from Red Hat website. + +All the following steps should be executed in ``xcatmn.mydomain.com``. + +Prepare the Management Node ``xcatmn.mydomain.com`` +``````````````````````````````````````````````````` + +#. Disable SELinux: :: + + echo 0 > /selinux/enforce + sed -i 's/^SELINUX=.*$/SELINUX=disabled/' /etc/selinux/config + +#. Set the hostname of ``xcatmn.mydomain.com``: :: + + hostname xcatmn.mydomain.com + +#. Set the IP to STATIC in the ``/etc/sysconfig/network-scripts/ifcfg-`` file + +#. Update your ``/etc/resolv.conf`` with DNS settings and make sure that the node could visit ``github`` and ``xcat`` official website. + +#. Configure any domain search strings and nameservers to the ``/etc/resolv.conf`` file + +#. Add ``xcatmn`` into ``/etc/hosts``: :: + + 192.168.0.2 xcatmn xcatmn.mydomain.com + +#. Install xCAT: :: + + wget https://raw.githubusercontent.com/xcat2/xcat-core/master/xCAT-server/share/xcat/tools/go-xcat -O - >/tmp/go-xcat + chmod +x /tmp/go-xcat + go-xcat --yes install + source /etc/profile.d/xcat.sh + +#. Configure the system password for the root user on the compute nodes: :: + + chtab key=system passwd.username=root passwd.password=abc123 + +Stage 1 Add your first node and control it with out-of-band BMC interface +------------------------------------------------------------------------- + +#. Define compute node ``cn1``: :: + + mkdef -t node cn1 --template x86_64-template ip=192.168.0.3 mac=42:3d:0a:05:27:0c bmc=10.4.40.254 bmcusername=USERID bmcpassword=PASSW0RD + +#. Configure DNS: :: + + makehosts cn1 + makedns -n + +#. Check ``cn1`` Hardware Control: + +``cn1`` power management: :: + + rpower cn1 on + rpower cn1 state + cn1: on + +``cn1`` firmware information: :: + + rinv cn1 firm + cn1: UEFI Version: 1.31 (TDE134EUS 2013/08/27) + cn1: Backup UEFI Version: 1.00 (TDE112DUS ) + cn1: Backup IMM Version: 1.25 (1AOO26K 2012/02/23) + cn1: BMC Firmware: 3.10 (1AOO48H 2013/08/22 18:49:44) + +Stage 2 Provision a node and manage it with parallel shell +---------------------------------------------------------- + +#. In order to PXE boot, you need a DHCP server to hand out addresses and direct the booting system to the TFTP server where it can download the network boot files. Configure DHCP: :: + + makedhcp -n + +#. Copy all contents of Distribution ISO into ``/install`` directory, create OS repository and osimage for OS provision: :: + + copycds RHEL-7.6-20181010.0-Server-x86_64-dvd1.iso + + After ``copycds``, the corresponding basic osimage will be generated automatically. And then you can list the new osimage name here. You can refer document to customize the package list or postscript for target compute nodes, but here just use the default one: :: + + lsdef -t osimage + +#. Use ``xcatprobe`` to precheck xCAT management node ready for OS provision: :: + + xcatprobe xcatmn + [mn]: Checking all xCAT daemons are running... [ OK ] + [mn]: Checking xcatd can receive command request... [ OK ] + [mn]: Checking 'site' table is configured... [ OK ] + [mn]: Checking provision network is configured... [ OK ] + [mn]: Checking 'passwd' table is configured... [ OK ] + [mn]: Checking important directories(installdir,tftpdir) are configured... [ OK ] + [mn]: Checking SELinux is disabled... [ OK ] + [mn]: Checking HTTP service is configured... [ OK ] + [mn]: Checking TFTP service is configured... [ OK ] + [mn]: Checking DNS service is configured... [ OK ] + [mn]: Checking DHCP service is configured... [ OK ] + ... ... + [mn]: Checking dhcpd.leases file is less than 100M... [ OK ] + =================================== SUMMARY ==================================== + [MN]: Checking on MN... [ OK ] + +#. Start the Diskful OS Deployment: :: + + rinstall cn1 osimage=rhels7.6-x86_64-install-compute + +#. Monitor Installation Process: :: + + makegocons cn1 + rcons cn1 + + **Note**: The keystroke ``ctrl+e c .`` will disconnect you from the console. + + After 5-10 min verify provision status is ``booted``: :: + + lsdef cn1 -i status + Object name: cn1 + status=booted + + Use ``xdsh`` to check ``cn1`` OS version, OS provision is successful: :: + + xdsh cn1 more /etc/*release + cn1: :::::::::::::: + cn1: /etc/os-release + cn1: :::::::::::::: + cn1: NAME="Red Hat Enterprise Linux Server" + cn1: VERSION="7.6 (Maipo)" + ... ... diff --git a/docs/source/overview/quick_start.rst b/docs/source/guides/get-started/workflow_guide.rst similarity index 98% rename from docs/source/overview/quick_start.rst rename to docs/source/guides/get-started/workflow_guide.rst index d26fc33b8..49bedef5b 100644 --- a/docs/source/overview/quick_start.rst +++ b/docs/source/guides/get-started/workflow_guide.rst @@ -1,5 +1,5 @@ -Quick Start Guide -================= +Workflow Guide +============== If xCAT looks suitable for your requirement, following steps are recommended procedure to set up an xCAT cluster. diff --git a/docs/source/index.rst b/docs/source/index.rst index 048b7095d..247f43b94 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -30,6 +30,7 @@ Table of Contents overview/index.rst guides/install-guides/index.rst + guides/get-started/index.rst guides/admin-guides/index.rst advanced/index.rst QA/index.rst diff --git a/docs/source/overview/index.rst b/docs/source/overview/index.rst index 652aa8117..91c9a4d43 100644 --- a/docs/source/overview/index.rst +++ b/docs/source/overview/index.rst @@ -10,5 +10,4 @@ xCAT enables you to easily manage large number of servers for any type of techni features.rst support_matrix.rst architecture.rst - quick_start.rst xcat2_release.rst diff --git a/docs/source/overview/xcat2_release.rst b/docs/source/overview/xcat2_release.rst index 969d36b70..158eda50c 100644 --- a/docs/source/overview/xcat2_release.rst +++ b/docs/source/overview/xcat2_release.rst @@ -14,6 +14,12 @@ xCAT 2.14.x |xCAT |New OS |New |New Feature | |Version | |Hardware | | +=================================+===============+=============+==================================+ +|| xCAT 2.14.6 2019/03/29 | | | | +|| | | | | +| `2.14.6 Release Notes `_ | | | | ++---------------------------------+---------------+-------------+----------------------------------+ || xCAT 2.14.5 2018/12/07 |- RHEL7.6 | |- syslog tag refine | || | | | | | `2.14.5 Release Notes {error}->[0] = "No hosts in node list 1"; + $rsp->{error}->[0] = "DCP: No hosts in node list 1"; xCAT::MsgUtils->message("E", $rsp, $::CALLBACK, 1); return ++$result; } @@ -368,7 +368,7 @@ sub execute_dsh if (!scalar(%resolved_targets)) { my $rsp = {}; - $rsp->{error}->[0] = " No hosts in node list 2"; + $rsp->{error}->[0] = " DSH: No hosts in node list 2"; xCAT::MsgUtils->message("E", $rsp, $::CALLBACK, 1); return ++$result; } @@ -5936,6 +5936,11 @@ sub run_rsync_postscripts # return from rsync is tmp/file1 not /tmp/file1 substr($tmppostfile, 0, 1) = ""; + # now remove .post from the postscript file for the compare + # with the returned file name + my($tp,$post) = split(/\.post/,$tmppostfile); + $tmppostfile = $tp; + foreach my $line (@rsync_output) { my ($hostname, $ps) = split(/: /, $line); chomp $ps; @@ -5948,7 +5953,10 @@ sub run_rsync_postscripts } next; } - if ($tmppostfile eq $ps) { + + #the $postsfile .post will be run if: + # the is updated, or + if ($ps eq $tmppostfile ) { # build xdsh queue # build host and all scripts to execute @@ -6300,6 +6308,7 @@ sub run_always_rsync_postscripts my @hosts = @$hostnames; my @newoutput = (); my $dshparms; + foreach my $postsfile (@::alwayspostscripts) { my $tmppostfile = $postsfile; @@ -6310,28 +6319,34 @@ sub run_always_rsync_postscripts } foreach my $host (@hosts) { - # build xdsh queue # build host and all scripts to execute # EXECUTEALWAYS will only execute the syncfile in the syncfile list foreach my $key (keys %{$$options{'destDir_srcFile'}{$host}}) { - foreach my $key1 (keys %{ $$options{'destDir_srcFile'}{$host}{$key} }) { - my $index = 0; - while (my $src_file = $$options{'destDir_srcFile'}{$host}{$key}{$key1}->[$index]) { - if ($src_file eq $tmppostfile) { - push(@{ $dshparms->{'postscripts'}{$postsfile} }, $host); - } - $index++; - } - } - } - } - } + foreach my $key1 (keys %{ $$options{'destDir_srcFile'}{$host}->{$key} }) { + my $index = 0; + my $key1_ref = $$options{'destDir_srcFile'}{$host}->{$key}->{$key1}; + if (ref $key1_ref eq 'ARRAY') { #stored as ARRAY for same_dest_name + while (my $src_file =$key1_ref->[$index] ) { + if ($src_file eq $tmppostfile) { + push(@{ $dshparms->{'postscripts'}{$postsfile} }, $host); + } + $index++; + } + } else { #stroed as hash table for diff_dest_name + foreach my $src_file (keys %{$key1_ref}) { + if ($src_file eq $tmppostfile) { + push(@{ $dshparms->{'postscripts'}{$postsfile} }, $host); + } + } + } #end else + } #end foreach key1 + } #end foreach key + } #end foreach host + } #end foreach postsfile # now if we have postscripts to run, run xdsh my $out; - - foreach my $ps (keys %{ $$dshparms{'postscripts'} }) { my @nodes; diff --git a/perl-xCAT/xCAT/Schema.pm b/perl-xCAT/xCAT/Schema.pm index c2fc4ae60..c456a533f 100755 --- a/perl-xCAT/xCAT/Schema.pm +++ b/perl-xCAT/xCAT/Schema.pm @@ -1059,6 +1059,10 @@ passed as argument rather than by table value', " requests it does not know to these servers. Note that the DNS servers on the\n" . " service nodes will ignore this value and always be configured to forward \n" . " to the management node.\n\n" . +" dnsforwardmode: (first or only or no). This is to set forward value in named.conf options section. \n" . +" \"first\": causes DNS requests to be forwarded before an attempt is made to resolve them via the root name servers. \n" . +" \"only\": all requests are forwarded and none sent to the root name servers.\n". +" \"no\": no request will be forwarded. This is the default value if not specified. \n\n" . " emptyzonesenable: (yes or no). This is to set empty-zones-enable value in named.conf options section. \n\n" . " master: The hostname of the xCAT management node, as known by the nodes.\n\n" . " nameservers: A comma delimited list of DNS servers that each node in the cluster should\n" . @@ -1159,7 +1163,7 @@ passed as argument rather than by table value', " prefix (e.g. 00:11:aa)\n\n" . " genpasswords: Automatically generate random passwords for BMCs when configuring\n" . " them.\n\n" . -" installdir: The local directory name used to hold the node deployment packages.\n\n" . +" installdir: The local directory name used to hold the node deployment packages(obsoleted).\n\n" . " installloc: The location from which the service nodes should mount the \n" . " deployment packages in the format hostname:/path. If hostname is\n" . " omitted, it defaults to the management node. The path must\n" . @@ -1262,7 +1266,7 @@ passed as argument rather than by table value', " delimiter, to specify delimiter for those columns as format of 'column:delimiter'.\n\n" . " dbtracelevel: The trace level for the database access log. To activate this setting, please. \n". " restart xcatd or send HUP signal to the 'xcatd: DB Access' process, Like: .\n". -" ps -ef | grep 'xcatd: DB Access' | grep -v grep | awk '{print \$2}' | xargs kill -HUP \n". +" pkill -f -HUP 'xcatd: DB Access' \n". " Currrent support values: \n" . " 0: disable the trace log for db \n" . " 1: trace the calls of database subroutines \n" . @@ -1310,7 +1314,10 @@ passed as argument rather than by table value', " xcatdport: The port used by the xcatd daemon for client/server communication.\n\n" . " xcatiport: The port used by xcatd to receive install status updates from nodes.\n\n" . " xcatlport: The port used by xcatd command log writer process to collect command output.\n\n" . -" xcatsslversion: The ssl version by xcatd. Default is TLSv1.\n\n" . +" xcatsslversion: This is the SSL_version option xcatd used and passed to \n" . +" IO::Socket::SSL->start_SSL(). By default, this value is set to empty.\n" . +" In this case, xcatd will use SSLv23:!SSLv2:!SSLv3:!TLSv1 internally.\n" . +" For more detail, see https://metacpan.org/pod/IO::Socket::SSL\n\n" . " xcatsslciphers: The ssl cipher by xcatd. Default is 3DES.\n\n", value => 'The value of the attribute specified in the "key" column.', comments => 'Any user-written notes.', diff --git a/perl-xCAT/xCAT/Usage.pm b/perl-xCAT/xCAT/Usage.pm index 1ded2c975..d40c13600 100755 --- a/perl-xCAT/xCAT/Usage.pm +++ b/perl-xCAT/xCAT/Usage.pm @@ -422,7 +422,7 @@ my %usage = ( "OpenPOWER OpenBMC specific: rflash {[-c|--check] | [-l|--list]} rflash {[-c|--check] | [-a|--activate] | [-u|--upload]} - rflash [-d] [--no-host-reboot] + rflash [-d] rflash {[-a|--activate] | [--delete]}", "mkhwconn" => "Usage: diff --git a/perl-xCAT/xCAT/Utils.pm b/perl-xCAT/xCAT/Utils.pm index 8f9ad89a7..c3f72767e 100644 --- a/perl-xCAT/xCAT/Utils.pm +++ b/perl-xCAT/xCAT/Utils.pm @@ -608,7 +608,7 @@ sub get_conserver_version # output format: # conserver: conserver.com version 8.2.1 # conserver: default access type `r' - my @out = xCAT::Utils->runcmd("$cmd", 0); + my @out = xCAT::Utils->runcmd("$cmd", -1); if ($::RUNCMD_RC != 0 || @out < 1) { return undef; } diff --git a/perl-xCAT/xCAT/data/discinfo.pm b/perl-xCAT/xCAT/data/discinfo.pm index e4e132777..c3432566a 100755 --- a/perl-xCAT/xCAT/data/discinfo.pm +++ b/perl-xCAT/xCAT/data/discinfo.pm @@ -96,8 +96,6 @@ our %distnames = ( "1446216863.790260" => "rhels7.2", #x86_64 "1446216863.764721" => "rhels7.2", #ppc64 "1446216863.771788" => "rhels7.2", #ppc64le - "1527763142.409770" => "rhels8.0", #ppc64le - "1537463022.540933" => "rhels8.0", #ppc64le "1285193176.593806" => "rhelhpc6", #x86_64 "1305067719.718814" => "rhelhpc6.1", #x86_64 diff --git a/xCAT-client/pods/man1/bmcdiscover.1.pod b/xCAT-client/pods/man1/bmcdiscover.1.pod index 00d6d8170..41bc9be1b 100644 --- a/xCAT-client/pods/man1/bmcdiscover.1.pod +++ b/xCAT-client/pods/man1/bmcdiscover.1.pod @@ -27,11 +27,11 @@ Note: The scan method currently support is B. =item B<--range> -Specify one or more IP ranges acceptable to nmap. IP range can be hostnames, IP addresses, networks, etc. A single IP address (10.1.2.3), several IPs with commas (10.1.2.3,10.1.2.10), Ip range with "-" (10.1.2.0-100) or an IP range (10.1.2.0/24) can be specified. If the range is very large, the B command may take a long time to return. +Specify one or more IP ranges acceptable to B. IP range can be hostnames, IP addresses, networks, etc. A single IP address (10.1.2.3), several IPs with commas (10.1.2.3,10.1.2.10), Ip range with "-" (10.1.2.0-100) or an IP range (10.1.2.0/24) can be specified. If the range is very large, the B command may take a long time to return. =item B<--sn> -Specify one or more service nodes on which bmcdiscover will run. In hierarchical cluster, the MN may not be able to access the BMC of CN directly, but SN can. With this option, bmcdiscover will be dispatched to the specified SNs. Then, the nodename of the service node that 'bmcdiscover' is running on will be set to the 'servicenode' attribute of the discovered BMC node. +Specify one or more service nodes on which bmcdiscover will run. In hierarchical cluster, the MN may not be able to access the BMC of CN directly, but SN can. With this option, B will be dispatched to the specified SNs. Then, the nodename of the service node that B is running on will be set to the 'servicenode' attribute of the discovered BMC node. =item B<-s> @@ -101,7 +101,7 @@ Output is similar to: servicenode=sn01 conserver=sn01 -4. Discover the BMCs and write the discovered-node definitions into the xCAT database and write out the stanza foramt to the console: +4. Discover the BMCs and write the discovered node definitions into the xCAT database and write out the stanza format to the console: bmcdiscover -s nmap --range "10.4.22-23.100-254" -w -z diff --git a/xCAT-client/pods/man1/lsdef.1.pod b/xCAT-client/pods/man1/lsdef.1.pod index ac677d0f1..a1bf4e764 100644 --- a/xCAT-client/pods/man1/lsdef.1.pod +++ b/xCAT-client/pods/man1/lsdef.1.pod @@ -6,13 +6,13 @@ B - Use this command to list xCAT data object definitions. B [B<-h>|B<--help>] [B<-t> I] [B<-i> I] -B [B<-V>|B<--verbose>] [B<-l>|B<--long>] [B<-s>|B<--short>] [B<-a>|B<--all>] [B<-S>] -[B<-t> I] [B<-o> I] [B<-z>|B<--stanza>] [B<-i> I] +B [B<-V>|B<--verbose>] [B<-a>|B<--all>] [B<-S>] +[B<-t> I] [B<-o> I] [B<-z>|B<--stanza>] [B<-i> I | [B<-l>|B<--long>] | [B<-s>|B<--short>]] [B<-c>|B<--compress>] [B<--osimage>] [B<--nics>] [[B<-w> I==I] [B<-w> I=~I] ...] [I] -B [B<-l>|B<--long>] [B<-a>|B<--all>] [B<-t> I] [B<-z>|B<--stanza>] -[B<-i> I] [B<--template> [I]] +B [B<-a>|B<--all>] [B<-t> I] [B<-z>|B<--stanza>] +[B<-i> I | [B<-l>|B<--long>] | [B<-s>|B<--short>]] [B<--template> [I]] =head1 DESCRIPTION @@ -28,13 +28,13 @@ in the xCAT database and xCAT object definition templates shipped in xCAT. Display all definitions. For performance consideration, the auditlog and eventlog objects will not be listed. -To list auditlog or eventlog objects, use lsdef -t auditlog or lsdef -t eventlog instead. +To list auditlog or eventlog objects, use B or B instead. =item B<-c|--compress> Display information in compressed mode, each output line has format ": ". -The output can be passed to command xcoll or xdshbak for formatted output. -The -c flag must be used with -i flag. +The output can be passed to command B or B for formatted output. +The B<-c> flag must be used with B<-i> flag. =item B<-h|--help> @@ -87,9 +87,10 @@ Verbose mode. =item B<-w> I B<-w> I ... -Use one or multiple -w flags to specify the selection string that can be used to select objects. The operators ==, !=, =~ and !~ are available. Use the help option to get a list of valid attributes for each object type. +Use one or multiple B<-w> flags to specify the selection string that can be used to select objects. The operators ==, !=, =~ and !~ are available. Use the help option to get a list of valid attributes for each object type. Operator descriptions: + == Select nodes where the attribute value is exactly this value. != Select nodes where the attribute value is not this specific value. =~ Select nodes where the attribute value matches this regular expression. @@ -99,7 +100,7 @@ Note: if the "val" fields includes spaces or any other characters that will be p =item B<-z|--stanza> -Display output in stanza format. See the xcatstanzafile man page for details on using xCAT stanza files. +Display output in stanza format. See the "xcatstanzafile" man page for details on using xCAT stanza files. And default is to list complete object definition, use B<-i> to specify the attribute scope. =back @@ -126,8 +127,6 @@ when defining an xCAT node. To get a list of all the objects that have been defined. - lsdef - OR lsdef -a =item 3. @@ -211,7 +210,7 @@ The hidden nodes are FSP/BPAs. =item 15. -To list the nodes status and use xcoll to format the output. +To list the nodes status and use B to format the output. lsdef -t node -i status -c | xcoll diff --git a/xCAT-client/pods/man1/rflash.1.pod b/xCAT-client/pods/man1/rflash.1.pod index 744f9bf20..3682c8408 100644 --- a/xCAT-client/pods/man1/rflash.1.pod +++ b/xCAT-client/pods/man1/rflash.1.pod @@ -34,7 +34,7 @@ B I {[B<-c>|B<--check>] | [B<-l>|B<--list>]} B I I {[B<-c>|B<--check>] | [B<-a>|B<--activate>] | [B<-u>|B<--upload>]} -B I I [B<-d>] [B<--no-host-reboot>] +B I I [B<-d>] B I I {[B<-a>|B<--activate>] | [B<--delete>]} @@ -125,8 +125,6 @@ B<-d>: This option steamlines the update, activate, reboot BMC and reboot HOST procedure. It expects a directory containing both BMC and Host .tar files. When BMC and Host tar files are provided, the command will upload and activate firmware. After BMC becomes activate, it will reboot BMC. If BMC state is Ready, the command will reboot the HOST. If BMC state is NotReady, the command will exit. -B When using B<--no-host-reboot>, it will not reboot the host after BMC is reboot. - B<--delete>: This delete option will delete update image from BMC. It expects an ID as the input. diff --git a/xCAT-client/pods/man1/updatenode.1.pod b/xCAT-client/pods/man1/updatenode.1.pod index dbfd3cb24..a35d07080 100644 --- a/xCAT-client/pods/man1/updatenode.1.pod +++ b/xCAT-client/pods/man1/updatenode.1.pod @@ -4,7 +4,7 @@ B - Update nodes in an xCAT cluster environment. =head1 SYNOPSIS -B I [B<-V>|B<--verbose>] [B<-F>|B<--sync>] [B<-f>|B<--snsync>] [B<-r>|B<--node-rcp> [I]] [B<-S>|B<--sw>] [B<-l> I] [B<-P>|B<--scripts> [I]] [B<-s>|B<--sn>] [B<-A>|B<--updateallsw>] [B<-c>|B<--cmdlineonly>] [B<-d> I] [B<--fanout>=I] [B<-t> I} [I [I]] [B<-n>|B<--noverify>] +B I [B<-V>|B<--verbose>] [B<-F>|B<--sync>] [B<-f>|B<--snsync>] [B<-r>|B<--node-rcp> [I]] [B<-S>|B<--sw>] [B<-l> I] [B<-P>|B<--scripts> [I]] [B<-s>|B<--sn>] [B<-A>|B<--updateallsw>] [B<-c>|B<--cmdlineonly>] [B<-d> I] [B<--fanout>=I] [B<-t> I} [I [I]] [B<-n>|B<--noverify>] B B [B<-k>|B<--security>] [B<-t> I] @@ -18,7 +18,7 @@ B [B<-h>|B<--help>] [B<-v>|B<--version>] =head1 DESCRIPTION -The updatenode command is run on the xCAT management node and can be used +The B command is run on the xCAT management node and can be used to perform the following node updates: =over 3 @@ -38,10 +38,10 @@ Update the ca and credentials for the service nodes. =back -The default behavior when no options are input to updatenode will be to run +The default behavior when no options are input to B will be to run the following options B<-S>, B<-P> and B<-F> options in this order. -If you wish to limit updatenode to specific -actions you can use combinations of the B<-S>, B<-P>, and B<-F> flags. +If you wish to limit B to specific +actions you can use combination of the B<-S>, B<-P>, and B<-F> flags. For example, If you just want to synchronize configuration file you could specify the B<-F> flag. If you want to synchronize files and update @@ -55,7 +55,7 @@ The flag B<-f> (B<--snsync>) can NOT be used together with B<-S>, B<-P>, and B<- Note: In a large cluster environment the updating of nodes in an ad hoc manner can quickly get out of hand, leaving the system administrator with -a very confusing environment to deal with. The updatenode command is +a very confusing environment to deal with. The B command is designed to encourage users to handle cluster updates in a manner that is recorded and easily repeatable. @@ -72,14 +72,14 @@ Create a synclist file. Indicate the location of the synclist file. =item * -Run the updatenode command to update the nodes. +Run the B command to update the nodes. =back Files may be distributed and synchronized for both diskless and diskful nodes. Syncing files to NFS-based statelite nodes is not supported. -More information on using the synchronization file function is in the following doc: Using_Updatenode. +More information on using the synchronization file function is in the following document: =head3 Create the synclist file @@ -88,9 +88,7 @@ where the files should be synced to. In the synclist file, each line is an entry which describes the location of the source files and the destination location for the files on the target node. -For more information on creating your synclist files and where to put them, read: - -Sync-ing_Config_Files_to_Nodes +For more information on creating your synclist files and where to put them, read here: =head3 Run updatenode to synchronize the files @@ -289,12 +287,12 @@ Used to specify a source directory other than the standard lpp_source directory =item B<-F|--sync> Specifies that file synchronization should be -performed on the nodes. rsync/scp and ssh must +performed on the nodes. B and B must be installed and configured on the nodes. The function is not supported for NFS-based statelite installations. For NFS-based statelite installations to sync files, you should use the read-only option for files/directories listed in -litefile table with source location specified in the litetree table. +B table with source location specified in the B table. =item B<-f|--snsync> @@ -302,32 +300,32 @@ litefile table with source location specified in the litetree table. Specifies that file synchronization should be performed to the service nodes that service the nodes in the noderange. This updates the service -nodes with the data to sync to the nodes. rsync/scp and ssh must +nodes with the data to sync to the nodes. B and B must be installed and configured on the service nodes. For hierarchy, this optionally can be done before syncing the files -to the nodes with the -F flag. If the -f flag is not used, then -the -F flag will sync the servicenodes before the nodes automatically. +to the nodes with the B<-F> flag. If the B<-f> flag is not used, then +the B<-F> flag will sync the service nodes before the nodes automatically. When installing nodes in a hierarchical cluster, this flag should be used to sync the service nodes before the install, since the files will -be sync'd from the service node by the syncfiles postscript during the +be synced from the service node by the B postscript during the install. The function is not supported for NFS-based statelite installations. For statelite installations to sync files, you should use the read-only option for files/directories listed in -litefile table with source location specified in the litetree table. +B table with source location specified in the B table. -=item [B<-r>|B<--node-rcp> [I]] +=item [B<-r>|B<--node-rcp> [I]] -Specifies the full path of the remote copy command used for syncing files to node targets, such as "/usr/bin/rsync" or "/usr/bin/scp". If not specified, rsync will be used by default. +Specifies the full path of the remote copy command used for syncing files to node targets, such as B or B. If not specified, B will be used by default. -Notice: The synclist for "-r /usr/bin/scp" has some differences with "-r /usr/bin/rsync": +Note: The synclist processing for B<-r /usr/bin/scp> has some differences with B<-r /usr/bin/rsync>: -1) the ``EXECUTE`` clause is not supported in "-r /usr/bin/scp" +1) the B clause in synclist file is not supported with B<-r /usr/bin/scp> flag -2) if the destination directory specified in synclist is an existing file on target node, "updatenode -r /usr/bin/scp" will fail with ``scp: : Not a directory`` +2) if the destination directory specified in synclist file is an existing file on target node, B will fail with "scp: : Not a directory" -3) if the destination file specified in synclist is an existing directory on target node, "updatenode -r /usr/bin/scp" will fail with ``scp: : Is a directory`` +3) if the destination file specified in synclist file is an existing directory on target node, B will fail with "scp: : Is a directory" =item B<-g|--genmypost> @@ -359,8 +357,8 @@ See the document Granting_Users_xCAT_privileges for required xcat/sudo setup. =item B<-P|--scripts> Specifies that postscripts and postbootscripts should be run on the nodes. -updatenode -P syncfiles is not supported. The syncfiles postscript can only -be run during install. You should use updatenode -F instead. +File sync with B is not supported. The B postscript can only +be run during install. You should use B instead. =item B<-S|--sw> @@ -417,11 +415,11 @@ To run postscripts,postbootscripts and file synchronization only on the node "cl updatenode clstrn01 -F -P =item 3. -Running updatenode -P with the syncfiles postscript is not supported. You should use updatenode -F instead. +Running B with the B postscript is not supported. You should use B instead. Do not run: - updatenode clstrno1 -P syncfiles + updatenode clstrn01 -P syncfiles Run: diff --git a/xCAT-client/pods/man1/xdcp.1.pod b/xCAT-client/pods/man1/xdcp.1.pod index a4f2fc9db..bd41741bc 100644 --- a/xCAT-client/pods/man1/xdcp.1.pod +++ b/xCAT-client/pods/man1/xdcp.1.pod @@ -1,18 +1,16 @@ =head1 B -B - Concurrently copies files to or from multiple nodes. In addition, provides an option to use rsync to update the files on the nodes, or to an installation image on the local node. +B - Concurrently copies files to or from multiple nodes. In addition, provides an option to use B to update the files on the managed nodes, or to an installation image on the local node. =head1 B -B I [[B<-B> | B<--bypass>] [B<-f> I] [B<-L>] [B<-l> I] [B<-o> I] [B<-p>] [B<-P>] [B<-r> I] [B<-R>] [B<-t> I] [B<-T>] [B<-v>] [B<-q>] [B<-X> I] I +B I [[B<-B> | B<--bypass>] [B<-f> I] [B<-L>] [B<-l> I] [B<-o> I] [B<-p>] [B<-P>] [B<-r> I] [B<-t> I] [B<-T>] [B<-v>] [B<-q>] [B<-X> I] I -B I [B<-F> I] +B I [B<-F> I] [B<-r> I] -B I [B<-s> B<-F> I] - - -B [B<-i> I] [B<-F> I] +B I [B<-s> B<-F> I] [B<-r> I] +B [B<-i> I] [B<-F> I] [B<-r> I] B [B<-h> | B<-V> | B<-q>] @@ -20,34 +18,33 @@ B [B<-h> | B<-V> | B<-q>] =head1 B The B command concurrently copies files to or from remote target -nodes. The command issues a remote copy command for each node or device specified. When files are pulled from a target, they are placed into the target_path with the name of the -remote node or device appended to the copied source_file name. The -/usr/bin/rcp command is the model for syntax and security. -If using hierarchy, then xdcp runs on the service node that is servicing the compute node. The file will first be copied to the path defined in the site table, SNsyncfiledir attribute, or the default path /var/xcat/syncfiles on the service node, if the attribute is not defined. The -P flag will not automatically copy +nodes. The command issues a remote copy command for each node or device specified. When files are pulled from a target, they are placed into the I with the name of the +remote node or device appended to the copied I name. The +B command is the model for syntax and security. +If using hierarchy, then B runs on the service node that is servicing the compute node. The file will first be copied to the path defined in the site table, B attribute, or the default path B on the service node, if the attribute is not defined. The B<-P> flag will not automatically copy the files from the compute node to the Management node, hierarchically. There is a two step process, see B<-P> flag. -If the Management Node is target node, it must be defined in the xCAT database with nodetype=mn. When the B command runs the Management Node as the target, it does not use remote commands but uses the local OS copy (B) command. +If the Management Node is target node, it must be defined in the xCAT database with B. When the B command runs with the Management Node as the target, it does not use remote commands but uses the local OS copy (B) command. B B: -A user_ID can be specified for the remote copy command. Remote user -specification is identical for the B and B commands. See the B -command for more information. +A user_ID can be specified for the remote copy command. Remote user +specification is identical for the B and B commands. +See the B command for more information. B B B: The B command uses a configurable remote copy command to execute remote copies on remote targets. Support is explicitly provided for -Remote Shell rcp command, the OpenSSH scp command and the -/usr/bin/rsync command. +Remote Shell B command, the OpenSSH B command and the +B command. -For node targets, the remote copy command is determined by the follow- -ing order of precedence: +For node targets, the remote copy command is determined by the following order of precedence: 1. The B<-r> flag. -2. The B command. +2. The B command. B B: @@ -60,10 +57,10 @@ appropriate. A timeout value for remote copy command execution can be specified with the B<-t> flag or DSH_TIMEOUT environment variable. If any remote target -does not respond within the timeout value, the xdcp command displays an +does not respond within the timeout value, the B command displays an error message and exits. -The B<-T> flag provides diagnostic trace information for dcp command execution. Default settings and the actual remote copy commands that are executed to the remote targets are displayed. +The B<-T> flag provides diagnostic trace information for B command execution. Default settings and the actual remote copy commands that are executed to the remote targets are displayed. The B command can be executed silently using the B<-Q> flag; no target standard output or standard error is displayed. @@ -76,139 +73,37 @@ standard output or standard error is displayed. Specifies the complete path for the file to be copied to or from the target. Multiple files can be specified. When used -with the -R flag, only a single directory can be specified. -When used with the -P flag, only a single file can be specified. +with the B<-R> flag, only a single directory can be specified. +When used with the B<-P> flag, only a single file can be specified. =item I -If one source_file file, then it specifies the file to copy the source_file -file to on the target. If multiple source_file files, it specifies -the directory to copy the source_file files to on the target. -If the -P flag is specified, the target_path is the local host location +If one source file, then it specifies the file to copy the source +file to on the target. If multiple source files, it specifies +the directory to copy the source files to on the target. +If the B<-P> flag is specified, the I is the local host location for the copied files. The remote file directory structure is recreated -under target_path and the remote target name is appended -to the copied source_file name in the target_path directory. -Note: the targetpath directory must exist. +under I and the remote target name is appended +to the copied I name in the I directory. +Note: the I directory must exist. =item B<-B>|B<--bypass> -Runs in bypass mode, use if the xcatd daemon is hung. +Runs in bypass mode, use if the B daemon is not responding. =item B<-f>|B<--fanout> I -Specifies a fanout value for the maximum number of concur- -rently executing remote shell processes. Serial execution +Specifies a fanout value for the maximum number of concurrently executing remote shell processes. Serial execution can be specified by indicating a fanout value of B<1>. If B<-f> is not specified, a default fanout value of B<64> is used. -=item B<-F>|B<--File> I +=item B<-F>|B<--File> I Specifies the path to the file that will be used to build the B command. -The format of the input file is as follows, each line contains: +The format of the input file is described here: - ... -> < path to destination file/directory> - -or - - -> - -or - - -> - -For example: - - /etc/password /etc/hosts -> /etc - - /tmp/file2 -> /tmp/file2 - - /tmp/file2 -> /tmp/ - - /tmp/filex -> /tmp/source/filey - - /etc/* -> /etc/ - -B: - -After you define the files to rsync, you can add an B clause in the synclist file. The B clause will list all the postscripts that you would like to run after the files are sync'd to the node. -The postscript file must be of the form B, where the -is the is the from , reside in the same -directory as B, and be executable. -If the file B is rsync'd to the node, then the B -will automatically be run on the node. -If the file B is not updated on the node, the B will not be run. - -Putting the B in the file list to rsync to the node is required -for hierarchical clusters. It is optional for non-hierarchical clusters. - -Another option is the B clause in the synclist file. The B will list all the postscripts that you would like to run after the files are sync'd to the nodes. These scripts will run whether or not any files are sync'd to the nodes. The scripts have no special format, but must contain the fully qualified path. - -The scripts must be also added to the file list to rsync to the node for hierarchical clusters. It is optional for non-hierarchical clusters. - -For example, your rsynclist file may look like this: - - /tmp/share/file2 -> /tmp/file2 - /tmp/share/file2.post -> /tmp/file2.post - /tmp/share/file3 -> /tmp/filex - /tmp/share/file3.post -> /tmp/file3.post - /tmp/myscript -> /tmp/myscript - # the below are postscripts - EXECUTE: - /tmp/share/file2.post - /tmp/share/file3.post - EXECUTEALWAYS: - /tmp/myscript - -If /tmp/file2 and /tmp/file3 update /tmp/file2 and /tmp/filex on the node, then the postscripts /tmp/file2.post and /tmp/file3.post are automatically run on -the node. /tmp/myscript will always be run on the node. - - -Another option is the B clause in the synclist file. The B clause is used to append the contents of the input file to an existing file on the node. The file to append B already exist on the node and not be part of the synclist that contains the B clause. - -For example, your rsynclist file may look like this: - - /tmp/share/file2 -> /tmp/file2 - /tmp/share/file2.post -> /tmp/file2.post - /tmp/share/file3 -> /tmp/filex - /tmp/share/file3.post -> /tmp/file3.post - /tmp/myscript -> /tmp/myscript - # the below are postscripts - EXECUTE: - /tmp/share/file2.post - /tmp/share/file3.post - EXECUTEALWAYS: - /tmp/myscript - APPEND: - /etc/myappenddir/appendfile -> /etc/mysetup/setup - /etc/myappenddir/appendfile2 -> /etc/mysetup/setup2 - -When you use the append script, the file (left) of the arrow is appended to the file right of the arrow. In this example, /etc/myappenddir/appendfile is appended to /etc/mysetup/setup file, which must already exist on the node. The /opt/xcat/share/xcat/scripts/xdcpappend.sh is used to accomplish this. - -Another option is the B clause in the synclist file. The B clause is used to append the contents of the input file to /etc/passwd, /etc/group, or /etc/shadow on a Linux node. It is only supported for those files and only on Linux. You must not use both the APPEND and MERGE funcion for these three files. The processing could end up not creating the file you desire. The MERGE function is the preferred method, because APPEND only adds to the file. MERGE will add to the file but also insure there are no duplicate entries. - -For example, your rsynclist file may look like this: - /tmp/share/file2 -> /tmp/file2 - /tmp/share/file2.post -> /tmp/file2.post - /tmp/share/file3 -> /tmp/filex - /tmp/share/file3.post -> /tmp/file3.post - /tmp/myscript -> /tmp/myscript - # the below are postscripts - EXECUTE: - /tmp/share/file2.post - /tmp/share/file3.post - EXECUTEALWAYS: - /tmp/myscript - APPEND: - /custom/mypasswd -> /etc/passwd - /custom/mygroups -> /etc/group - /custom/myshadow -> /etc/shadow - -Note: no order can be assumed by the order that the EXECUTE,EXECUTEALWAYS and APPEND clause fall in the synclist file. - -For more information on syncing files to node, read Sync-ing_Config_Files_to_Nodes - -On Linux rsync always uses ssh remoteshell. On AIX, ssh or rsh is used depending on the site.useSSHonAIX attribute. +On Linux B always uses ssh remoteshell. On AIX, B or B is used depending on the B table attribute. =item B<-h>|B<--help> @@ -218,15 +113,14 @@ Displays usage information. =item B<-i>|B<--rootimg> I -Specifies the path to the install image on the local Linux node. - +Specifies the path to the install image on the local Linux node. =item B<-o>|B<--node-options> I Specifies options to pass to the remote shell command for node targets. The options must be specified within double -quotation marks ("") to distinguish them from B options. +quotation marks ("") to distinguish them from B options. =item B<-p>|B<--preserve> @@ -236,14 +130,14 @@ the configured remote copy command. =item B<-P>|B<--pull> Pulls (copies) the files from the targets and places them in -the target_path directory on the local host. The target_path +the I directory on the local host. The I must be a directory. Files pulled from remote machines have -._target appended to the file name to distinguish between -them. When the B<-P> flag is used with the B<-R> flag, ._target is +B<._target> appended to the file name to distinguish between +them. When the B<-P> flag is used with the B<-R> flag, B<._target> is appended to the directory. Only one file per invocation of the -xdcp pull command can be pulled from the specified targets. -Hierarchy is not automatically support yet. You must first pull -the file to the Service Node and then pull the file to the Management +B pull command can be pulled from the specified targets. +In hierarchy, you must first pull +the file to the service node and then pull the file to the management node. =item B<-q>|B<--show-config> @@ -255,10 +149,17 @@ valid contexts. Each setting is prefixed with I: to identify the source context of the setting. -=item B<-r>|B<--node-rcp> I +=item B<-r>|B<--node-rcp> I -Specifies the full path of the remote copy command used -for remote command execution on node targets. +Specifies the full path of the remote copy command used for syncing files to node targets, such as B or B. If not specified, B will be used by default. + +Note: The synclist processing for B<-r /usr/bin/scp> has some differences with B<-r /usr/bin/rsync>: + +1) the B clause in synclist file is not supported with B<-r /usr/bin/scp> flag + +2) if the destination directory specified in synclist file is an existing file on target node, B will fail with "scp: : Not a directory" + +3) if the destination file specified in synclist file is an existing directory on target node, B will fail with "scp: : Is a directory" =item B<-R>|B<--recursive> I @@ -266,16 +167,15 @@ for remote command execution on node targets. Recursively copies files from a local directory to the remote targets, or when specified with the B<-P> flag, recursively pulls (copies) files from a remote directory to the local host. A -single source directory can be specified using the source_file -parameter. +single source directory can be specified using the I parameter. =item B<-s> I Will only sync the files listed in the synclist (B<-F>), to the service nodes for the input compute node list. The files will be placed in the -directory defined by the site.SNsyncfiledir attribute, or the default -/var/xcat/syncfiles directory. +directory defined by the B table attribute, or the default +B directory. =item B<-t>|B<--timeout> I @@ -361,9 +261,8 @@ variable is overridden by the B<-S> flag. =item B -Specifies the time, in seconds, to wait for output from -each remote target. This variable is overridden by the B<-t> -flag. +Specifies the time, in seconds, to wait for output from +each remote target. This variable is overridden by the B<-t> flag. =back @@ -374,13 +273,12 @@ Exit values for each remote copy command execution are displayed in messages from the xdcp command, if the remote copy command exit value is non-zero. A non-zero return code from a remote copy command indicates that an error was encountered during the remote copy. If a remote copy -command encounters an error, execution of the remote copy on that tar- -get is bypassed. +command encounters an error, execution of the remote copy on that target is bypassed. -The xdcp command exit code is 0, if the xdcp command executed without +The B command exit code is 0, if the B command executed without errors and all remote copy commands finished with exit codes of 0. If -internal xdcp errors occur or the remote copy commands do not complete -successfully, the xdcp command exit value is greater than 0. +internal B errors occur or the remote copy commands do not complete +successfully, the B command exit value is greater than 0. @@ -424,7 +322,7 @@ host as /var/log._target, enter: xdcp NodeGroup1 -f 12 -RP /var/log/testlogdir /var/log =item 3. -To copy /localnode/smallfile and /tmp/bigfile to /tmp on node1 +To copy /localnode/smallfile and /tmp/bigfile to B/tmp on node1 using rsync and input -t flag to rsync, enter: xdcp node1 -r /usr/bin/rsync -o "-t" /localnode/smallfile /tmp/bigfile /tmp @@ -456,72 +354,67 @@ To copy the /etc/hosts file from node1 and node2 to the =item 8. To rsync the /etc/hosts file to your compute nodes: -Create a rsync file /tmp/myrsync, with this line: +First create a syncfile /tmp/myrsync, with this line: -/etc/hosts -> /etc/hosts + /etc/hosts -> /etc/hosts or -/etc/hosts -> /etc/ (last / is required) + /etc/hosts -> /etc/ (last / is required) -Run: +Then run: xdcp compute -F /tmp/myrsync =item 9. To rsync all the files in /home/mikev to the compute nodes: -Create a rsync file /tmp/myrsync, with this line: +First create a rsync file /tmp/myrsync, with this line: -/home/mikev/* -> /home/mikev/ (last / is required) + /home/mikev/* -> /home/mikev/ (last / is required) -Run: +Then run: xdcp compute -F /tmp/myrsync =item 10. -To rsync to the compute nodes, using service nodes, the command will first -rsync the files to the /var/xcat/syncfiles directory on the service nodes and then rsync the files from that directory to the compute nodes. The /var/xcat/syncfiles default directory on the service nodes, can be changed by putting a directory value in the site table SNsyncfiledir attribute. +To rsync to the compute nodes, using service nodes: +First create a rsync file /tmp/myrsync, with this line: -Create a rsync file /tmp/myrsync, with this line: - -/etc/hosts /etc/passwd -> /etc + /etc/hosts /etc/passwd -> /etc or -/etc/hosts /etc/passwd -> /etc/ + /etc/hosts /etc/passwd -> /etc/ -Run: +Then run: xdcp compute -F /tmp/myrsync -to update the Compute Nodes - =item 11. To rsync to the service nodes in preparation for rsyncing the compute nodes during an install from the service node. -Create a rsync file /tmp/myrsync, with this line: +First create a rsync file /tmp/myrsync, with this line: -/etc/hosts /etc/passwd -> /etc + /etc/hosts /etc/passwd -> /etc -Run: +Then run: xdcp compute -s -F /tmp/myrsync -to sync the service node for compute =item 12. To rsync the /etc/file1 and file2 to your compute nodes and rename to filex and filey: -Create a rsync file /tmp/myrsync, with these line: +First create a rsync file /tmp/myrsync, with these line: -/etc/file1 -> /etc/filex + /etc/file1 -> /etc/filex -/etc/file2 -> /etc/filey + /etc/file2 -> /etc/filey -Run: +Then run: xdcp compute -F /tmp/myrsync @@ -530,11 +423,11 @@ to update the Compute Nodes =item 13. To rsync files in the Linux image at /install/netboot/fedora9/x86_64/compute/rootimg on the MN: -Create a rsync file /tmp/myrsync, with this line: +First create a rsync file /tmp/myrsync, with this line: -/etc/hosts /etc/passwd -> /etc + /etc/hosts /etc/passwd -> /etc -Run: +Then run: xdcp -i /install/netboot/fedora9/x86_64/compute/rootimg -F /tmp/myrsync diff --git a/xCAT-openbmc-py/debian/dirs b/xCAT-openbmc-py/debian/dirs index 305257b08..91077fa40 100644 --- a/xCAT-openbmc-py/debian/dirs +++ b/xCAT-openbmc-py/debian/dirs @@ -2,4 +2,5 @@ opt/xcat/lib/python/agent opt/xcat/lib/python/agent/xcatagent opt/xcat/lib/python/agent/common opt/xcat/lib/python/agent/hwctl -opt/xcat/lib/python/agent/hwctl/executor +opt/xcat/lib/python/agent/hwctl/openbmc +opt/xcat/lib/python/agent/hwctl/redfish diff --git a/xCAT-openbmc-py/lib/python/agent/client.py b/xCAT-openbmc-py/lib/python/agent/client.py index 1c8e0448e..ff2188e9e 100755 --- a/xCAT-openbmc-py/lib/python/agent/client.py +++ b/xCAT-openbmc-py/lib/python/agent/client.py @@ -55,13 +55,13 @@ class ClientShell(object): buf = json.dumps(req) s.send(utils.int2bytes(len(buf))) - s.send(buf) + s.send(buf.encode('utf-8')) while True: sz = s.recv(4) if len(sz) == 0: break sz = utils.bytes2int(sz) - data = s.recv(sz) + data = s.recv(sz).decode('utf-8') print(data) diff --git a/xCAT-openbmc-py/lib/python/agent/common/exceptions.py b/xCAT-openbmc-py/lib/python/agent/common/exceptions.py index 88e80e59a..ba135d177 100644 --- a/xCAT-openbmc-py/lib/python/agent/common/exceptions.py +++ b/xCAT-openbmc-py/lib/python/agent/common/exceptions.py @@ -3,10 +3,12 @@ class SelfServerException(Exception) : def __init__(self, message, detail_msg= "", host_and_port="") : super(Exception, self).__init__(message) + self.message = message self.host_and_port = host_and_port self.detail_msg = detail_msg class SelfClientException(Exception) : def __init__(self, message, code) : super(Exception, self).__init__(message) + self.message = message self.code = code diff --git a/xCAT-openbmc-py/lib/python/agent/common/rest.py b/xCAT-openbmc-py/lib/python/agent/common/rest.py index 46a9f7b2e..e82485c6d 100644 --- a/xCAT-openbmc-py/lib/python/agent/common/rest.py +++ b/xCAT-openbmc-py/lib/python/agent/common/rest.py @@ -9,14 +9,16 @@ from gevent.subprocess import Popen, PIPE import requests import urllib3 urllib3.disable_warnings() +from requests.auth import AuthBase -import exceptions as xcat_exception +from . import exceptions as xcat_exception class RestSession(object): def __init__(self): self.session = requests.Session() self.cookies = None + self.auth = None def request(self, method, url, headers, data=None, timeout=30): @@ -24,35 +26,37 @@ class RestSession(object): response = self.session.request(method, url, data=data, headers=headers, + auth=self.auth, verify=False, timeout=timeout) except requests.exceptions.ConnectionError as e: # Extract real reason for the exception and host/port from ConnectionError message - # Sometimes e.message is a list, sometimes is a string. Look for different patterns # to extract the data needed. + e = str(e) causing_error = "n/a" host_and_port = "n/a" - if "]" in e.message[0]: - causing_error_part1 = e.message[0].split("]")[1] + if "]" in e: + causing_error_part1 = e.split("]")[1] causing_error = causing_error_part1.split("'")[0] causing_error = causing_error.strip() - host_and_port = self.extract_server_and_port(e.message[0], "STRING") + host_and_port = self.extract_server_and_port(e, "STRING") - if "Connection aborted." in e.message[0]: + if "Connection aborted." in e: causing_error = "Connection reset by peer" host_and_port = self.extract_server_and_port(url, "URL") - if "connect timeout=" in e.message[0]: + if "connect timeout=" in e: causing_error = "timeout" - host_and_port = self.extract_server_and_port(e.message[0], "STRING") + host_and_port = self.extract_server_and_port(e, "STRING") message = 'Failed to connect to server.' # message = '\n\n--> {0} \n\n'.format(e.message[0]) raise xcat_exception.SelfServerException(message, '({0})'.format(causing_error), host_and_port) except requests.exceptions.Timeout as e: + e = str(e) causing_error = "timeout" - host_and_port = self.extract_server_and_port(e.message[0], "STRING") + host_and_port = self.extract_server_and_port(e, "STRING") message = 'Timeout to connect to server' raise xcat_exception.SelfServerException(message, '({0})'.format(causing_error), host_and_port) @@ -60,6 +64,9 @@ class RestSession(object): if not self.cookies: self.cookies = requests.utils.dict_from_cookiejar(self.session.cookies) + if not self.auth and 'X-Auth-Token' in response.headers: + self.auth = XTokenAuth(response.headers['X-Auth-Token']) + return response def extract_server_and_port(self, message_string, format="STRING"): @@ -127,3 +134,13 @@ class RestSession(object): raise SelfServerException(error) return response + +class XTokenAuth(AuthBase): + + def __init__(self,authToken): + + self.authToken=authToken + + def __call__(self, auth): + auth.headers['X-Auth-Token']=self.authToken + return(auth) diff --git a/xCAT-openbmc-py/lib/python/agent/common/task.py b/xCAT-openbmc-py/lib/python/agent/common/task.py index 76f7fa04d..1f93cab0e 100644 --- a/xCAT-openbmc-py/lib/python/agent/common/task.py +++ b/xCAT-openbmc-py/lib/python/agent/common/task.py @@ -35,7 +35,7 @@ class BaseCommand(object): self._pre(op, *args, **kwargs) self._execute(op, *args, **kwargs) self._post(op, *args, **kwargs) - except Exception, e: + except Exception as e: # TODO: put e into log print(traceback.format_exc(), file=sys.stderr) return None @@ -65,7 +65,7 @@ class ParallelNodesCommand(BaseCommand): assert self.inventory and type(self.inventory) is dict func = getattr(self, '%s' % op) if len(self.inventory) == 1: - node = self.inventory.keys()[0] + node = list(self.inventory.keys())[0] func(*args, node=node, nodeinfo=self.inventory[node], **kw) return @@ -75,7 +75,7 @@ class ParallelNodesCommand(BaseCommand): for node in self.inventory.keys(): try: gevent_pool.add( gevent.spawn(func, *args, node=node, nodeinfo=self.inventory[node], **kw)) - except Exception, e: + except Exception as e: error = '%s: Internel Error occured in gevent' % node #print(traceback.format_exc(), file=sys.stderr) self.callback.error(error) @@ -89,7 +89,7 @@ class ParallelNodesCommand(BaseCommand): self._pre(op, *args, **kwargs) self._execute_in_parallel(op, *args, **kwargs) self._post(op, *args, **kwargs) - except Exception, e: + except Exception as e: # TODO: put e into log print(traceback.format_exc(), file=sys.stderr) return None diff --git a/xCAT-openbmc-py/lib/python/agent/common/utils.py b/xCAT-openbmc-py/lib/python/agent/common/utils.py index 252541b6c..bdbfba23e 100644 --- a/xCAT-openbmc-py/lib/python/agent/common/utils.py +++ b/xCAT-openbmc-py/lib/python/agent/common/utils.py @@ -63,9 +63,9 @@ def recv_all(sock, size): if left_size < recv_size: tmp_size = left_size buf_part = sock.recv(tmp_size) - buf_parts.append(buf_part) + buf_parts.append(buf_part.decode('utf-8')) buf_size += len(buf_part) - buf = ''.join(buf_parts) + buf = ''.join(str(i) for i in buf_parts) return buf diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/__init__.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/__init__.py similarity index 100% rename from xCAT-openbmc-py/lib/python/agent/hwctl/executor/__init__.py rename to xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/__init__.py diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_beacon.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_beacon.py similarity index 100% rename from xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_beacon.py rename to xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_beacon.py diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_bmcconfig.py similarity index 99% rename from xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py rename to xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_bmcconfig.py index 19b990228..b7398d87c 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_bmcconfig.py @@ -81,7 +81,7 @@ class OpenBMCBmcConfigTask(ParallelNodesCommand): self.callback.info('%s: No attributes returned from the BMC.' % node) return dump_info - keys = dump_dict.keys() + keys = list(dump_dict.keys()) keys.sort() for key in keys: info = '[%d] Generated: %s, Size: %s' % \ @@ -140,7 +140,7 @@ class OpenBMCBmcConfigTask(ParallelNodesCommand): return dump_dict = obmc.list_dump_info() - keys = dump_dict.keys() + keys = list(dump_dict.keys()) keys.sort() for key in keys: @@ -378,6 +378,7 @@ rmdir \"/tmp/$userid\" \n") self.callback.info("%s: BMC Setting Password..." % node) except (SelfServerException, SelfClientException) as e: self.callback.error(e.message, node) + return self.callback.info("%s: BMC password changed. Update 'bmcpasswd' for the node or the 'passwd' table with the new password." % node) @@ -422,7 +423,7 @@ rmdir \"/tmp/$userid\" \n") return self.callback.error(e.message, node) if isinstance(value, dict): - str_value = str(value.values()[0]) + str_value = str(list(value.values())[0]) elif value: str_value = str(value) else: diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_eventlog.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_eventlog.py similarity index 97% rename from xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_eventlog.py rename to xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_eventlog.py index ad7f34853..65b29f230 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_eventlog.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_eventlog.py @@ -39,7 +39,7 @@ class OpenBMCEventlogTask(ParallelNodesCommand): # Get all eventlog records eventlog_info_dict = obmc.get_eventlog_info() - keys = eventlog_info_dict.keys() + keys = list(eventlog_info_dict.keys()) # Sort thy keys in natural order keys.sort(key=lambda x : int(x[0:])) @@ -76,7 +76,7 @@ class OpenBMCEventlogTask(ParallelNodesCommand): # Get all eventlog records eventlog_info_dict = obmc.get_eventlog_info() - keys = eventlog_info_dict.keys() + keys = list(eventlog_info_dict.keys()) # Sort the keys in natural order keys.sort(key=lambda x : int(x[0:])) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_flash.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_flash.py similarity index 99% rename from xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_flash.py rename to xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_flash.py index 2b4d21bf7..59e0f4153 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_flash.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_flash.py @@ -81,7 +81,7 @@ class OpenBMCFlashTask(ParallelNodesCommand): def _get_firmware_version(self, target_file): version = purpose = None - with open(target_file, 'r') as fh: + with open(target_file, encoding="utf8", errors='ignore') as fh: for line in fh: if 'version=' in line: version = line.split('=')[-1].strip() @@ -159,7 +159,7 @@ class OpenBMCFlashTask(ParallelNodesCommand): mapping_ids = [] if self.firmware: - version_list = self.firmware.keys() + version_list = list(self.firmware.keys()) else: return [] @@ -348,7 +348,7 @@ class OpenBMCFlashTask(ParallelNodesCommand): firmware_version = '' if self.firmware_file: - firmware_version = self.firmware.keys()[0] + firmware_version = list(self.firmware.keys())[0] try: obmc.upload_firmware(self.firmware_file) except (SelfServerException, SelfClientException) as e: diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_inventory.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_inventory.py similarity index 96% rename from xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_inventory.py rename to xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_inventory.py index dd9d15c76..fbf02c12f 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_inventory.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_inventory.py @@ -29,7 +29,7 @@ class OpenBMCInventoryTask(ParallelNodesCommand): target_file = utils.get_full_path(self.cwd, target_file) version = purpose = None - with open(target_file, 'r') as fh: + with open(target_file, encoding="utf8", errors='ignore') as fh: for line in fh: if 'version=' in line: version = line.split('=')[-1].strip() @@ -44,13 +44,13 @@ class OpenBMCInventoryTask(ParallelNodesCommand): def _get_firm_info(self, firm_info_list): (has_functional, firm_obj_dict) = firm_info_list firm_info = [] - keys = firm_obj_dict.keys() + keys = list(firm_obj_dict.keys()) keys.sort() for key in keys: flag = '' if firm_obj_dict[key].functional: flag = '*' - elif firm_obj_dict[key].priority == 0: + elif firm_obj_dict[key].priority == 0: if not has_functional: flag = '*' else: @@ -115,7 +115,7 @@ class OpenBMCInventoryTask(ParallelNodesCommand): # Process returned inventory_info_dict depending on the inventory requested if all == 1: # Everything gets displayed, even firmware - keys = inventory_info_dict.keys() + keys = list(inventory_info_dict.keys()) keys.sort() for key in keys: inventory_info += utils.sort_string_with_numbers(inventory_info_dict[key]) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_power.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_power.py similarity index 100% rename from xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_power.py rename to xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_power.py diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_sensor.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_sensor.py similarity index 100% rename from xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_sensor.py rename to xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_sensor.py diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_setboot.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_setboot.py similarity index 100% rename from xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_setboot.py rename to xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_setboot.py diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py index c244abc40..3b1fffee4 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py @@ -450,7 +450,7 @@ class OpenBMCRest(object): payload = { "data": PROJECT_PAYLOAD + BMC_URLS['reboot']['field'] } try: self.request('PUT', BMC_URLS['reboot']['path'], payload=payload, cmd='bmc_reset') - except SelfServerException,SelfClientException: + except (SelfServerException,SelfClientException) as e: # TODO: Need special handling for bmc reset, as it is normal bmc may return error pass @@ -578,7 +578,8 @@ class OpenBMCRest(object): logger.debug('IndexError (-2) for %s' % key) continue - key_type = filter(lambda x:x not in '0123456789', key_id).upper() + key_type_list = [x for x in key_id if x not in '0123456789'] + key_type = ''.join(key_type_list).upper() if key_type == 'CORE': key_type = 'CPU' @@ -656,7 +657,7 @@ class OpenBMCRest(object): # Check if policy table file is there ras_event_mapping = {} if os.path.isfile(RAS_POLICY_TABLE): - with open(RAS_POLICY_TABLE, "r") as data_file: + with open(RAS_POLICY_TABLE, encoding="utf8", errors='ignore') as data_file: policy_hash = json.load(data_file) if policy_hash: ras_event_mapping = policy_hash['events'] diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/redfish/__init__.py b/xCAT-openbmc-py/lib/python/agent/hwctl/redfish/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/redfish/redfish_power.py b/xCAT-openbmc-py/lib/python/agent/hwctl/redfish/redfish_power.py new file mode 100644 index 000000000..00325b994 --- /dev/null +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/redfish/redfish_power.py @@ -0,0 +1,123 @@ +#!/usr/bin/env python +############################################################################### +# IBM(c) 2018 EPL license http://www.eclipse.org/legal/epl-v10.html +############################################################################### +# -*- coding: utf-8 -*- +# +from __future__ import print_function +import gevent +import time + +from common.task import ParallelNodesCommand +from common.exceptions import SelfClientException, SelfServerException +from hwctl import redfish_client as redfish + +import logging +logger = logging.getLogger('xcatagent') + +POWER_STATE_DB = { + "on" : "powering-on", + "off" : "powering-off", + "boot" : "powering-on", +} + +class RedfishPowerTask(ParallelNodesCommand): + """Executor for power-related actions.""" + + def get_state(self, **kw): + + node = kw['node'] + rf = redfish.RedfishRest(name=node, nodeinfo=kw['nodeinfo'], messager=self.callback, + debugmode=self.debugmode, verbose=self.verbose) + + state = 'Unknown' + try: + rf.login() + chassis_state = rf.get_chassis_power_state() + if chassis_state == 'On': + state = rf.get_systems_power_state().lower() + else: + state = chassis_state.lower() + self.callback.info('%s: %s' % (node, state)) + except (SelfServerException, SelfClientException) as e: + self.callback.error(e.message, node) + + return state + + def get_bmcstate (self, **kw): + + node = kw['node'] + rf = redfish.RedfishRest(name=node, nodeinfo=kw['nodeinfo'], messager=self.callback, + debugmode=self.debugmode, verbose=self.verbose) + + state = 'Unknown' + try: + rf.login() + state = rf.get_bmc_state().lower() + self.callback.info('%s: %s' % (node, state)) + except (SelfServerException, SelfClientException) as e: + self.callback.error(e.message, node) + return state + + def set_state(self, state, **kw): + + node = kw['node'] + rf = redfish.RedfishRest(name=node, nodeinfo=kw['nodeinfo'], messager=self.callback, + debugmode=self.debugmode, verbose=self.verbose) + + try: + rf.login() + rf.set_power_state(state) + new_status = POWER_STATE_DB.get(state, '') + self.callback.info('%s: %s' % (node, state)) + if new_status: + self.callback.update_node_attributes('status', node, new_status) + except (SelfServerException, SelfClientException) as e: + self.callback.error(e.message, node) + + def reboot(self, optype='boot', **kw): + + node = kw['node'] + rf = redfish.RedfishRest(name=node, nodeinfo=kw['nodeinfo'], messager=self.callback, + debugmode=self.debugmode, verbose=self.verbose) + resettype = 'boot' + + try: + rf.login() + chassis_state = rf.get_chassis_power_state() + if chassis_state == 'Off': + status = chassis_state + else: + status = rf.get_systems_power_state() + + if status == 'Off': + if optype == 'reset': + return self.callback.info('%s: %s' % (node, status.lower())) + else: + resettype = 'on' + + rf.set_power_state(resettype) + new_status = POWER_STATE_DB.get(optype, '') + self.callback.info('%s: %s' % (node, optype)) + if new_status: + self.callback.update_node_attributes('status', node, new_status) + except (SelfServerException, SelfClientException) as e: + self.callback.error(e.message, node) + + def reboot_bmc(self, optype='warm', **kw): + + node = kw['node'] + rf = redfish.RedfishRest(name=node, nodeinfo=kw['nodeinfo'], messager=self.callback, + debugmode=self.debugmode, verbose=self.verbose) + + try: + rf.login() + except (SelfServerException, SelfClientException) as e: + return self.callback.error(e.message, node) + + try: + rf.reboot_bmc(optype) + except (SelfServerException, SelfClientException) as e: + self.callback.error(e.message, node) + else: + self.callback.info('%s: %s' % (node, 'bmcreboot')) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/redfish/redfish_setboot.py b/xCAT-openbmc-py/lib/python/agent/hwctl/redfish/redfish_setboot.py new file mode 100644 index 000000000..d80f9515a --- /dev/null +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/redfish/redfish_setboot.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python +############################################################################### +# IBM(c) 2018 EPL license http://www.eclipse.org/legal/epl-v10.html +############################################################################### +# -*- coding: utf-8 -*- +# +from __future__ import print_function +import gevent +import time + +from common.task import ParallelNodesCommand +from common.exceptions import SelfClientException, SelfServerException +from hwctl import redfish_client as redfish + +import logging +logger = logging.getLogger('xcatagent') + +class RedfishBootTask(ParallelNodesCommand): + """Executor for setboot-related actions.""" + + def get_state(self, **kw): + + node = kw['node'] + rf = redfish.RedfishRest(name=node, nodeinfo=kw['nodeinfo'], messager=self.callback, + debugmode=self.debugmode, verbose=self.verbose) + + state = 'Unknown' + try: + rf.login() + state = rf.get_boot_state() + self.callback.info('%s: %s' % (node, state)) + + except (SelfServerException, SelfClientException) as e: + self.callback.error(e.message, node) + + return state + + def set_state(self, setboot_state, persistant, **kw): + + node = kw['node'] + rf = redfish.RedfishRest(name=node, nodeinfo=kw['nodeinfo'], messager=self.callback, + debugmode=self.debugmode, verbose=self.verbose) + + try: + rf.login() + rf.set_boot_state(persistant, setboot_state) + state = rf.get_boot_state() + self.callback.info('%s: %s' % (node, state)) + + except (SelfServerException, SelfClientException) as e: + self.callback.error(e.message, node) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/redfish_client.py b/xCAT-openbmc-py/lib/python/agent/hwctl/redfish_client.py new file mode 100644 index 000000000..0900f63bf --- /dev/null +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/redfish_client.py @@ -0,0 +1,302 @@ +#!/usr/bin/env python +############################################################################### +# IBM(c) 2018 EPL license http://www.eclipse.org/legal/epl-v10.html +############################################################################### +# -*- coding: utf-8 -*- +# + +import os +import requests +import json +import time + +from common import utils, rest +from common.exceptions import SelfClientException, SelfServerException + +import logging +logger = logging.getLogger('xcatagent') + +HTTP_PROTOCOL = "https://" +PROJECT_URL = "/redfish/v1" + +CHASSIS_URL = PROJECT_URL + "/Chassis" +MANAGER_URL = PROJECT_URL + "/Managers" +SYSTEMS_URL = PROJECT_URL + "/Systems" +SESSION_URL = PROJECT_URL + "/SessionService/Sessions" + +BMC_RESET_TYPE = "ForceRestart" + +POWER_RESET_TYPE = { + 'boot' : 'ForceRestart', + 'off' : 'ForceOff', + 'on' : 'ForceOn', +} + +BOOTSOURCE_SET_STATE = { + "cd" : "Cd", + "def" : "None", + "default": "None", + "floppy" : "Floppy", + "hd" : "Hdd", + "net" : "Pxe", + "setup" : "BiosSetup", +} + +BOOTSOURCE_GET_STATE = { + "BiosSetup": "BIOS Setup", + "Floppy" : "Floppy", + "Cd" : "CD/DVD", + "Hdd" : "Hard Drive", + "None" : "boot override inactive", + "Pxe" : "Network", +} + +manager_reset_string = '#Manager.Reset' +system_reset_string = '#ComputerSystem.Reset' +reset_type_string = 'ResetType@Redfish.AllowableValues' +reset_action_string = '@Redfish.ActionInfo' + +class RedfishRest(object): + + headers = {'Content-Type': 'application/json'} + + def __init__(self, name, **kwargs): + + self.name = name + self.username = None + self.password = None + + if 'nodeinfo' in kwargs: + for key, value in kwargs['nodeinfo'].items(): + setattr(self, key, value) + if not hasattr(self, 'bmcip'): + self.bmcip = self.name + + self.verbose = kwargs.get('debugmode') + self.messager = kwargs.get('messager') + + self.session = rest.RestSession() + self.root_url = HTTP_PROTOCOL + self.bmcip + + def _print_record_log (self, msg, cmd, error_flag=False): + + if self.verbose or error_flag: + localtime = time.asctime( time.localtime(time.time()) ) + log = self.name + ': [redfish_debug] ' + cmd + ' ' + msg + if self.verbose: + self.messager.info(localtime + ' ' + log) + logger.debug(log) + + def _print_error_log (self, msg, cmd): + + self._print_record_log(msg, cmd, True) + + def _log_request (self, method, url, headers, data=None, files=None, file_path=None, cmd=''): + + header_str = ' '.join([ "%s: %s" % (k, v) for k,v in headers.items() ]) + msg = 'curl -k -X %s -H \"%s\" ' % (method, header_str) + + if cmd != 'login': + msg += '-H \"X-Auth-Token: xxxxxx\" ' + + if data: + if cmd == 'login': + data = data.replace('"Password": "%s"' % self.password, '"Password": "xxxxxx"') + data = '-d \'%s\'' % data + msg += '%s %s -v' % (url, data) + else: + msg += url + + self._print_record_log(msg, cmd) + return msg + + def request (self, method, resource, headers=None, payload=None, timeout=30, cmd=''): + + httpheaders = headers or RedfishRest.headers + url = resource + if not url.startswith(HTTP_PROTOCOL): + url = self.root_url + resource + + data = None + if payload: + data=json.dumps(payload) + + self._log_request(method, url, httpheaders, data=data, cmd=cmd) + + try: + response = self.session.request(method, url, headers=httpheaders, data=data, timeout=timeout) + return self.handle_response(response, cmd=cmd) + except SelfServerException as e: + if cmd == 'login': + e.message = "Login to BMC failed: Can't connect to {0} {1}.".format(e.host_and_port, e.detail_msg) + else: + e.message = 'BMC did not respond. ' \ + 'Validate BMC configuration and retry the command.' + self._print_error_log(e.message, cmd) + raise + except ValueError: + error = 'Received wrong format response: %s' % response + self._print_error_log(error, cmd) + raise SelfServerException(error) + + def handle_response (self, resp, cmd=''): + + data = resp.json() + code = resp.status_code + + if code != requests.codes.ok and code != requests.codes.created: + + description = ''.join(data['error']['@Message.ExtendedInfo'][0]['Message']) + error = '[%d] %s' % (code, description) + self._print_error_log(error, cmd) + raise SelfClientException(error, code) + + if cmd == 'login' and not 'X-Auth-Token' in resp.headers: + raise SelfServerException('Login Failed: Did not get Session Token from response') + + if 'Name' in data: + self._print_record_log('%s %s' % (code, data['Name']), cmd) + elif 'error' in data: + self._print_record_log('%s %s' % (code, data['error']['message']), cmd) + return data + + def login(self): + + payload = { "UserName": self.username, "Password": self.password } + self.request('POST', SESSION_URL, payload=payload, timeout=20, cmd='login') + + def _get_members(self, url): + + data = self.request('GET', url, cmd='get_members') + try: + return data['Members'] + except KeyError as e: + raise SelfServerException('Get KeyError %s' % e.args) + + def get_bmc_state(self): + + members = self._get_members(MANAGER_URL) + target_url = members[0]['@odata.id'] + data = self.request('GET', target_url, cmd='get_bmc_state') + try: + return data['PowerState'] + except KeyError as e: + raise SelfServerException('Get KeyError %s' % e.args) + + def get_chassis_power_state(self): + + members = self._get_members(CHASSIS_URL) + target_url = members[0]['@odata.id'] + data = self.request('GET', target_url, cmd='get_chassis_power_state') + try: + return data['PowerState'] + except KeyError as e: + raise SelfServerException('Get KeyError %s' % e.args) + + def get_systems_power_state(self): + + members = self._get_members(SYSTEMS_URL) + target_url = members[0]['@odata.id'] + data = self.request('GET', target_url, cmd='get_systems_power_state') + try: + return data['PowerState'] + except KeyError as e: + raise SelfServerException('Get KeyError %s' % e.args) + + def _get_bmc_actions(self): + + members = self._get_members(MANAGER_URL) + target_url = members[0]['@odata.id'] + data = self.request('GET', target_url, cmd='get_bmc_actions') + + try: + actions_dict = data['Actions'][manager_reset_string] + target_url = actions_dict['target'] + if reset_action_string in actions_dict: + action_info = self.request('GET', actions_dict[reset_action_string], cmd='get_bmc_actions') + actions = action_info['Parameters'][0]['AllowableValues'] + else: + actions = actions_dict[reset_type_string] + except KeyError as e: + raise SelfServerException('Get KeyError %s' % e.args) + + return (target_url, actions) + + def reboot_bmc(self, optype='warm'): + + target_url, actions = self._get_bmc_actions() + if BMC_RESET_TYPE not in actions: + raise SelfClientException('Unsupported option: %s' % BMC_RESET_TYPE, 403) + + data = { "ResetType": BMC_RESET_TYPE } + return self.request('POST', target_url, payload=data, cmd='set_bmc_state') + + def _get_power_actions(self): + + members = self._get_members(SYSTEMS_URL) + target_url = members[0]['@odata.id'] + data = self.request('GET', target_url, cmd='get_power_actions') + + try: + actions_dict = data['Actions'][system_reset_string] + target_url = actions_dict['target'] + if reset_action_string in actions_dict: + action_info = self.request('GET', actions_dict[reset_action_string], cmd='get_power_actions') + actions = action_info['Parameters'][0]['AllowableValues'] + else: + actions = actions_dict[reset_type_string] + except KeyError as e: + raise SelfServerException('Get KeyError %s' % e.args) + + return (target_url, actions) + + def set_power_state(self, state): + + target_url, actions = self._get_power_actions() + if POWER_RESET_TYPE[state] not in actions: + raise SelfClientException('Unsupported option: %s' % state, 403) + + data = { "ResetType": POWER_RESET_TYPE[state] } + return self.request('POST', target_url, payload=data, cmd='set_power_state') + + def get_boot_state(self): + + members = self._get_members(SYSTEMS_URL) + target_url = members[0]['@odata.id'] + data = self.request('GET', target_url, cmd='get_boot_state') + try: + boot_enable = data['Boot']['BootSourceOverrideEnabled'] + if boot_enable == 'Disabled': + return 'boot override inactive' + bootsource = data['Boot']['BootSourceOverrideTarget'] + return BOOTSOURCE_GET_STATE.get(bootsource, bootsource) + except KeyError as e: + raise SelfServerException('Get KeyError %s' % e.args) + + def _get_boot_actions(self): + + members = self._get_members(SYSTEMS_URL) + target_url = members[0]['@odata.id'] + data = self.request('GET', target_url, cmd='get_boot_actions') + try: + actions = data['Boot']['BootSourceOverrideTarget@Redfish.AllowableValues'] + except KeyError as e: + raise SelfServerException('Get KeyError %s' % e.args) + + return (target_url, actions) + + def set_boot_state(self, persistant, state): + + target_url, actions = self._get_boot_actions() + target_data = BOOTSOURCE_SET_STATE[state] + if target_data not in actions: + raise SelfClientException('Unsupported option: %s' % state, 403) + + boot_enable = 'Once' + if persistant: + boot_enable = 'Continuous' + if target_data == 'None': + boot_enable = 'Disabled' + data = {'Boot': {'BootSourceOverrideEnabled': boot_enable, "BootSourceOverrideTarget": target_data} } + return self.request('PATCH', target_url, payload=data, cmd='set_boot_state') + diff --git a/xCAT-openbmc-py/lib/python/agent/tests/__init__.py b/xCAT-openbmc-py/lib/python/agent/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/xCAT-openbmc-py/lib/python/agent/tests/unit/__init__.py b/xCAT-openbmc-py/lib/python/agent/tests/unit/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/bmc_action_rsp.json b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/bmc_action_rsp.json new file mode 100644 index 000000000..32739dada --- /dev/null +++ b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/bmc_action_rsp.json @@ -0,0 +1,19 @@ +{ + "@odata.context": "/redfish/v1/$metadata#ActionInfo.ActionInfo", + "@odata.type": "#ActionInfo.v1_1_0.ActionInfo", + "@odata.id": "/redfish/v1/Managers/BMC/ResetActionInfo", + "Id": "ResetActionInfo", + "Name": "Reset Action Info", + "Parameters": [ + { + "Name": "ResetType", + "Required": true, + "DataType": "String", + "AllowableValues": [ + "ForceRestart", + "GracefulRestart" + ] + } + ], + "Oem": {} +} diff --git a/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/chassis_rsp.json b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/chassis_rsp.json new file mode 100644 index 000000000..0538f74f1 --- /dev/null +++ b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/chassis_rsp.json @@ -0,0 +1,45 @@ +{ + "@odata.context": "/redfish/v1/$metadata#Chassis.Chassis", + "@odata.type": "#Chassis.v1_8_0.Chassis", + "@odata.id": "/redfish/v1/Chassis/Chassis0", + "Id": "Chassis0", + "Name": "OpenPOWER System Chassis", + "ChassisType": "RackMount", + "Manufacturer": "IBM", + "Model": "SYSTEM", + "SerialNumber": "C829UAE15A10564", + "PartNumber": "9006-22P", + "AssetTag": "", + "PowerState": "On", + "IndicatorLED": "Off", + "Status": { + "State": "Enabled", + "Health": "OK" + }, + "PhysicalSecurity": { + "IntrusionSensorNumber": 226, + "IntrusionSensor": "HardwareIntrusion", + "IntrusionSensorReArm": "Manual" + }, + "Thermal": { + "@odata.id": "/redfish/v1/Chassis/Chassis0/Thermal" + }, + "Power": { + "@odata.id": "/redfish/v1/Chassis/Chassis0/Power" + }, + "Assembly": { + "@odata.id": "/redfish/v1/Chassis/Chassis0/Assembly" + }, + "Links": { + "ComputerSystems": [ + { + "@odata.id": "/redfish/v1/Systems/Computer" + } + ], + "ManagedBy": [ + { + "@odata.id": "/redfish/v1/Managers/BMC" + } + ] + } +} diff --git a/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/login_no_auth_rsp.json b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/login_no_auth_rsp.json new file mode 100644 index 000000000..d87bf2998 --- /dev/null +++ b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/login_no_auth_rsp.json @@ -0,0 +1,18 @@ +{ + "error": { + "code": "Base.1.4.0.GeneralError", + "message": "A general error has occurred. See Resolution for information on how to resolve the error.", + "@Message.ExtendedInfo": [ + { + "MessageId": "Base.1.4.0.ResourceAtUriUnauthorized", + "Severity": "Critical", + "Resolution": "Ensure that the appropriate access is provided for the service in order for it to access the URI.", + "Message": "While accessing the resource at /redfish/v1/SessionService/Sessions, the service received an authorization error unauthorized.", + "MessageArgs": [ + "/redfish/v1/SessionService/Sessions", + "unauthorized" + ] + } + ] + } +} diff --git a/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/login_rsp.json b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/login_rsp.json new file mode 100644 index 000000000..2edae3953 --- /dev/null +++ b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/login_rsp.json @@ -0,0 +1,10 @@ +{ + "@odata.type": "#Session.v1_1_1.Session", + "UserName": "ADMIN", + "Description": "Manager User Session", + "@odata.id": "/redfish/v1/SessionService/Sessions/a6cbc1e29e9cd559", + "@odata.context": "/redfish/v1/$metadata#Session.Session", + "Oem": {}, + "Id": "a6cbc1e29e9cd559", + "Name": "User Session" +} diff --git a/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/manager_rsp.json b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/manager_rsp.json new file mode 100644 index 000000000..99c1a768a --- /dev/null +++ b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/manager_rsp.json @@ -0,0 +1,90 @@ +{ + "@odata.context": "/redfish/v1/$metadata#Manager.Manager", + "@odata.type": "#Manager.v1_5_0.Manager", + "@odata.id": "/redfish/v1/Managers/BMC", + "Id": "BMC", + "Description": "Aspeed BMC", + "Name": "Manager", + "ManagerType": "BMC", + "UUID": "00000000-0000-0000-0000-000000000", + "Model": "P9DSU 9006-22P", + "DateTime": "2019-01-22T06:22:55+00:00", + "DateTimeLocalOffset": "+00:00", + "FirmwareVersion": "2.04", + "Status": { + "State": "Enabled", + "Health": "OK" + }, + "PowerState": "On", + "SerialConsole": { + "ServiceEnabled": true, + "MaxConcurrentSessions": 1, + "ConnectTypesSupported": [ + "IPMI" + ] + }, + "CommandShell": { + "ServiceEnabled": true, + "MaxConcurrentSessions": 0, + "ConnectTypesSupported": [ + "SSH" + ] + }, + "GraphicalConsole": { + "ServiceEnabled": true, + "MaxConcurrentSessions": 4, + "ConnectTypesSupported": [ + "KVMIP" + ] + }, + "EthernetInterfaces": { + "@odata.id": "/redfish/v1/Managers/BMC/EthernetInterfaces" + }, + "SerialInterfaces": { + "@odata.id": "/redfish/v1/Managers/BMC/SerialInterfaces" + }, + "NetworkProtocol": { + "@odata.id": "/redfish/v1/Managers/BMC/NetworkProtocol" + }, + "LogServices": { + "@odata.id": "/redfish/v1/Managers/BMC/LogServices" + }, + "VirtualMedia": { + "@odata.id": "/redfish/v1/Managers/BMC/VirtualMedia" + }, + "Links": { + "ManagerForServers": [ + { + "@odata.id": "/redfish/v1/Systems/Computer" + } + ], + "ManagerForChassis": [ + { + "@odata.id": "/redfish/v1/Chassis/Chassis0" + } + ], + "ManagerInChassis": { + "@odata.id": "/redfish/v1/Chassis/Chassis0" + } + }, + "Actions": { + "#Manager.Reset": { + "target": "/redfish/v1/Managers/BMC/Actions/Manager.Reset", + "@Redfish.ActionInfo": "/redfish/v1/Managers/BMC/ResetActionInfo" + } + }, + "Oem": { + "Supermicro": { + "@odata.type": "#SMCManager.v1_0_1.SMCManager", + "FanMode": { + "@odata.id": "/redfish/v1/Managers/BMC/Oem/Supermicro/FanMode" + }, + "MouseMode": { + "@odata.id": "/redfish/v1/Managers/BMC/Oem/Supermicro/MouseMode" + }, + "SMTP": { + "@odata.id": "/redfish/v1/Managers/BMC/Oem/Supermicro/SMTP" + } + } + } +} diff --git a/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/manager_rsp_v123.json b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/manager_rsp_v123.json new file mode 100644 index 000000000..38c406265 --- /dev/null +++ b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/manager_rsp_v123.json @@ -0,0 +1,93 @@ +{ + "@odata.context": "/redfish/v1/$metadata#Manager.Manager", + "@odata.type": "#Manager.v1_5_0.Manager", + "@odata.id": "/redfish/v1/Managers/BMC", + "Id": "BMC", + "Description": "Aspeed BMC", + "Name": "Manager", + "ManagerType": "BMC", + "UUID": "006126AB-B608-E911-8000-0CC47AD55B4E", + "Model": "P9DSU 9006-22P", + "DateTime": "2019-01-22T06:22:55+00:00", + "DateTimeLocalOffset": "+00:00", + "FirmwareVersion": "2.04", + "Status": { + "State": "Enabled", + "Health": "OK" + }, + "PowerState": "On", + "SerialConsole": { + "ServiceEnabled": true, + "MaxConcurrentSessions": 1, + "ConnectTypesSupported": [ + "IPMI" + ] + }, + "CommandShell": { + "ServiceEnabled": true, + "MaxConcurrentSessions": 0, + "ConnectTypesSupported": [ + "SSH" + ] + }, + "GraphicalConsole": { + "ServiceEnabled": true, + "MaxConcurrentSessions": 4, + "ConnectTypesSupported": [ + "KVMIP" + ] + }, + "EthernetInterfaces": { + "@odata.id": "/redfish/v1/Managers/BMC/EthernetInterfaces" + }, + "SerialInterfaces": { + "@odata.id": "/redfish/v1/Managers/BMC/SerialInterfaces" + }, + "NetworkProtocol": { + "@odata.id": "/redfish/v1/Managers/BMC/NetworkProtocol" + }, + "LogServices": { + "@odata.id": "/redfish/v1/Managers/BMC/LogServices" + }, + "VirtualMedia": { + "@odata.id": "/redfish/v1/Managers/BMC/VirtualMedia" + }, + "Links": { + "ManagerForServers": [ + { + "@odata.id": "/redfish/v1/Systems/Computer" + } + ], + "ManagerForChassis": [ + { + "@odata.id": "/redfish/v1/Chassis/Planar" + } + ], + "ManagerInChassis": { + "@odata.id": "/redfish/v1/Chassis/Planar" + } + }, + "Actions": { + "#Manager.Reset": { + "target": "/redfish/v1/Managers/BMC/Actions/Manager.Reset", + "ResetType@Redfish.AllowableValues": [ + "ForceRestart", + "GracefulRestart" + ] + } + }, + "Oem": { + "Supermicro": { + "@odata.type": "#SMCManager.v1_0_1.SMCManager", + "FanMode": { + "@odata.id": "/redfish/v1/Managers/BMC/Oem/Supermicro/FanMode" + }, + "MouseMode": { + "@odata.id": "/redfish/v1/Managers/BMC/Oem/Supermicro/MouseMode" + }, + "SMTP": { + "@odata.id": "/redfish/v1/Managers/BMC/Oem/Supermicro/SMTP" + } + } + } +} diff --git a/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/redfish_v1_rsp.json b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/redfish_v1_rsp.json new file mode 100644 index 000000000..3f6e2f0ca --- /dev/null +++ b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/redfish_v1_rsp.json @@ -0,0 +1,42 @@ +{ + "@odata.context": "/redfish/v1/$metadata#ServiceRoot.ServiceRoot", + "@odata.type": "#ServiceRoot.v1_4_0.ServiceRoot", + "@odata.id": "/redfish/v1", + "Id": "v1", + "Name": "Root Service", + "RedfishVersion": "1.6.0", + "UUID": "00000000-0000-0000-0000-0CC47AD55B4E", + "SessionService": { + "@odata.id": "/redfish/v1/SessionService" + }, + "AccountService": { + "@odata.id": "/redfish/v1/AccountService" + }, + "Registries": { + "@odata.id": "/redfish/v1/Registries" + }, + "JsonSchemas": { + "@odata.id": "/redfish/v1/JsonSchemas" + }, + "Chassis": { + "@odata.id": "/redfish/v1/Chassis" + }, + "Managers": { + "@odata.id": "/redfish/v1/Managers" + }, + "Systems": { + "@odata.id": "/redfish/v1/Systems" + }, + "UpdateService": { + "@odata.id": "/redfish/v1/UpdateService" + }, + "EventService": { + "@odata.id": "/redfish/v1/EventService" + }, + "Links": { + "Sessions": { + "@odata.id": "/redfish/v1/SessionService/Sessions" + } + }, + "Oem": {} +} diff --git a/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/system_action_rsp.json b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/system_action_rsp.json new file mode 100644 index 000000000..decbf8cac --- /dev/null +++ b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/system_action_rsp.json @@ -0,0 +1,23 @@ +{ + "@odata.context": "/redfish/v1/$metadata#ActionInfo.ActionInfo", + "@odata.type": "#ActionInfo.v1_1_0.ActionInfo", + "@odata.id": "/redfish/v1/Systems/Computer/ResetActionInfo", + "Id": "ResetActionInfo", + "Name": "Reset Action Info", + "Parameters": [ + { + "Name": "ResetType", + "Required": true, + "DataType": "String", + "AllowableValues": [ + "On", + "ForceOff", + "GracefulShutdown", + "GracefulRestart", + "ForceRestart", + "ForceOn" + ] + } + ], + "Oem": {} +} diff --git a/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/systems_rsp.json b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/systems_rsp.json new file mode 100644 index 000000000..eee81f42e --- /dev/null +++ b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/systems_rsp.json @@ -0,0 +1,79 @@ +{ + "@odata.context": "/redfish/v1/$metadata#ComputerSystem.ComputerSystem", + "@odata.type": "#ComputerSystem.v1_5_0.ComputerSystem", + "@odata.id": "/redfish/v1/Systems/Computer", + "Id": "Computer", + "Name": "OpenPOWER Computer System", + "Description": "OpenPOWER Computer System", + "Status": { + "State": "Enabled", + "Health": "Critical" + }, + "SerialNumber": "C829UAE15A10564", + "PartNumber": "9006-22P", + "Manufacturer": "IBM", + "Model": "SYSTEM", + "SystemType": "Physical", + "BiosVersion": "2.04 20190118", + "UUID": "00000000-0000-0000-0000-0000000000", + "ProcessorSummary": { + "Count": 2, + "Model": "POWER CPU", + "Status": { + "State": "Enabled", + "Health": "OK" + } + }, + "IndicatorLED": "Off", + "PowerState": "On", + "Boot": { + "BootSourceOverrideMode": "Legacy", + "BootSourceOverrideEnabled": "Once", + "BootSourceOverrideTarget": "None", + "BootSourceOverrideTarget@Redfish.AllowableValues": [ + "None", + "Pxe", + "Hdd", + "Diags", + "Cd", + "BiosSetup", + "Usb", + "Floppy" + ] + }, + "HostWatchdogTimer": { + "FunctionEnabled": true, + "WarningAction": "None", + "WarningAction@Redfish.AllowableValues": [ + "None" + ], + "TimeoutAction": "None", + "TimeoutAction@Redfish.AllowableValues": [ + "None", + "ResetSystem", + "PowerDown", + "PowerCycle" + ], + "Status": { + "State": "StandbyOffline" + } + }, + "Links": { + "Chassis": [ + { + "@odata.id": "/redfish/v1/Chassis/chassis0" + } + ], + "ManagedBy": [ + { + "@odata.id": "/redfish/v1/Managers/BMC" + } + ] + }, + "Actions": { + "#ComputerSystem.Reset": { + "target": "/redfish/v1/Systems/Computer/Actions/ComputerSystem.Reset", + "@Redfish.ActionInfo": "/redfish/v1/Systems/Computer/ResetActionInfo" + } + } +} diff --git a/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/systems_rsp_v123.json b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/systems_rsp_v123.json new file mode 100644 index 000000000..caee86e6b --- /dev/null +++ b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/systems_rsp_v123.json @@ -0,0 +1,86 @@ +{ + "@odata.context": "/redfish/v1/$metadata#ComputerSystem.ComputerSystem", + "@odata.type": "#ComputerSystem.v1_5_0.ComputerSystem", + "@odata.id": "/redfish/v1/Systems/Computer", + "Id": "Computer", + "Name": "OpenPOWER Computer System", + "Description": "OpenPOWER Computer System", + "Status": { + "State": "Enabled", + "Health": "Critical" + }, + "SerialNumber": "C829UAE15A10564", + "PartNumber": "9006-22P", + "Manufacturer": "IBM", + "Model": "SYSTEM", + "SystemType": "Physical", + "BiosVersion": "2.04 20190118", + "UUID": "00000000-0000-0000-0000-0000000000", + "ProcessorSummary": { + "Count": 2, + "Model": "POWER CPU", + "Status": { + "State": "Enabled", + "Health": "OK" + } + }, + "IndicatorLED": "Off", + "PowerState": "On", + "Boot": { + "BootSourceOverrideMode": "Legacy", + "BootSourceOverrideEnabled": "Once", + "BootSourceOverrideTarget": "None", + "BootSourceOverrideTarget@Redfish.AllowableValues": [ + "None", + "Pxe", + "Hdd", + "Diags", + "Cd", + "BiosSetup", + "Usb", + "Floppy" + ] + }, + "HostWatchdogTimer": { + "FunctionEnabled": true, + "WarningAction": "None", + "WarningAction@Redfish.AllowableValues": [ + "None" + ], + "TimeoutAction": "None", + "TimeoutAction@Redfish.AllowableValues": [ + "None", + "ResetSystem", + "PowerDown", + "PowerCycle" + ], + "Status": { + "State": "StandbyOffline" + } + }, + "Links": { + "Chassis": [ + { + "@odata.id": "/redfish/v1/Chassis/chassis0" + } + ], + "ManagedBy": [ + { + "@odata.id": "/redfish/v1/Managers/BMC" + } + ] + }, + "Actions": { + "#ComputerSystem.Reset": { + "target": "/redfish/v1/Systems/Computer/Actions/ComputerSystem.Reset", + "ResetType@Redfish.AllowableValues": [ + "On", + "ForceOff", + "GracefulShutdown", + "GracefulRestart", + "ForceRestart", + "ForceOn" + ] + } + } +} diff --git a/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/with_error_rsp.json b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/with_error_rsp.json new file mode 100644 index 000000000..95630660b --- /dev/null +++ b/xCAT-openbmc-py/lib/python/agent/tests/unit/json_data/with_error_rsp.json @@ -0,0 +1,7 @@ +{ + "error": + { + "message": "Successfully Completed Request", + "code": "Base.1.4.0.Success" + } +} diff --git a/xCAT-openbmc-py/lib/python/agent/tests/unit/test_hwctl/__init__.py b/xCAT-openbmc-py/lib/python/agent/tests/unit/test_hwctl/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/xCAT-openbmc-py/lib/python/agent/tests/unit/test_hwctl/test_redfish_client.py b/xCAT-openbmc-py/lib/python/agent/tests/unit/test_hwctl/test_redfish_client.py new file mode 100644 index 000000000..0318531c8 --- /dev/null +++ b/xCAT-openbmc-py/lib/python/agent/tests/unit/test_hwctl/test_redfish_client.py @@ -0,0 +1,375 @@ +#!/usr/bin/env python +############################################################################### +# IBM(c) 2018 EPL license http://www.eclipse.org/legal/epl-v10.html +############################################################################### +# -*- coding: utf-8 -*- +# + +import pytest +import mock +import json +import os +import logging +import time +import requests + +from hwctl import redfish_client as rf +from common.utils import Messager +from common.exceptions import SelfClientException, SelfServerException + +DATA_DIR = os.path.dirname(os.path.realpath(__file__)) + '/../json_data' +logging.basicConfig(level=logging.DEBUG) +REDFISH_URL = '/redfish/v1' + +class TestRedfishClient(object): + + nodeinfo_dict = {'bmc': 'testbmc', 'bmcip': '10.0.0.1', 'username': 'username', 'password': 'password'} + log = logging.getLogger('TestRedfishClient') + rf_rest = rf.RedfishRest(name='testnode', nodeinfo=nodeinfo_dict, messager=Messager(), + debugmode=True, verbose=False) + headers = {'Content-Type': 'application/json'} + with open("%s/redfish_v1_rsp.json" % DATA_DIR,'r') as load_f: + rf_v1 = json.load(load_f) + chassis_url = rf_v1['Chassis']['@odata.id'] + manager_url = rf_v1['Managers']['@odata.id'] + systems_url = rf_v1['Systems']['@odata.id'] + session_url = rf_v1['Links']['Sessions']['@odata.id'] + + def test__init__(self): + assert self.rf_rest.name == 'testnode' + assert self.rf_rest.bmc == 'testbmc' + assert self.rf_rest.bmcip == '10.0.0.1' + assert self.rf_rest.username == 'username' + assert self.rf_rest.password == 'password' + assert isinstance(self.rf_rest.messager, Messager) + assert self.rf_rest.verbose == True + assert self.rf_rest.root_url == 'https://10.0.0.1' + + def test__print_record_log(self): + self.rf_rest._print_record_log("test__print_record_log", "test") + assert self.rf_rest.messager.info + assert time.asctime + + def test__print_error_log(self): + self.rf_rest._print_record_log("test__print_error_log", "test") + assert self.rf_rest._print_record_log + + def test__log_request(self): + self.rf_rest._print_record_log = mock.Mock(return_value=True) + login_data = json.dumps({ "UserName": self.rf_rest.username, "Password": self.rf_rest.password }) + msg_data = login_data.replace('"Password": "%s"' % self.rf_rest.password, '"Password": "xxxxxx"') + test_data = json.dumps({ "Test": True }) + login_msg = 'curl -k -X POST -H "Content-Type: application/json" https://10.0.0.1%s -d \'%s\' -v' % (self.session_url, msg_data) + test_data_msg = 'curl -k -X POST -H "Content-Type: application/json" -H "X-Auth-Token: xxxxxx" https://10.0.0.1/redfish/v1/Managers -d \'%s\' -v' % test_data + get_msg = 'curl -k -X GET -H "Content-Type: application/json" -H "X-Auth-Token: xxxxxx" https://10.0.0.1/redfish/v1/Managers' + assert self.rf_rest._log_request('POST', self.rf_rest.root_url + self.session_url, self.headers, data=login_data, cmd='login') == login_msg + assert self.rf_rest._log_request('POST', self.rf_rest.root_url + self.manager_url, self.headers, data=test_data, cmd='test__log_request') == test_data_msg + assert self.rf_rest._log_request('GET', self.rf_rest.root_url + self.manager_url, self.headers, cmd='test__log_request') == get_msg + + def test_handle_response_not_ok(self): + test_rsp = requests.Response() + test_rsp.status_code = 401 + with open("%s/login_no_auth_rsp.json" % DATA_DIR,'r') as load_f: + test_rsp._content = json.dumps(json.load(load_f)) + with pytest.raises(SelfClientException) as excinfo: + data = self.rf_rest.handle_response(test_rsp, cmd='test_handle_response_not_ok') + assert excinfo.type == SelfClientException + assert 'the service received an authorization error unauthorized' in str(excinfo.value) + + def test_handle_response_no_auth(self): + test_rsp = requests.Response() + test_rsp.status_code = 201 + test_rsp.headers = {} + with open("%s/login_rsp.json" % DATA_DIR,'r') as load_f: + test_rsp._content = json.dumps(json.load(load_f)) + with pytest.raises(SelfServerException) as excinfo: + data = self.rf_rest.handle_response(test_rsp, cmd='login') + assert excinfo.type == SelfServerException + assert 'Login Failed: Did not get Session Token from response' in str(excinfo.value) + + def test_handle_response_name(self): + test_rsp = requests.Response() + test_rsp.status_code = 200 + test_rsp.headers = {'X-Auth-Token': 'abcdefghijklmn'} + with open("%s/login_rsp.json" % DATA_DIR,'r') as load_f: + file_data = json.load(load_f) + test_rsp._content = json.dumps(file_data) + data = self.rf_rest.handle_response(test_rsp, cmd='get_information') + assert data == file_data + + def test_handle_response_error(self): + test_rsp = requests.Response() + test_rsp.status_code = 200 + test_rsp.headers = {'X-Auth-Token': 'abcdefghijklmn'} + with open("%s/with_error_rsp.json" % DATA_DIR,'r') as load_f: + file_data = json.load(load_f) + test_rsp._content = json.dumps(file_data) + data = self.rf_rest.handle_response(test_rsp, cmd='get_information') + assert data == file_data + + def test_request_login_connect_failed(self): + login_data = { "UserName": self.rf_rest.username, "Password": self.rf_rest.password } + self.rf_rest.session.request = mock.Mock(side_effect=SelfServerException('Login to BMC failed: Can\'t connect to')) + with pytest.raises(SelfServerException) as excinfo: + self.rf_rest.request('POST', self.session_url, headers=self.headers, payload=login_data, cmd='login') + assert excinfo.type == SelfServerException + assert 'Login to BMC failed: Can\'t connect to' in str(excinfo.value) + + def test_request_connect_failed(self): + self.rf_rest.session.request = mock.Mock(side_effect=SelfServerException('BMC did not respond. Validate BMC configuration and retry the command.')) + with pytest.raises(SelfServerException) as excinfo: + self.rf_rest.request('GET', self.manager_url, headers=self.headers) + assert excinfo.type == SelfServerException + assert 'BMC did not respond. Validate BMC configuration and retry the command.' in str(excinfo.value) + + def test_request_value_error(self): + self.rf_rest.session.request = mock.Mock(return_value='Mock return value for value error') + self.rf_rest.handle_response = mock.Mock(side_effect=ValueError()) + with pytest.raises(SelfServerException) as excinfo: + self.rf_rest.request('GET', self.manager_url, headers=self.headers) + assert excinfo.type == SelfServerException + assert 'Received wrong format response:' in str(excinfo.value) + + def test_request_login_success(self): + login_data = json.dumps({ "UserName": self.rf_rest.username, "Password": self.rf_rest.password }) + with open("%s/login_rsp.json" % DATA_DIR,'r') as load_f: + response = json.load(load_f) + self.rf_rest.session.request = mock.Mock(return_value=None) + self.rf_rest.handle_response = mock.Mock(return_value=response) + data = self.rf_rest.request('POST', self.session_url, headers=self.headers, payload=login_data, cmd='login') + assert self.rf_rest.session.request + assert data == response + + def test_login_success(self): + with open("%s/login_rsp.json" % DATA_DIR,'r') as load_f: + login_rsp = json.load(load_f) + self.rf_rest.request = mock.Mock(return_value=login_rsp) + assert self.rf_rest.login() == None + + def test_login_not_respond(self): + self.rf_rest.request = mock.Mock(side_effect=SelfServerException('BMC did not respond. Validate BMC configuration and retry the command.')) + with pytest.raises(SelfServerException) as excinfo: + self.rf_rest.login() + assert excinfo.type == SelfServerException + assert 'BMC did not respond. Validate BMC configuration and retry the command.' in str(excinfo.value) + + def test_login_value_error(self): + self.rf_rest.request = mock.Mock(side_effect=SelfServerException('Received wrong format response: xxxxxx')) + with pytest.raises(SelfServerException) as excinfo: + self.rf_rest.login() + assert excinfo.type == SelfServerException + assert 'Received wrong format response:' in str(excinfo.value) + + def test__get_members(self): + resp_data = {"Members": [ {"@odata.id": self.manager_url + "/BMC"} ] } + self.rf_rest.request = mock.Mock(return_value=resp_data) + members = self.rf_rest._get_members(self.manager_url) + assert members == [ {"@odata.id": self.manager_url + "/BMC"} ] + + def test__get_members_keyerror(self): + self.rf_rest.request = mock.Mock(return_value={"key": "value"}) + with pytest.raises(SelfServerException) as excinfo: + members = self.rf_rest._get_members(self.manager_url) + assert excinfo.type == SelfServerException + assert 'Get KeyError' in str(excinfo.value) + + def test_get_bmc_state(self): + self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.manager_url + "/BMC"} ]) + with open("%s/manager_rsp.json" % DATA_DIR,'r') as load_f: + rsp = json.load(load_f) + self.rf_rest.request = mock.Mock(return_value=rsp) + assert self.rf_rest.get_bmc_state() == "On" + + def test_get_bmc_state_keyerror(self): + self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.manager_url + "/BMC"} ]) + self.rf_rest.request = mock.Mock(return_value={"powerState": "Off"}) + with pytest.raises(SelfServerException) as excinfo: + resp_data = self.rf_rest.get_bmc_state() + assert excinfo.type == SelfServerException + assert 'Get KeyError' in str(excinfo.value) + + def test_get_chassis_power_state(self): + self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.chassis_url + '/MotherBoard'} ]) + with open("%s/chassis_rsp.json" % DATA_DIR,'r') as load_f: + rsp = json.load(load_f) + self.rf_rest.request = mock.Mock(return_value=rsp) + assert self.rf_rest.get_chassis_power_state() == 'On' + + def test_get_chassis_power_state_keyerror(self): + self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.chassis_url + '/MotherBoard'} ]) + self.rf_rest.request = mock.Mock(return_value={"Powerstate": "On"}) + with pytest.raises(SelfServerException) as excinfo: + resp_data = self.rf_rest.get_chassis_power_state() + assert excinfo.type == SelfServerException + assert 'Get KeyError' in str(excinfo.value) + + def test_get_systems_power_state(self): + self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.systems_url + '/Computer'} ]) + with open("%s/systems_rsp.json" % DATA_DIR,'r') as load_f: + rsp = json.load(load_f) + self.rf_rest.request = mock.Mock(return_value=rsp) + assert self.rf_rest.get_systems_power_state() == 'On' + + def test_get_systems_power_state_keyerror(self): + self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.systems_url + '/Computer'} ]) + self.rf_rest.request = mock.Mock(return_value={"powerstate": "On"}) + with pytest.raises(SelfServerException) as excinfo: + self.rf_rest.get_systems_power_state() + assert excinfo.type == SelfServerException + assert 'Get KeyError' in str(excinfo.value) + + def test__get_bmc_actions(self): + self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.manager_url + '/BMC'} ]) + with open("%s/manager_rsp.json" % DATA_DIR,'r') as load_f: + rsp = json.load(load_f) + with open("%s/bmc_action_rsp.json" % DATA_DIR,'r') as load_f: + actioninfo = json.load(load_f) + self.rf_rest.request = mock.Mock(side_effect=[rsp, actioninfo]) + reset_string = '#Manager.Reset' + assert self.rf_rest._get_bmc_actions() == (rsp['Actions'][reset_string]['target'], actioninfo['Parameters'][0]['AllowableValues']) + + def test__get_bmc_actions_v123(self): + self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.manager_url + '/BMC'} ]) + with open("%s/manager_rsp_v123.json" % DATA_DIR,'r') as load_f: + rsp = json.load(load_f) + self.rf_rest.request = mock.Mock(return_value=rsp) + reset_string = '#Manager.Reset' + assert self.rf_rest._get_bmc_actions() == (rsp['Actions'][reset_string]['target'], rsp['Actions'][reset_string]['ResetType@Redfish.AllowableValues']) + + def test__get_bmc_actions_keyerror(self): + self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.manager_url + '/BMC'} ]) + with open("%s/manager_rsp.json" % DATA_DIR,'r') as load_f: + rsp = json.load(load_f) + self.rf_rest.request = mock.Mock(return_value=rsp) + with pytest.raises(SelfServerException) as excinfo: + self.rf_rest._get_bmc_actions() + assert excinfo.type == SelfServerException + assert 'Get KeyError' in str(excinfo.value) + + def test_reboot_bmc(self): + with open("%s/manager_rsp.json" % DATA_DIR,'r') as load_f: + rsp = json.load(load_f) + self.rf_rest._get_bmc_actions = mock.Mock(return_value=(rsp['Actions']['#Manager.Reset']['target'], ['ForceRestart'])) + self.rf_rest.request = mock.Mock(return_value=None) + assert self.rf_rest.reboot_bmc() == None + assert self.rf_rest.request + + def test_reboot_bmc_unsupported(self): + self.rf_rest._get_bmc_actions = mock.Mock(return_value=(self.manager_url + '/BMC/Reset', ['forcerestart'])) + with pytest.raises(SelfClientException) as excinfo: + self.rf_rest.reboot_bmc() + assert excinfo.type == SelfClientException + assert 'Unsupported option:' in str(excinfo.value) + + def test__get_power_actions(self): + self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.systems_url + '/Computer'} ]) + with open("%s/systems_rsp.json" % DATA_DIR,'r') as load_f: + rsp = json.load(load_f) + with open("%s/system_action_rsp.json" % DATA_DIR,'r') as load_f: + actioninfo = json.load(load_f) + self.rf_rest.request = mock.Mock(side_effect=[rsp, actioninfo]) + reset_string = '#ComputerSystem.Reset' + assert self.rf_rest._get_power_actions() == (rsp['Actions'][reset_string]['target'], actioninfo['Parameters'][0]['AllowableValues']) + + def test__get_power_actions_v123(self): + self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.systems_url + '/Computer'} ]) + with open("%s/systems_rsp_v123.json" % DATA_DIR,'r') as load_f: + rsp = json.load(load_f) + self.rf_rest.request = mock.Mock(return_value=rsp) + reset_string = '#ComputerSystem.Reset' + assert self.rf_rest._get_power_actions() == (rsp['Actions'][reset_string]['target'], rsp['Actions'][reset_string]['ResetType@Redfish.AllowableValues']) + + def test__get_power_actions_keyerror(self): + self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.systems_url + '/Computer'} ]) + with open("%s/systems_rsp.json" % DATA_DIR,'r') as load_f: + rsp = json.load(load_f) + self.rf_rest.request = mock.Mock(return_value=rsp) + with pytest.raises(SelfServerException) as excinfo: + self.rf_rest._get_power_actions() + assert excinfo.type == SelfServerException + assert 'Get KeyError' in str(excinfo.value) + + def test_set_power_state(self): + with open("%s/systems_rsp.json" % DATA_DIR,'r') as load_f: + rsp = json.load(load_f) + with open("%s/system_action_rsp.json" % DATA_DIR,'r') as load_f: + actioninfo = json.load(load_f) + reset_string = '#ComputerSystem.Reset' + self.rf_rest._get_power_actions = mock.Mock(return_value=(rsp['Actions'][reset_string]['target'], actioninfo['Parameters'][0]['AllowableValues'])) + self.rf_rest.request = mock.Mock(return_value=None) + assert self.rf_rest.set_power_state('on') == None + assert self.rf_rest.request + + def test_set_power_state_unsupported(self): + self.rf_rest._get_power_actions = mock.Mock(return_value=(self.systems_url + '/Computer/Reset', ['ForceRestart', 'ForceOff'])) + with pytest.raises(SelfClientException) as excinfo: + self.rf_rest.set_power_state('on') + assert excinfo.type == SelfClientException + assert 'Unsupported option:' in str(excinfo.value) + + def test_get_boot_state(self): + self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.systems_url + '/Computer'} ]) + with open("%s/systems_rsp.json" % DATA_DIR,'r') as load_f: + rsp = json.load(load_f) + self.rf_rest.request = mock.Mock(return_value=rsp) + assert self.rf_rest.get_boot_state() == "boot override inactive" + rsp['Boot']['BootSourceOverrideTarget'] = 'Pxe' + self.rf_rest.request = mock.Mock(return_value=rsp) + assert self.rf_rest.get_boot_state() == 'Network' + rsp['Boot']['BootSourceOverrideEnabled'] = 'Disabled' + self.rf_rest.request = mock.Mock(return_value=rsp) + assert self.rf_rest.get_boot_state() == "boot override inactive" + + def test_get_boot_state_keyerror(self): + self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.systems_url + '/Computer'} ]) + with open("%s/systems_rsp.json" % DATA_DIR,'r') as load_f: + rsp = json.load(load_f) + del rsp['Boot']['BootSourceOverrideEnabled'] + self.rf_rest.request = mock.Mock(return_value=rsp) + with pytest.raises(SelfServerException) as excinfo: + self.rf_rest.get_boot_state() + assert excinfo.type == SelfServerException + assert 'Get KeyError' in str(excinfo.value) + + def test__get_boot_actions(self): + self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.systems_url + '/Computer'} ]) + with open("%s/systems_rsp.json" % DATA_DIR,'r') as load_f: + rsp = json.load(load_f) + self.rf_rest.request = mock.Mock(return_value=rsp) + assert self.rf_rest._get_boot_actions() == (self.systems_url + '/Computer', rsp['Boot']['BootSourceOverrideTarget@Redfish.AllowableValues']) + + def test__get_boot_actions_keyerror(self): + self.rf_rest._get_members = mock.Mock(return_value=[ {"@odata.id": self.systems_url + '/Computer'} ]) + with open("%s/systems_rsp.json" % DATA_DIR,'r') as load_f: + rsp = json.load(load_f) + del rsp['Boot']['BootSourceOverrideTarget@Redfish.AllowableValues'] + self.rf_rest.request = mock.Mock(return_value=rsp) + with pytest.raises(SelfServerException) as excinfo: + self.rf_rest._get_boot_actions() + assert excinfo.type == SelfServerException + assert 'Get KeyError' in str(excinfo.value) + + def test_set_boot_state(self): + with open("%s/systems_rsp.json" % DATA_DIR,'r') as load_f: + rsp = json.load(load_f) + self.rf_rest._get_boot_actions = mock.Mock(return_value=(self.systems_url + '/Computer', rsp['Boot']['BootSourceOverrideTarget@Redfish.AllowableValues'])) + self.rf_rest.request = mock.Mock(return_value=None) + assert self.rf_rest.set_boot_state(False, 'def') == None + assert self.rf_rest.request + assert self.rf_rest.set_boot_state(True, 'cd') == None + assert self.rf_rest.request + + def test_set_boot_state_unsupported(self): + allow_values = ['cd','def'] + self.rf_rest._get_boot_actions = mock.Mock(return_value=(self.systems_url + '/Computer', allow_values)) + with pytest.raises(SelfClientException) as excinfo: + self.rf_rest.set_boot_state(False, 'hd') + assert excinfo.type == SelfClientException + assert 'Unsupported option:' in str(excinfo.value) + +def test_init_no_bmcip(): + nodeinfo_dict = {'bmc': 'testbmc', 'username': 'username', 'password': 'password'} + rf_rest_new = rf.RedfishRest(name='testnode', nodeinfo=nodeinfo_dict, messager=Messager(), + debugmode=True, verbose=False) + + assert rf_rest_new.bmcip == 'testnode' diff --git a/xCAT-openbmc-py/lib/python/agent/xcatagent/base.py b/xCAT-openbmc-py/lib/python/agent/xcatagent/base.py index ca9521513..fd9a5bb6f 100644 --- a/xCAT-openbmc-py/lib/python/agent/xcatagent/base.py +++ b/xCAT-openbmc-py/lib/python/agent/xcatagent/base.py @@ -2,7 +2,8 @@ from common import utils import gevent from gevent.pool import Pool -MODULE_MAP = {"openbmc": "OpenBMCManager"} +MODULE_MAP = {"openbmc": "OpenBMCManager", + "redfish": "RedfishManager"} class BaseManager(object): def __init__(self, messager, cwd): diff --git a/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py b/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py index 080ddef5e..de8df2484 100644 --- a/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py +++ b/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py @@ -14,13 +14,13 @@ from docopt import docopt,DocoptExit from common import utils from common import exceptions as xcat_exception -from hwctl.executor.openbmc_beacon import OpenBMCBeaconTask -from hwctl.executor.openbmc_setboot import OpenBMCBootTask -from hwctl.executor.openbmc_flash import OpenBMCFlashTask -from hwctl.executor.openbmc_inventory import OpenBMCInventoryTask -from hwctl.executor.openbmc_power import OpenBMCPowerTask -from hwctl.executor.openbmc_sensor import OpenBMCSensorTask -from hwctl.executor.openbmc_eventlog import OpenBMCEventlogTask +from hwctl.openbmc.openbmc_beacon import OpenBMCBeaconTask +from hwctl.openbmc.openbmc_setboot import OpenBMCBootTask +from hwctl.openbmc.openbmc_flash import OpenBMCFlashTask +from hwctl.openbmc.openbmc_inventory import OpenBMCInventoryTask +from hwctl.openbmc.openbmc_power import OpenBMCPowerTask +from hwctl.openbmc.openbmc_sensor import OpenBMCSensorTask +from hwctl.openbmc.openbmc_eventlog import OpenBMCEventlogTask from hwctl.beacon import DefaultBeaconManager from hwctl.setboot import DefaultBootManager from hwctl.flash import DefaultFlashManager @@ -315,7 +315,7 @@ class OpenBMCManager(base.BaseManager): def rspconfig(self, nodesinfo, args): - from hwctl.executor.openbmc_bmcconfig import OpenBMCBmcConfigTask + from hwctl.openbmc.openbmc_bmcconfig import OpenBMCBmcConfigTask try: opts=docopt(RSPCONFIG_USAGE, argv=args) diff --git a/xCAT-openbmc-py/lib/python/agent/xcatagent/redfish.py b/xCAT-openbmc-py/lib/python/agent/xcatagent/redfish.py new file mode 100644 index 000000000..1d66178ab --- /dev/null +++ b/xCAT-openbmc-py/lib/python/agent/xcatagent/redfish.py @@ -0,0 +1,129 @@ +#!/usr/bin/env python +############################################################################### +# IBM(c) 2018 EPL license http://www.eclipse.org/legal/epl-v10.html +############################################################################### +# -*- coding: utf-8 -*- +# + +import os +import gevent +import re +import sys +from docopt import docopt,DocoptExit + +from common import utils +from common import exceptions as xcat_exception +from hwctl.redfish.redfish_power import RedfishPowerTask +from hwctl.redfish.redfish_setboot import RedfishBootTask +from hwctl.power import DefaultPowerManager +from hwctl.setboot import DefaultBootManager + +from xcatagent import base +import logging +logger = logging.getLogger('xcatagent') +try: + if not logger.handlers: + utils.enableSyslog('xcat.agent') +except: + pass + +DEBUGMODE = False +VERBOSE = False + +# global variables of rpower +POWER_REBOOT_OPTIONS = ('boot', 'reset') +POWER_SET_OPTIONS = ('on', 'off', 'bmcreboot') +POWER_GET_OPTIONS = ('bmcstate', 'state', 'stat', 'status') + +# global variables of rsetboot +SETBOOT_GET_OPTIONS = ('stat', '') +SETBOOT_SET_OPTIONS = ('cd', 'def', 'default', 'floppy', 'hd', 'net', 'setup') + +class RedfishManager(base.BaseManager): + def __init__(self, messager, cwd, nodes=None, envs=None): + super(RedfishManager, self).__init__(messager, cwd) + self.nodes = nodes + self.debugmode = (envs and envs.get('debugmode')) or None + #TODO, remove the global variable DEBUGMODE + global DEBUGMODE + DEBUGMODE = envs['debugmode'] + + if self.debugmode: + logger.setLevel(logging.DEBUG) + + def rpower(self, nodesinfo, args): + + # 1, parse args + rpower_usage = """ + Usage: + rpower [-V|--verbose] [boot|bmcreboot|bmcstate|off|on|reset|stat|state|status] + + Options: + -V --verbose rpower verbose mode. + """ + + try: + opts=docopt(rpower_usage, argv=args) + + self.verbose=opts.pop('--verbose') + action=[k for k,v in opts.items() if v][0] + except Exception as e: + # It will not be here as perl has validation for args + self.messager.error("Failed to parse arguments for rpower: %s" % args) + return + + # 2, validate the args + if action not in (POWER_GET_OPTIONS + POWER_SET_OPTIONS + POWER_REBOOT_OPTIONS): + self.messager.error("Not supported subcommand for rpower: %s" % action) + return + + # 3, run the subcommands + runner = RedfishPowerTask(nodesinfo, callback=self.messager, debugmode=self.debugmode, verbose=self.verbose) + if action == 'bmcstate': + DefaultPowerManager().get_bmc_state(runner) + elif action == 'bmcreboot': + DefaultPowerManager().reboot_bmc(runner) + elif action in POWER_GET_OPTIONS: + DefaultPowerManager().get_power_state(runner) + elif action in POWER_REBOOT_OPTIONS: + DefaultPowerManager().reboot(runner, optype=action) + else: + DefaultPowerManager().set_power_state(runner, power_state=action) + + + def rsetboot(self, nodesinfo, args): + + # 1, parse args + if not args: + args = ['stat'] + + rsetboot_usage = """ + Usage: + rsetboot [-V|--verbose] [cd|def|default|floppy||hd|net|stat|setup] [-p] + + Options: + -V --verbose rsetboot verbose mode. + -p persistant boot source. + """ + + try: + opts = docopt(rsetboot_usage, argv=args) + + self.verbose = opts.pop('--verbose') + action_type = opts.pop('-p') + action = [k for k,v in opts.items() if v][0] + except Exception as e: + self.messager.error("Failed to parse arguments for rsetboot: %s" % args) + return + + # 2, validate the args + if action not in (SETBOOT_GET_OPTIONS + SETBOOT_SET_OPTIONS): + self.messager.error("Not supported subcommand for rsetboot: %s" % action) + return + + # 3, run the subcommands + runner = RedfishBootTask(nodesinfo, callback=self.messager, debugmode=self.debugmode, verbose=self.verbose) + if action in SETBOOT_GET_OPTIONS: + DefaultBootManager().get_boot_state(runner) + else: + DefaultBootManager().set_boot_state(runner, setboot_state=action, persistant=action_type) diff --git a/xCAT-openbmc-py/lib/python/agent/xcatagent/server.py b/xCAT-openbmc-py/lib/python/agent/xcatagent/server.py index 85a92dddd..5b33a880a 100644 --- a/xCAT-openbmc-py/lib/python/agent/xcatagent/server.py +++ b/xCAT-openbmc-py/lib/python/agent/xcatagent/server.py @@ -25,7 +25,7 @@ class XCATMessager(utils.Messager): def _send(self, d): buf = json.dumps(d) self.sem.acquire() - self.sock.sendall(utils.int2bytes(len(buf)) + buf) + self.sock.sendall(utils.int2bytes(len(buf)) + buf.encode('utf-8')) self.sem.release() def info(self, msg): @@ -101,7 +101,7 @@ class Server(object): new_args=[] if req['args']: for a in req['args']: - new_args.append(a.encode('utf-8')) + new_args.append(str(a)) # call the function in the specified manager func(req['nodeinfo'], new_args) # after the method returns, the request should be handled diff --git a/xCAT-openbmc-py/xCAT-openbmc-py.spec b/xCAT-openbmc-py/xCAT-openbmc-py.spec index e40044c0e..36f9342e9 100644 --- a/xCAT-openbmc-py/xCAT-openbmc-py.spec +++ b/xCAT-openbmc-py/xCAT-openbmc-py.spec @@ -36,12 +36,14 @@ install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/xcatagent install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/common install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl -install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl/executor +install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl/openbmc +install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl/redfish install -m755 lib/python/agent/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent install -m644 lib/python/agent/xcatagent/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/xcatagent install -m644 lib/python/agent/common/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/common install -m644 lib/python/agent/hwctl/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl -install -m644 lib/python/agent/hwctl/executor/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl/executor +install -m644 lib/python/agent/hwctl/openbmc/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl/openbmc/ +install -m644 lib/python/agent/hwctl/redfish/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl/redfish/ %ifnos linux rm -rf $RPM_BUILD_ROOT/%{prefix}/lib/python/agent diff --git a/xCAT-openbmc-py/xCAT-openbmc-py3.build b/xCAT-openbmc-py/xCAT-openbmc-py3.build new file mode 100644 index 000000000..1235030e3 --- /dev/null +++ b/xCAT-openbmc-py/xCAT-openbmc-py3.build @@ -0,0 +1,68 @@ +%undefine __brp_mangle_shebangs +Summary: xCAT openbmc python3 +Name: xCAT-openbmc-py3 +#Version: %{?version:%{version}}%{!?version:%(cat Version)} +Version: 2.14.6 +Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")} +Epoch: 1 +License: EPL +Group: Applications/System +Source: xCAT-openbmc-py-%{version}.tar.gz +Packager: IBM Corp. +Vendor: IBM Corp. +Distribution: %{?_distribution:%{_distribution}}%{!?_distribution:%{_vendor}} +Prefix: /opt/xcat +BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root + +%ifnos linux +AutoReqProv: no +%endif + +BuildArch: noarch +Requires: xCAT-server +Requires: python3-gevent >= 1.2.2-2 +Requires: python3-greenlet >= 0.4.13-2 +Requires: python3-paramiko >= 2.0.0 +Requires: python3-docopt python3-requests python3-scp + +%description +xCAT-openbmc-py3 provides openbmc related functions python3 based. + +%prep +%setup -q -n xCAT-openbmc-py +%build + +%install +rm -rf $RPM_BUILD_ROOT +install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent +install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/xcatagent +install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/common +install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl +install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl/openbmc +install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl/redfish +install -m755 lib/python/agent/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent +install -m644 lib/python/agent/xcatagent/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/xcatagent +install -m644 lib/python/agent/common/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/common +install -m644 lib/python/agent/hwctl/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl +install -m644 lib/python/agent/hwctl/openbmc/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl/openbmc/ +install -m644 lib/python/agent/hwctl/redfish/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/hwctl/redfish/ + +%ifnos linux +rm -rf $RPM_BUILD_ROOT/%{prefix}/lib/python/agent +%endif + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root) +%{prefix} + +%changelog + +%pre + +%post + +%preun + diff --git a/xCAT-probe/xCAT-probe.spec b/xCAT-probe/xCAT-probe.spec index 5c0c463b2..eeadb577a 100644 --- a/xCAT-probe/xCAT-probe.spec +++ b/xCAT-probe/xCAT-probe.spec @@ -11,6 +11,7 @@ Vendor: IBM Corp. Distribution: %{?_distribution:%{_distribution}}%{!?_distribution:%{_vendor}} Prefix: /opt/xcat BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root +Requires: xCAT-client %ifos linux BuildArch: noarch diff --git a/xCAT-server/lib/perl/xCAT/AGENT.pm b/xCAT-server/lib/perl/xCAT/AGENT.pm index aee201cbe..c44ea71d7 100644 --- a/xCAT-server/lib/perl/xCAT/AGENT.pm +++ b/xCAT-server/lib/perl/xCAT/AGENT.pm @@ -33,6 +33,77 @@ my %module_type = ( "redfish" => "Redfish", ); +#------------------------------------------------------- + +=head3 parse_node_info + + Parse the node information: bmc, bmcip, username, password + +=cut + +#------------------------------------------------------- +sub parse_node_info { + my $noderange = shift; + my $module = shift; + my $node_info_ref = shift; + my $callback = shift; + my $rst = 0; + + my $passwd_table = xCAT::Table->new('passwd'); + my $passwd_hash = $passwd_table->getAttribs({ 'key' => $module }, qw(username password)); + + my $openbmc_table = xCAT::Table->new('openbmc'); + my $openbmc_hash = $openbmc_table->getNodesAttribs(\@$noderange, ['bmc', 'username', 'password']); + + foreach my $node (@$noderange) { + if (defined($openbmc_hash->{$node}->[0])) { + if ($openbmc_hash->{$node}->[0]->{'bmc'}) { + $node_info_ref->{$node}->{bmc} = $openbmc_hash->{$node}->[0]->{'bmc'}; + $node_info_ref->{$node}->{bmcip} = xCAT::NetworkUtils::getNodeIPaddress($openbmc_hash->{$node}->[0]->{'bmc'}); + } + unless($node_info_ref->{$node}->{bmc}) { + xCAT::SvrUtils::sendmsg("Error: Unable to get attribute bmc", $callback, $node); + delete $node_info_ref->{$node}; + $rst = 1; + next; + } + unless($node_info_ref->{$node}->{bmcip}) { + xCAT::SvrUtils::sendmsg("Error: Unable to resolve ip address for bmc: $node_info_ref->{$node}->{bmc}", $callback, $node); + delete $node_info_ref->{$node}; + $rst = 1; + next; + } + if ($openbmc_hash->{$node}->[0]->{'username'}) { + $node_info_ref->{$node}->{username} = $openbmc_hash->{$node}->[0]->{'username'}; + } elsif ($passwd_hash and $passwd_hash->{username}) { + $node_info_ref->{$node}->{username} = $passwd_hash->{username}; + } else { + xCAT::SvrUtils::sendmsg("Error: Unable to get attribute username", $callback, $node); + delete $node_info_ref->{$node}; + $rst = 1; + next; + } + + if ($openbmc_hash->{$node}->[0]->{'password'}) { + $node_info_ref->{$node}->{password} = $openbmc_hash->{$node}->[0]->{'password'}; + } elsif ($passwd_hash and $passwd_hash->{password}) { + $node_info_ref->{$node}->{password} = $passwd_hash->{password}; + } else { + xCAT::SvrUtils::sendmsg("Error: Unable to get attribute password", $callback, $node); + delete $node_info_ref->{$node}; + $rst = 1; + next; + } + } else { + xCAT::SvrUtils::sendmsg("Error: Unable to get information from openbmc table", $callback, $node); + $rst = 1; + next; + } + } + + return $rst; +} + sub acquire_lock { my $ppid = shift; $ppid = shift if (($ppid) && ($ppid =~ /AGENT/)); diff --git a/xCAT-server/lib/perl/xCAT/Goconserver.pm b/xCAT-server/lib/perl/xCAT/Goconserver.pm index ce095116f..0873872b7 100644 --- a/xCAT-server/lib/perl/xCAT/Goconserver.pm +++ b/xCAT-server/lib/perl/xCAT/Goconserver.pm @@ -503,11 +503,13 @@ sub is_goconserver_running { sub switch_goconserver { my $callback = shift; # ignore SN as it is handled by AAsn - if ((-x "/usr/bin/systemctl" || -x "-x /bin/systemctl") && !$isSN) { + if ((-x "/usr/bin/systemctl" || -x "/bin/systemctl") && !$isSN) { my $cmd = "systemctl disable conserver"; - xCAT::Utils->runcmd($cmd, -1); - if ($::RUNCMD_RC != 0) { - xCAT::MsgUtils->warn_message("Failed to execute command: $cmd.", $callback); + if (-x "/usr/sbin/conserver") { + xCAT::Utils->runcmd($cmd, -1); + if ($::RUNCMD_RC != 0) { + xCAT::MsgUtils->warn_message("Failed to execute command: $cmd.", $callback); + } } $cmd = "systemctl enable goconserver"; xCAT::Utils->runcmd($cmd, -1); @@ -535,11 +537,13 @@ sub switch_goconserver { sub switch_conserver { my $callback = shift; # ignore SN as it is handled by AAsn - if ((-x "/usr/bin/systemctl" || -x "-x /bin/systemctl") && !$isSN) { + if ((-x "/usr/bin/systemctl" || -x "/bin/systemctl") && !$isSN) { my $cmd = "systemctl disable goconserver"; - xCAT::Utils->runcmd($cmd, -1); - if ($::RUNCMD_RC != 0) { - xCAT::MsgUtils->warn_message("Failed to execute command: $cmd.", $callback); + if (-x "/usr/bin/goconserver") { + xCAT::Utils->runcmd($cmd, -1); + if ($::RUNCMD_RC != 0) { + xCAT::MsgUtils->warn_message("Failed to execute command: $cmd.", $callback); + } } $cmd = "systemctl enable conserver"; xCAT::Utils->runcmd($cmd, -1); diff --git a/xCAT-server/lib/perl/xCAT/Template.pm b/xCAT-server/lib/perl/xCAT/Template.pm index c43753b27..0da104fa0 100644 --- a/xCAT-server/lib/perl/xCAT/Template.pm +++ b/xCAT-server/lib/perl/xCAT/Template.pm @@ -391,9 +391,10 @@ sub subvars { $inc =~ s/#SHORTNAME#/$shortname/g; $inc =~ s/#GETNODEDOMAIN:([^#]+)#/get_node_domain($1)/eg; $inc =~ s/#GETPRINICMAC:([^#]+)#/xCAT::Utils::parseMacTabEntry(tabdb("mac",$1,"mac"),$1)/eg; + $inc =~ s/#COLONHTTPPORT#/$httpportsuffix/eg; if (($::XCATSITEVALS{xcatdebugmode} eq "1") or ($::XCATSITEVALS{xcatdebugmode} eq "2")) { - $inc =~ s/#UNCOMMENTOENABLEDEBUGPORT#/ /g; + $inc =~ s/#UNCOMMENTOENABLEDEBUGPORT#//g; } if ($::XCATSITEVALS{xcatdebugmode} eq "2") { @@ -428,7 +429,7 @@ sub subvars { $partcontent .= "rm -rf /tmp/partitionfile\n"; # Put the code to decode the partitionfile - $partcontent .= "python -c 'import base64; print base64.b64decode(open(\"/tmp/partscript.enc\",\"rb\").read())' >/tmp/partscript\n"; + $partcontent .= "base64decode/tmp/partscript\n"; $partcontent .= "chmod 755 /tmp/partscript\n"; $partcontent .= "/tmp/partscript\n"; @@ -489,7 +490,7 @@ sub subvars { $partcontent .= "rm -rf /tmp/partitionfile\n"; # Put the code to decode the partitionfile - $partcontent .= "python -c 'import base64; print base64.b64decode(open(\"/tmp/partitionfile.enc\",\"rb\").read())' >/tmp/partitionfile\n"; + $partcontent .= "base64decode/tmp/partitionfile\n"; #replace the #XCA_PARTITION_SCRIPT# $inc =~ s/#XCA_PARTITION_SCRIPT#/$partcontent/; diff --git a/xCAT-server/lib/xcat/plugins/AAsn.pm b/xCAT-server/lib/xcat/plugins/AAsn.pm index 44216a0ad..511b81853 100755 --- a/xCAT-server/lib/xcat/plugins/AAsn.pm +++ b/xCAT-server/lib/xcat/plugins/AAsn.pm @@ -1343,8 +1343,8 @@ sub stop_TFTP { my $distro=xCAT::Utils->osver(); # Check whether the tftp-hpa has been installed, the ubuntu tftpd-hpa configure file is under /etc/default - unless (-x "/usr/sbin/in.tftpd" and (-e "/etc/xinetd.d/tftp" or -e "/etc/default/tftpd-hpa")) { - xCAT::MsgUtils->message("S", "ERROR: The tftpd was not installed, enable the tftp failed."); + unless (-x "/usr/sbin/in.tftpd") { + xCAT::MsgUtils->message("S", "ERROR: The tftpd was not installed, stop the tftp failed."); return 1; } # kill the process of atftp if it's there @@ -1436,103 +1436,6 @@ sub enable_TFTP close(MAPFILE); } - my $distro = xCAT::Utils->osver(); - if ($distro !~ /ubuntu.*/i && $distro !~ /debian.*/i) { - if (!open(FILE, "message("S", "ERROR: Cannot open /etc/xinetd.d/tftp."); - return 1; - } - - # The location of tftp mapfile - my $mapfile = "/etc/tftpmapfile4xcat.conf"; - my $recfg = 0; - my @newcfgfile; - - # Check whether need to reconfigure the /etc/xinetd.d/tftp - while () { - - # check the configuration of 'server_args = -s /xx -m xx' entry - if (/^\s*server_args\s*=(.*)$/) { - my $cfg_args = $1; - - # handle the -s option for the location of tftp root dir - if ($cfg_args =~ /-s\s+([^\s]*)/) { - my $cfgdir = $1; - $cfgdir =~ s/\$//; - $tftpdir =~ s/\$//; - - # make sure the tftp dir should comes from the site.tftpdir - if ($cfgdir ne $tftpdir) { - $recfg = 1; - } - } - - # handle the -m option for the mapfile - if ($cfg_args !~ /-m\s+([^\s]*)/) { - $recfg = 1; - } - if ($recfg) { - - # regenerate the entry for server_args - my $newcfg = $_; - $newcfg =~ s/=.*$/= -s $tftpdir -m $mapfile/; - push @newcfgfile, $newcfg; - } else { - push @newcfgfile, $_; - } - } elsif (/^\s*disable\s*=/ && !/^\s*disable\s*=\s*yes/) { - - # disable the tftp by handling the entry 'disable = yes' - my $newcfg = $_; - $newcfg =~ s/=.*$/= yes/; - push @newcfgfile, $newcfg; - $recfg = 1; - } else { - push @newcfgfile, $_; - } - } - close(FILE); - - # reconfigure the /etc/xinetd.d/tftp - if ($recfg) { - if (!open(FILE, ">/etc/xinetd.d/tftp")) { - xCAT::MsgUtils->message("S", "ERROR: Cannot open /etc/xinetd.d/tftp"); - return 1; - } - print FILE @newcfgfile; - close(FILE); - - #my @output = xCAT::Utils->runcmd("service xinetd status", -1); - #if ($::RUNCMD_RC == 0) {} - my $retcode = xCAT::Utils->checkservicestatus("xinetd"); - if ($retcode == 0) { - my $retcode = xCAT::Utils->restartservice("xinetd"); - if ($retcode != 0) - { - xCAT::MsgUtils->message("S", - "Error on restart xinetd\n"); - - } - #if (grep(/running/, @output)) - #{ - # print ' '; # indent service output to separate it from the xcatd service output - # system "service xinetd stop"; - # if ($? > 0) - # { # error - # xCAT::MsgUtils->message("S", - # "Error on command: service xinetd stop\n"); - # } - # system "service xinetd start"; - # if ($? > 0) - # { # error - # xCAT::MsgUtils->message("S", - # "Error on command: service xinetd start\n"); - # } - #} - } - } - } - # get the version of TCP/IP protocol my $protocols; my $v4only = "-4 "; diff --git a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm index 2ac532e15..ae64092ef 100755 --- a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm +++ b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm @@ -3274,7 +3274,7 @@ sub defls # do we want just the object names or all the attr=val - if ($::opt_l || @::noderange || $::opt_o || $::opt_i || $::opt_template) + if ($::opt_l || @::noderange || $::opt_o || $::opt_i || $::opt_z || $::opt_template) { # assume we want the the details - not just the names @@ -3297,7 +3297,7 @@ sub defls # is -i then just get the ones in the list $::ATTRLIST = $::opt_i; - } elsif (@::noderange || $::opt_o) { + } elsif (@::noderange || $::opt_o || $::opt_z) { # if they gave a list of objects then they must want more # than the object names! @@ -4609,7 +4609,7 @@ sub defmk_usage } $rsp->{data}->[$n] = "$dataobj\n"; $n++; - $rsp->{data}->[$n] = "\nUse the \'-h\' option together with the \'-t\' option to"; + $rsp->{data}->[$n] = "\nUse the \'-h\' option together with the \'-t \' option to"; $n++; $rsp->{data}->[$n] = " get a list of valid attribute names for each object type.\n"; xCAT::MsgUtils->message("I", $rsp, $::callback); @@ -4656,7 +4656,7 @@ sub defch_usage } $rsp->{data}->[$n] = "$dataobj\n"; $n++; - $rsp->{data}->[$n] = "\nUse the \'-h\' option together with the \'-t\' option to"; + $rsp->{data}->[$n] = "\nUse the \'-h\' option together with the \'-t \' option to"; $n++; $rsp->{data}->[$n] = " get a list of valid attribute names for each object type.\n"; xCAT::MsgUtils->message("I", $rsp, $::callback); @@ -4700,7 +4700,7 @@ sub defls_usage } $rsp->{data}->[$n] = "$dataobj\n"; $n++; - $rsp->{data}->[$n] = "\nUse the \'-h\' option together with the \'-t\' option to"; + $rsp->{data}->[$n] = "\nUse the \'-h\' option together with the \'-t \' option to"; $n++; $rsp->{data}->[$n] = " get a list of valid attribute names for each object type.\n"; xCAT::MsgUtils->message("I", $rsp, $::callback); @@ -4741,7 +4741,7 @@ sub defrm_usage } $rsp->{data}->[$n] = "$dataobj\n"; $n++; - $rsp->{data}->[$n] = "\nUse the \'-h\' option together with the \'-t\' option to"; + $rsp->{data}->[$n] = "\nUse the \'-h\' option together with the \'-t \' option to"; $n++; $rsp->{data}->[$n] = " get a list of valid attribute names for each object type.\n"; xCAT::MsgUtils->message("I", $rsp, $::callback); diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index 68011078a..96f6a840b 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -2250,7 +2250,7 @@ sub copycd print $KID $_ . "\n"; } close($KID); - $rc = $?; + $rc = $? >> 8; } else { @@ -2261,22 +2261,18 @@ sub copycd my $copied = 0; my ($percent, $fout); while () { - next if /^cpio:/; + if (/^cpio:/) { + chomp; + $callback->({ data => $_ }); + next; + } $percent = $copied / $numFiles; $fout = sprintf "%0.2f%%", $percent * 100; $callback->({ sinfo => "$fout" }); ++$copied; } - if ($copied == $numFiles) - { - #media copy success - exit(0); - } - else - { - #media copy failed - exit(1); - } + close(PIPE); + exit($? >> 8); } #my $rc = system("cd $path; find . | nice -n 20 cpio -dump $installroot/$distname/$arch"); @@ -2297,7 +2293,7 @@ sub copycd if ($rc != 0) { - $callback->({ error => "Media copy operation failed, status $rc" }); + $callback->({ error => "Media copy operation failed, status $rc", errorcode => [1] }); } else { diff --git a/xCAT-server/lib/xcat/plugins/conserver.pm b/xCAT-server/lib/xcat/plugins/conserver.pm index 220b1b56d..4a6a7b2fc 100644 --- a/xCAT-server/lib/xcat/plugins/conserver.pm +++ b/xCAT-server/lib/xcat/plugins/conserver.pm @@ -212,10 +212,16 @@ sub process_request { } else { my $rsp->{data}->[0] = "makeconservercf is deprecrated as well as conserver, go to makegocons for more information about enabling goconserver."; xCAT::MsgUtils->message("W", $rsp, $cb); + xCAT::Goconserver::switch_conserver($cb) if (-x "/usr/sbin/conserver"); } - xCAT::Goconserver::switch_conserver($cb); } - makeconservercf($req, $cb); + if (-x "/usr/sbin/conserver") { + makeconservercf($req, $cb); + } else { + my $rsp->{data}->[0] = "conserver is not supported or not installed."; + xCAT::MsgUtils->message("E", $rsp, $cb); + return; + } } } diff --git a/xCAT-server/lib/xcat/plugins/ddns.pm b/xCAT-server/lib/xcat/plugins/ddns.pm index 229462157..556a217b8 100644 --- a/xCAT-server/lib/xcat/plugins/ddns.pm +++ b/xCAT-server/lib/xcat/plugins/ddns.pm @@ -785,7 +785,7 @@ sub process_request { "Update Named Conf dir $ctx->{dbdir} $ctx->{zonesdir}"; xCAT::MsgUtils->message("I", $rsp, $callback); } - + $ctx->{forwardmode} = get_forwardmode(); update_namedconf($ctx, $slave); unless ($slave) @@ -935,6 +935,27 @@ sub get_zonesdir { return "$ZonesDir"; } +sub get_forwardmode { + my $forwardmode; + my @entries = xCAT::TableUtils->get_site_attribute("dnsforwardmode"); + my $site_entry = $entries[0]; + if (defined($site_entry)) { + if ($site_entry =~ /^only$|^first$/) { + $forwardmode = $site_entry; + } elsif ($site_entry =~ /^no$/) { + $forwardmode = "" + }else { + my $rsp = {}; + $rsp->{data}->[0] = "forward mode $site_entry is not supported, supported value: only, first, no."; + xCAT::MsgUtils->message("S", "forward mode $site_entry is not supported, supported value: only, first, no."); + xCAT::MsgUtils->message("W", $rsp, $callback); + return; + } + } + return "$forwardmode"; +} + + sub get_conf { my $conf = "/etc/named.conf"; @@ -1114,6 +1135,8 @@ sub update_namedconf { push @newnamed, "\t\t" . $_ . ";\n"; } push @newnamed, "\t};\n"; + } elsif ($ctx->{forwardmode} and $line =~ /forward/) { + push @newnamed, "\tforward " . $ctx->{forwardmode} . ";\n"; } elsif ($ctx->{empty_zones_enable} and $line =~ /empty-zones-enable/) { push @newnamed, "\tempty-zones-enable " . $ctx->{empty_zones_enable} . ";\n"; } elsif ($ctx->{slaves} and $line =~ /allow-transfer \{/) { @@ -1255,6 +1278,10 @@ sub update_namedconf { push @newnamed, "\t};\n"; } + if ($ctx->{forwardmode}){ + push @newnamed, "\tforward " . $ctx->{forwardmode} . ";\n"; + } + if ($ctx->{empty_zones_enable}){ push @newnamed, "\tempty-zones-enable " . $ctx->{empty_zones_enable} . ";\n"; } diff --git a/xCAT-server/lib/xcat/plugins/debian.pm b/xCAT-server/lib/xcat/plugins/debian.pm index 44b434e7f..cc265fabb 100644 --- a/xCAT-server/lib/xcat/plugins/debian.pm +++ b/xCAT-server/lib/xcat/plugins/debian.pm @@ -872,7 +872,7 @@ sub mkinstall { my $kcmdline = "nofb utf8 auto url=http://" . $instserver . ":$httpport/install/autoinst/" . $node; $kcmdline .= " xcatd=" . $instserver; - $kcmdline .= " mirror/http/hostname=" . $instserver; + $kcmdline .= " mirror/http/hostname=" . $instserver.":$httpport"; if ($maxmem) { $kcmdline .= " mem=$maxmem"; } @@ -973,6 +973,7 @@ sub mknetboot my $xcatdport = "3001"; my $xcatiport = "3002"; my $nodestatus = "y"; + my $httpport="80"; my @myself = xCAT::NetworkUtils->determinehostname(); my $myname = $myself[ (scalar @myself) - 1 ]; @@ -1003,6 +1004,12 @@ sub mknetboot { $nodestatus = $ref->{value}; } + ($ref) = $sitetab->getAttribs({ key => 'httpport' }, 'value'); + if ($ref and $ref->{value}) + { + $httpport = $ref->{value}; + } + } my %donetftp = (); my %oents = %{ $ostab->getNodesAttribs(\@nodes, [qw(os arch profile provmethod)]) }; diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index 151133c7f..3ab6cf491 100644 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -610,7 +610,7 @@ sub addnode $hname = $node; } #Default to hostname equal to nodename unless ($mac) { next; } #Skip corrupt format - if ($mac !~ /^[0-9a-fA-F]{2}(-[0-9a-fA-F]{2}){5}$|^[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}$/) + if ($mac !~ /^[0-9a-fA-F]{2}(-[0-9a-fA-F]{2}){5,7}$|^[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5,7}$/) { $callback->( { @@ -764,6 +764,10 @@ sub addnode $hostname = $1 . "-hf" . $count; } } + } elsif (length($mac) == 23) { # 8 bytes of mac address + # Currently the only thing that has 8 bytes is an infiniband + # or infiniband like device, which is type 32 (0x20). + $hardwaretype = 32; } #syslog("local4|err", "Setting $node ($hname|$ip) to " . $mac); @@ -1757,7 +1761,7 @@ sub process_request my $os_ver = $os; $os_ver =~ s/[^0-9.^0-9]//g; if (($os =~ /sles/i && $os_ver >= 11) || - ($os =~ /rhels/i && $os_ver >= 7)) { + ($os =~ /rhels?/i && $os_ver >= 7)) { $dhcpd_key = "DHCPD_INTERFACE"; if ($usingipv6 and $dhcpver eq "dhcpd6") { @@ -1825,7 +1829,10 @@ sub process_request if ($usingipv6) { # sles11.3 and rhels7 has dhcpd and dhcpd6 config in the dhcp file - if ($os =~ /sles/i || $os =~ /rhels7/i) { + my $os_ver = $os; + $os_ver =~ s/[^0-9.^0-9]//g; + if (($os =~ /sles/i && $os_ver >= 11) || + ($os =~ /rhels?/i && $os_ver >= 7)) { if ($missingfiles{dhcpd}) { $callback->({ error => ["The file /etc/sysconfig/dhcpd doesn't exist, check the dhcp server"] }); } @@ -2677,7 +2684,7 @@ sub addnet } } #for cumulus ZTP process - push @netent, " option cumulus-provision-url \"http://$tftp.':' . $httpport/install/postscripts/cumulusztp\";\n"; + push @netent, " option cumulus-provision-url \"http://$tftp:$httpport/install/postscripts/cumulusztp\";\n"; my $ddnserver = $nameservers; $ddnserver =~ s/,.*//; @@ -2717,9 +2724,9 @@ sub addnet # $lstatements = 'if exists gpxe.bus-id { filename = \"\"; } else if exists client-architecture { filename = \"xcat/xnba.kpxe\"; } '.$lstatements; push @netent, " if option user-class-identifier = \"xNBA\" and option client-architecture = 00:00 { #x86, xCAT Network Boot Agent\n"; push @netent, " always-broadcast on;\n"; - push @netent, " filename = \"http://$tftp.':' . $httpport/tftpboot/xcat/xnba/nets/" . $net . "_" . $maskbits . "\";\n"; + push @netent, " filename = \"http://$tftp:$httpport/tftpboot/xcat/xnba/nets/" . $net . "_" . $maskbits . "\";\n"; push @netent, " } else if option user-class-identifier = \"xNBA\" and option client-architecture = 00:09 { #x86, xCAT Network Boot Agent\n"; - push @netent, " filename = \"http://$tftp.':' . $httpport/tftpboot/xcat/xnba/nets/" . $net . "_" . $maskbits . ".uefi\";\n"; + push @netent, " filename = \"http://$tftp:$httpport/tftpboot/xcat/xnba/nets/" . $net . "_" . $maskbits . ".uefi\";\n"; push @netent, " } else if option client-architecture = 00:00 { #x86\n"; push @netent, " filename \"xcat/xnba.kpxe\";\n"; push @netent, " } else if option vendor-class-identifier = \"Etherboot-5.4\" { #x86\n"; @@ -2735,10 +2742,10 @@ sub addnet push @netent, " filename \"elilo.efi\";\n"; push @netent, " } else if option client-architecture = 00:0e { #OPAL-v3\n "; - push @netent, " option conf-file = \"http://$tftp.':' . $httpport/tftpboot/pxelinux.cfg/p/" . $net . "_" . $maskbits . "\";\n"; + push @netent, " option conf-file = \"http://$tftp:$httpport/tftpboot/pxelinux.cfg/p/" . $net . "_" . $maskbits . "\";\n"; push @netent, " } else if substring (option vendor-class-identifier,0,11) = \"onie_vendor\" { #for onie on cumulus switch\n"; - push @netent, " option www-server = \"http://$tftp.':' . $httpport/install/onie/onie-installer\";\n"; + push @netent, " option www-server = \"http://$tftp:$httpport/install/onie/onie-installer\";\n"; push @netent, " } else if substring(filename,0,1) = null { #otherwise, provide yaboot if the client isn't specific\n "; push @netent, " filename \"/yaboot\";\n"; diff --git a/xCAT-server/lib/xcat/plugins/networks.pm b/xCAT-server/lib/xcat/plugins/networks.pm index 6484e24ad..5bd4141c8 100644 --- a/xCAT-server/lib/xcat/plugins/networks.pm +++ b/xCAT-server/lib/xcat/plugins/networks.pm @@ -391,9 +391,11 @@ sub donets foreach (@ip6table) { my @ent = split /\s+/, $_; - if ($ent[0] eq 'fe80::/64' or $ent[0] eq 'unreachable' or $ent[1] eq 'via') { + if ($ent[0] eq 'fe80::/64' or $ent[0] eq 'unreachable' or + $ent[1] eq 'via' or $ent[2] eq 'lo') { - #Do not contemplate link-local, unreachable, or gatewayed networks further + #Do not contemplate link-local, unreachable, gatewayed networks, + # or networks connected to loopback interface #DHCPv6 relay will be manually entered into networks as was the case for IPv4 next; } diff --git a/xCAT-server/lib/xcat/plugins/onie.pm b/xCAT-server/lib/xcat/plugins/onie.pm index 65e49c6f8..2fb8921bc 100644 --- a/xCAT-server/lib/xcat/plugins/onie.pm +++ b/xCAT-server/lib/xcat/plugins/onie.pm @@ -18,6 +18,7 @@ use Getopt::Long; use Expect; use File::Path; use File::Basename; +use File::Copy "cp"; use xCAT::Utils; use xCAT::MsgUtils; @@ -183,11 +184,13 @@ sub copydata { #check if file exists if ( (-e "$defaultpath/$filename") && ($nooverwrite)){ + chmod 0755, "$defaultpath/$filename"; $callback->({ data => "$defaultpath/$filename is already exists, will not overwrite" }); } else { $callback->({ data => "Copying media to $defaultpath" }); mkpath ("$defaultpath"); - system("cp $file $defaultpath"); + cp "$file", "$defaultpath"; + chmod 0755, "$defaultpath/$filename"; $callback->({ data => "Media copy operation successful" }); } diff --git a/xCAT-server/lib/xcat/plugins/openbmc2.pm b/xCAT-server/lib/xcat/plugins/openbmc2.pm index c15bf7ad8..4a73fdcfb 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc2.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc2.pm @@ -141,7 +141,7 @@ sub process_request { } my $noderange = $request->{node}; - my $check = parse_node_info($noderange); + my $check = xCAT::AGENT::parse_node_info($noderange, "openbmc", \%node_info, $callback); if (&refactor_args($request)) { xCAT::MsgUtils->message("E", { data => ["Failed to refactor arguments"] }, $callback); return; @@ -167,8 +167,8 @@ my %rsp_set_valid_values = ( autoreboot => "0|1", bootmode => "regular|safe|setup", powersupplyredundancy => "disabled|enabled", - powerrestorepolicy => "restore|always_on|always_off", - timesyncmethod => "ntp|manual", + powerrestorepolicy => "always_off|always_on|restore", + timesyncmethod => "manual|ntp", ); my @rspconfig_get_options = (@rsp_common_options, qw/ipsrc sshcfg gard dump/); #------------------------------------------------------- @@ -418,74 +418,6 @@ sub parse_args { #------------------------------------------------------- -=head3 parse_node_info - - Parse the node information: bmc, bmcip, username, password - -=cut - -#------------------------------------------------------- -sub parse_node_info { - my $noderange = shift; - my $rst = 0; - - my $passwd_table = xCAT::Table->new('passwd'); - my $passwd_hash = $passwd_table->getAttribs({ 'key' => 'openbmc' }, qw(username password)); - - my $openbmc_table = xCAT::Table->new('openbmc'); - my $openbmc_hash = $openbmc_table->getNodesAttribs(\@$noderange, ['bmc', 'username', 'password']); - - foreach my $node (@$noderange) { - if (defined($openbmc_hash->{$node}->[0])) { - if ($openbmc_hash->{$node}->[0]->{'bmc'}) { - $node_info{$node}{bmc} = $openbmc_hash->{$node}->[0]->{'bmc'}; - $node_info{$node}{bmcip} = xCAT::NetworkUtils::getNodeIPaddress($openbmc_hash->{$node}->[0]->{'bmc'}); - } - unless($node_info{$node}{bmc}) { - xCAT::SvrUtils::sendmsg("Error: Unable to get attribute bmc", $callback, $node); - delete $node_info{$node}; - $rst = 1; - next; - } - unless($node_info{$node}{bmcip}) { - xCAT::SvrUtils::sendmsg("Error: Unable to resolve ip address for bmc: $node_info{$node}{bmc}", $callback, $node); - delete $node_info{$node}; - $rst = 1; - next; - } - if ($openbmc_hash->{$node}->[0]->{'username'}) { - $node_info{$node}{username} = $openbmc_hash->{$node}->[0]->{'username'}; - } elsif ($passwd_hash and $passwd_hash->{username}) { - $node_info{$node}{username} = $passwd_hash->{username}; - } else { - xCAT::SvrUtils::sendmsg("Error: Unable to get attribute username", $callback, $node); - delete $node_info{$node}; - $rst = 1; - next; - } - - if ($openbmc_hash->{$node}->[0]->{'password'}) { - $node_info{$node}{password} = $openbmc_hash->{$node}->[0]->{'password'}; - } elsif ($passwd_hash and $passwd_hash->{password}) { - $node_info{$node}{password} = $passwd_hash->{password}; - } else { - xCAT::SvrUtils::sendmsg("Error: Unable to get attribute password", $callback, $node); - delete $node_info{$node}; - $rst = 1; - next; - } - } else { - xCAT::SvrUtils::sendmsg("Error: Unable to get information from openbmc table", $callback, $node); - $rst = 1; - next; - } - } - - return $rst; -} - -#------------------------------------------------------- - =head3 refactor_args refractor args to be easily dealt by python client diff --git a/xCAT-server/lib/xcat/plugins/redfish.pm b/xCAT-server/lib/xcat/plugins/redfish.pm new file mode 100644 index 000000000..aeb3d1158 --- /dev/null +++ b/xCAT-server/lib/xcat/plugins/redfish.pm @@ -0,0 +1,181 @@ +#!/usr/bin/perl +### IBM(c) 2017 EPL license http://www.eclipse.org/legal/epl-v10.html + +package xCAT_plugin::redfish; + +BEGIN + { + $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat'; + } +use lib "$::XCATROOT/lib/perl"; +use strict; +use warnings "all"; + +use Getopt::Long; +use xCAT::Usage; +use xCAT::SvrUtils; +use xCAT::AGENT; +use Data::Dumper; + +#------------------------------------------------------- + +=head3 handled_commands + + Return list of commands handled by this plugin + +=cut + +#------------------------------------------------------- + +sub handled_commands { + return { + rbeacon => 'nodehm:mgt', + reventlog => 'nodehm:mgt', + rinv => 'nodehm:mgt', + rpower => 'nodehm:mgt', + rsetboot => 'nodehm:mgt', + rspconfig => 'nodehm:mgt', + rvitals => 'nodehm:mgt', + }; +} + +my %node_info = (); +my $callback; +$::VERBOSE = 0; + +#------------------------------------------------------- + +=head3 preprocess_request + + preprocess the command + +=cut + +#------------------------------------------------------- + +sub preprocess_request { + my $request = shift; + $callback = shift; + my $command = $request->{command}->[0]; + my $noderange = $request->{node}; + my $extrargs = $request->{arg}; + my @exargs = ($request->{arg}); + my @requests; + + if (ref($extrargs)) { + @exargs = @$extrargs; + } + + my $usage_string = xCAT::Usage->parseCommand($command, @exargs); + if ($usage_string) { + $callback->({ data => [$usage_string] }); + $request = {}; + return; + } + + my $parse_result = parse_args($command, $extrargs, $noderange); + if (ref($parse_result) eq 'ARRAY') { + my $error_data; + foreach my $node (@$noderange) { + $error_data .= "\n" if ($error_data); + $error_data .= "$node: Error: " . "$parse_result->[1]"; + } + $callback->({ errorcode => [$parse_result->[0]], data => [$error_data] }); + $request = {}; + return; + } + + my $sn = xCAT::ServiceNodeUtils->get_ServiceNode($noderange, "xcat", "MN"); + foreach my $snkey (keys %$sn) { + my $reqcopy = {%$request}; + $reqcopy->{node} = $sn->{$snkey}; + $reqcopy->{'_xcatdest'} = $snkey; + $reqcopy->{_xcatpreprocessed}->[0] = 1; + push @requests, $reqcopy; + } + + return \@requests; +} + +#------------------------------------------------------- + +=head3 process_request + + Process the command + +=cut + +#------------------------------------------------------- + +sub process_request { + my $request = shift; + $callback = shift; + + if (!xCAT::AGENT::exists_python_agent()) { + xCAT::MsgUtils->message("E", { data => ["The xCAT Python agent does not exist. Check if xCAT-openbmc-py package is installed on management node and service nodes."] }, $callback); + return; + } + + my $noderange = $request->{node}; + my $check = xCAT::AGENT::parse_node_info($noderange, "redfish", \%node_info, $callback); + $callback->({ errorcode => [$check] }) if ($check); + return unless(%node_info); + + my $pid = xCAT::AGENT::start_python_agent(); + if (!defined($pid)) { + xCAT::MsgUtils->message("E", { data => ["Failed to start the xCAT Python agent. Check /var/log/xcat/cluster.log for more information."] }, $callback); + return; + } + + xCAT::AGENT::submit_agent_request($pid, $request, "redfish", \%node_info, $callback); + xCAT::AGENT::wait_agent($pid, $callback); +} + +#------------------------------------------------------- + +=head3 parse_args + + Parse the command line options and operands + +=cut + +#------------------------------------------------------- + +sub parse_args { + my $command = shift; + my $extrargs = shift; + my $noderange = shift; + my $subcommand = undef; + + unless (GetOptions( + 'V|verbose' => \$::VERBOSE, + )) { + return ([ 1, "Error parsing arguments." ]); + } + + if (scalar(@ARGV) >= 2 and ($command =~ /rbeacon|rpower|rvitals/)) { + return ([ 1, "Only one option is supported at the same time for $command" ]); + } elsif (scalar(@ARGV) == 0 and $command =~ /rbeacon|rspconfig|rpower/) { + return ([ 1, "No option specified for $command" ]); + } else { + $subcommand = $ARGV[0]; + } + + if ($command eq "rpower") { + unless ($subcommand =~ /^on$|^off$|^reset$|^boot$|^bmcreboot$|^bmcstate$|^status$|^stat$|^state$/) { + return ([ 1, "Unsupported command: $command $subcommand" ]); + } + } elsif ($command eq "rsetboot") { + my $persistant; + GetOptions('p' => \$persistant); + return ([ 1, "Only one option is supported at the same time for $command" ]) if (@ARGV > 1); + $subcommand = "stat" if (!defined($ARGV[0])); + unless ($subcommand =~ /^net$|^hd$|^cd$|^def$|^default$|^stat$|^setup$|^floppy$/) { + return ([ 1, "Unsupported command: $command $subcommand" ]); + } + } else { + return ([ 1, "Unsupported command: $command" ]); + } +} + +1; diff --git a/xCAT-server/lib/xcat/plugins/sles.pm b/xCAT-server/lib/xcat/plugins/sles.pm index 79487429e..7054fb6b3 100644 --- a/xCAT-server/lib/xcat/plugins/sles.pm +++ b/xCAT-server/lib/xcat/plugins/sles.pm @@ -937,14 +937,12 @@ sub mkinstall # trim the "/" in /install/sles11.3/x86_64/ $pkgdir =~ s/\/$//; - if ($pkgdir =~ /^($installroot\/$os\/$arch)$/) { - if ( -d "$pkgdir/2") { - $srcdirs[0] = "$pkgdir/1,$pkgdir/2"; - }else{ - $srcdirs[0] = "$pkgdir/1"; - } - $tmppkgdir = join(",", @srcdirs); + if ( -d "$pkgdir/2") { + $srcdirs[0] = "$pkgdir/1,$pkgdir/2"; + }else{ + $srcdirs[0] = "$pkgdir/1"; } + $tmppkgdir = join(",", @srcdirs); #Call the Template class to do substitution to produce a kickstart file in the autoinst dir my $tmperr; diff --git a/xCAT-server/sbin/xcatconfig b/xCAT-server/sbin/xcatconfig index 8538d16eb..5f8b1c5de 100755 --- a/xCAT-server/sbin/xcatconfig +++ b/xCAT-server/sbin/xcatconfig @@ -1206,7 +1206,7 @@ sub initDB $chtabcmds .= "$::XCATROOT/sbin/chtab key=cleanupxcatpost site.value=no;"; $chtabcmds .= "$::XCATROOT/sbin/chtab key=dhcplease site.value=43200;"; $chtabcmds .= "$::XCATROOT/sbin/chtab key=auditnosyslog site.value=0;"; - $chtabcmds .= "$::XCATROOT/sbin/chtab key=xcatsslversion site.value=TLSv1;"; + $chtabcmds .= "$::XCATROOT/sbin/chtab key=xcatsslversion site.value=;"; $chtabcmds .= "$::XCATROOT/sbin/chtab key=auditskipcmds site.value=ALL;"; #$chtabcmds .= "$::XCATROOT/sbin/chtab key=useflowcontrol site.value=yes;"; # need to fix 4031 @@ -1474,16 +1474,29 @@ sub initDB } # Set default value for site.xcatsslversion when update xcat - $cmds = "XCATBYPASS=Y $::XCATROOT/sbin/tabdump site 2>/dev/null |grep xcatsslversion"; + $cmds = "XCATBYPASS=Y $::XCATROOT/sbin/tabdump site 2>/dev/null | grep xcatsslversion"; xCAT::Utils->runcmd("$cmds", -1); - if ($::RUNCMD_RC != 0) { - - # if site.xcatsslversion was not set, then set the default value TLSv1 - $cmds = "$::XCATROOT/sbin/chtab key=xcatsslversion site.value=TLSv1;"; - xCAT::Utils->runcmd("$cmds", 0); - if ($::RUNCMD_RC != 0) { - xCAT::MsgUtils->message('E', "Could not add default value for site.xcatsslversion."); - } + if ($::RUNCMD_RC == 0) { + xCAT::MsgUtils->message('I', + "__ ___ ___ _ _ ___ _ _ ___"); + xCAT::MsgUtils->message('I', + "\\ \\ / /_\\ | _ \\ \\| |_ _| \\| |/ __| _ +-+-+-+-+-+-+-+"); + xCAT::MsgUtils->message('I', + " \\ \\/\\/ / _ \\| / .` || || .` | (_ | oo\\ |W|A|R|N|I|N|G|"); + xCAT::MsgUtils->message('I', + " \\_/\\_/_/ \\_\\_|_\\_|\\_|___|_|\\_|\\___| (__)\\ +-+-+-+-+-+-+-+"); + xCAT::MsgUtils->message('I', + "+--------------------------------------------------------------+ +-+-+-+-+-+-+-+"); + xCAT::MsgUtils->message('I', + "| The default value of `site.xcatsslversion' was updated. |:|W|A|R|N|I|N|G|"); + xCAT::MsgUtils->message('I', + "| Run `chdef -t site xcatsslversion=' to update your system to |:+-+-+-+-+-+-+-+"); + xCAT::MsgUtils->message('I', + "| the new default value. See `man site' for more details. |:+-+-+-+-+-+-+-+"); + xCAT::MsgUtils->message('I', + "+--------------------------------------------------------------+:|W|A|R|N|I|N|G|"); + xCAT::MsgUtils->message('I', + " ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::+-+-+-+-+-+-+-+"); } } diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index 71aa7bc75..8f31e4f83 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -1548,7 +1548,10 @@ until ($quit) { populate_site_hash(); my %extrasslargs; + if ($::XCATSITEVALS{xcatsslversion}) { $extrasslargs{SSL_version} = $::XCATSITEVALS{xcatsslversion}; } + $extrasslargs{SSL_version} = "SSLv23:!SSLv2:!SSLv3:!TLSv1" unless length $extrasslargs{SSL_version}; + if ($::XCATSITEVALS{xcatsslciphers}) { $extrasslargs{SSL_cipher_list} = $::XCATSITEVALS{xcatsslciphers}; } use Data::Dumper; diff --git a/xCAT-server/share/xcat/ca/openssl.cnf.tmpl b/xCAT-server/share/xcat/ca/openssl.cnf.tmpl index 073b8a4ce..a519d9053 100644 --- a/xCAT-server/share/xcat/ca/openssl.cnf.tmpl +++ b/xCAT-server/share/xcat/ca/openssl.cnf.tmpl @@ -3,10 +3,13 @@ # This is mostly being used for generation of certificate requests. # +# Note that you can include other files from the main configuration +# file using the .include directive. +#.include filename + # This definition stops the following lines choking if HOME isn't # defined. HOME = . -RANDFILE = $ENV::HOME/.rnd # Extra OBJECT IDENTIFIER info: #oid_file = $ENV::HOME/.oid @@ -21,12 +24,17 @@ oid_section = new_oids [ new_oids ] -# We can add new OIDs in here for use by 'ca' and 'req'. +# We can add new OIDs in here for use by 'ca', 'req' and 'ts'. # Add a simple OID like this: # testoid1=1.2.3.4 # Or use config file substitution like this: # testoid2=${testoid1}.5.6 +# Policies used by the TSA examples. +#tsa_policy1 = 1.2.3.4.1 +#tsa_policy2 = 1.2.3.4.5.6 +#tsa_policy3 = 1.2.3.4.5.7 + #################################################################### [ ca ] default_ca = CA_default # The default ca section @@ -37,7 +45,7 @@ default_ca = CA_default # The default ca section dir = ##XCATCADIR## # Where everything is kept certs = $dir/certs # Where the issued certs are kept crl_dir = $dir/crl # Where the issued crl are kept -database = $dir/index # database index file. +database = $dir/index # database index file. #unique_subject = no # Set to 'no' to allow creation of # several ctificates with same subject. new_certs_dir = $dir/certs # default place for new certs. @@ -47,10 +55,9 @@ serial = $dir/serial # The current serial number crlnumber = $dir/crlnumber # the current crl number # must be commented out to leave a V1 CRL crl = $dir/crl.pem # The current CRL -private_key = $dir/private/ca-key.pem # The private key -RANDFILE = $dir/private/.rand # private random number file +private_key = $dir/private/ca-key.pem # The private key -x509_extensions = usr_cert # The extentions to add to the cert +x509_extensions = usr_cert # The extensions to add to the cert # Comment out the following two lines for the "traditional" # (and highly broken) format. @@ -67,7 +74,7 @@ cert_opt = ca_default # Certificate field options default_days = 7300 # how long to certify for default_crl_days= 30 # how long before next CRL -default_md = sha1 # which md to use. +default_md = sha384 # which md to use. preserve = no # keep passed DN ordering # A few difference way of specifying how similar the request should look @@ -102,7 +109,7 @@ default_bits = 2048 default_keyfile = private/ca-key.pem distinguished_name = req_distinguished_name attributes = req_attributes -x509_extensions = v3_ca # The extentions to add to the self signed cert +x509_extensions = v3_ca # The extensions to add to the self signed cert # Passwords for private keys if not present they will be prompted for # input_password = secret @@ -110,13 +117,12 @@ x509_extensions = v3_ca # The extentions to add to the self signed cert # This sets a mask for permitted string types. There are several options. # default: PrintableString, T61String, BMPString. -# pkix : PrintableString, BMPString. -# utf8only: only UTF8Strings. +# pkix : PrintableString, BMPString (PKIX recommendation before 2004) +# utf8only: only UTF8Strings (PKIX recommendation after 2004). # nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings). # MASK:XXXX a literal mask value. -# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings -# so use this option with caution! -string_mask = nombstr +# WARNING: ancient versions of Netscape crash on BMPStrings or UTF8Strings. +string_mask = utf8only # req_extensions = v3_req # The extensions to add to a certificate request @@ -141,7 +147,7 @@ string_mask = nombstr #organizationalUnitName = Organizational Unit Name (eg, section) #organizationalUnitName_default = -commonName = Common Name (eg, YOUR name) +commonName = Common Name (e.g. server FQDN or YOUR name) commonName_max = 64 #emailAddress = Email Address @@ -218,6 +224,9 @@ authorityKeyIdentifier=keyid,issuer #nsCaPolicyUrl #nsSslServerName +# This is required for TSA certificates. +# extendedKeyUsage = critical,timeStamping + [ v3_req ] # Extensions to add to a certificate request @@ -241,13 +250,9 @@ subjectAltName = @alt_names subjectKeyIdentifier=hash -authorityKeyIdentifier=keyid:always,issuer:always +authorityKeyIdentifier=keyid:always,issuer -# This is what PKIX recommends but some broken software chokes on critical -# extensions. -#basicConstraints = critical,CA:true -# So we do this instead. -basicConstraints = CA:true +basicConstraints = critical,CA:true # Key usage: this is typical for a CA certificate. However since it will # prevent it being used as an test self-signed certificate it is best @@ -274,7 +279,7 @@ nsCertType = sslCA, emailCA # Only issuerAltName and authorityKeyIdentifier make any sense in a CRL. # issuerAltName=issuer:copy -authorityKeyIdentifier=keyid:always,issuer:always +authorityKeyIdentifier=keyid:always [ proxy_cert_ext ] # These extensions should be added when creating a proxy certificate @@ -307,7 +312,7 @@ nsComment = "OpenSSL Generated Certificate" # PKIX recommendations harmless if included in all certificates. subjectKeyIdentifier=hash -authorityKeyIdentifier=keyid,issuer:always +authorityKeyIdentifier=keyid,issuer # This stuff is for subjectAltName and issuerAltname. # Import the email address. @@ -328,3 +333,35 @@ authorityKeyIdentifier=keyid,issuer:always # This really needs to be in place for it to be a proxy certificate. proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo + +#################################################################### +[ tsa ] + +default_tsa = tsa_config1 # the default TSA section + +[ tsa_config1 ] + +# These are used by the TSA reply generation only. +dir = ./demoCA # TSA root directory +serial = $dir/tsaserial # The current serial number (mandatory) +crypto_device = builtin # OpenSSL engine to use for signing +signer_cert = $dir/tsacert.pem # The TSA signing certificate + # (optional) +certs = $dir/cacert.pem # Certificate chain to include in reply + # (optional) +signer_key = $dir/private/tsakey.pem # The TSA private key (optional) +signer_digest = sha256 # Signing digest to use. (Optional) +default_policy = tsa_policy1 # Policy if request did not specify it + # (optional) +other_policies = tsa_policy2, tsa_policy3 # acceptable policies (optional) +digests = sha1, sha256, sha384, sha512 # Acceptable message digests (mandatory) +accuracy = secs:1, millisecs:500, microsecs:100 # (optional) +clock_precision_digits = 0 # number of digits after dot. (optional) +ordering = yes # Is ordering defined for timestamps? + # (optional, default: no) +tsa_name = yes # Must the TSA name be included in the reply? + # (optional, default: no) +ess_cert_id_chain = no # Must the ESS cert id chain be included? + # (optional, default: no) +ess_cert_id_alg = sha1 # algorithm to compute certificate + # identifier (optional, default: sha1) diff --git a/xCAT-server/share/xcat/install/rh/compute.rhels8.pkglist b/xCAT-server/share/xcat/install/rh/compute.rhels8.pkglist index 5ecd9605c..3c2a86882 100644 --- a/xCAT-server/share/xcat/install/rh/compute.rhels8.pkglist +++ b/xCAT-server/share/xcat/install/rh/compute.rhels8.pkglist @@ -6,3 +6,4 @@ openssh-server rsync util-linux wget +python3 diff --git a/xCAT-server/share/xcat/install/rh/compute.rhels8.tmpl b/xCAT-server/share/xcat/install/rh/compute.rhels8.tmpl index 55edc48e6..0f25463bf 100644 --- a/xCAT-server/share/xcat/install/rh/compute.rhels8.tmpl +++ b/xCAT-server/share/xcat/install/rh/compute.rhels8.tmpl @@ -1,12 +1,8 @@ -#version=DEVEL -# System authorization information -auth --enableshadow --passalgo=sha512 +#version=RHEL8 # Use text install text # Use network installation %include /tmp/repos -# Not run the Setup Agent on first boot -firstboot --disable # Keyboard layouts keyboard --vckeymap=us --xlayouts='us' # System language @@ -16,8 +12,12 @@ lang en_US.UTF-8 #KICKSTARTNET# # Root password rootpw --iscrypted #CRYPT:passwd:key=system,username=root:password# +# Not run the Setup Agent on first boot +firstboot --disable +# Do not configure the X Window System +skipx # System services -services --disabled="NetworkManager" +#services --enabled="chronyd" # System timezone timezone #TABLE:site:key=timezone:value# --isUtc # Partition clearing information @@ -27,8 +27,6 @@ clearpart --all --initlabel %include /tmp/partitionfile #XCAT_PARTITION_END# -install -skipx # Do not configure any iptables rules firewall --disable selinux --disable diff --git a/xCAT-server/share/xcat/install/rh/service.rhels8.pkglist b/xCAT-server/share/xcat/install/rh/service.rhels8.pkglist new file mode 100644 index 000000000..f5e1af162 --- /dev/null +++ b/xCAT-server/share/xcat/install/rh/service.rhels8.pkglist @@ -0,0 +1,13 @@ +@^minimal-environment +chrony +net-tools +nfs-utils +openssh-server +rsync +util-linux +wget +mariadb-connector-odbc +perl-DBD-MySQL +perl-DBD-Pg +unixODBC +python3 diff --git a/xCAT-server/share/xcat/install/rh/service.rhels8.ppc64le.otherpkgs.pkglist b/xCAT-server/share/xcat/install/rh/service.rhels8.ppc64le.otherpkgs.pkglist new file mode 100644 index 000000000..6d2f563f8 --- /dev/null +++ b/xCAT-server/share/xcat/install/rh/service.rhels8.ppc64le.otherpkgs.pkglist @@ -0,0 +1,2 @@ +xcat/xcat-core/xCATsn +xcat/xcat-dep/rh8/ppc64le/goconserver diff --git a/xCAT-server/share/xcat/install/rh/service.rhels8.tmpl b/xCAT-server/share/xcat/install/rh/service.rhels8.tmpl new file mode 120000 index 000000000..a33592829 --- /dev/null +++ b/xCAT-server/share/xcat/install/rh/service.rhels8.tmpl @@ -0,0 +1 @@ +compute.rhels8.tmpl \ No newline at end of file diff --git a/xCAT-server/share/xcat/install/rh/service.rhels8.x86_64.otherpkgs.pkglist b/xCAT-server/share/xcat/install/rh/service.rhels8.x86_64.otherpkgs.pkglist new file mode 100644 index 000000000..8ab29e03a --- /dev/null +++ b/xCAT-server/share/xcat/install/rh/service.rhels8.x86_64.otherpkgs.pkglist @@ -0,0 +1,2 @@ +xcat/xcat-core/xCATsn +xcat/xcat-dep/rh8/x86_64/goconserver diff --git a/xCAT-server/share/xcat/install/scripts/post.rhels8 b/xCAT-server/share/xcat/install/scripts/post.rhels8 index cdc119e25..d875efbaa 100644 --- a/xCAT-server/share/xcat/install/scripts/post.rhels8 +++ b/xCAT-server/share/xcat/install/scripts/post.rhels8 @@ -18,6 +18,3 @@ do sed -i 's/ONBOOT=no/ONBOOT=yes/' "$i" fi done - -# Dirty hack for RHEL8 Alpha -chkconfig network on diff --git a/xCAT-server/share/xcat/install/scripts/post.xcat.ng b/xCAT-server/share/xcat/install/scripts/post.xcat.ng index 4f206b279..53a2fe878 100644 --- a/xCAT-server/share/xcat/install/scripts/post.xcat.ng +++ b/xCAT-server/share/xcat/install/scripts/post.xcat.ng @@ -8,6 +8,7 @@ export XCATIPORT="#TABLE:site:key=xcatiport:value#" export INSTALLDIR="#TABLE:site:key=installdir:value#" export TFTPDIR="#TABLE:site:key=tftpdir:value#" export XCATDEBUGMODE="#TABLEBLANKOKAY:site:key=xcatdebugmode:value#" +export HTTPPORT="#TABLEBLANKOKAY:site:key=httpport:value#" #INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/scriptlib# @@ -31,6 +32,9 @@ fi if [[ "${TFTPDIR:0:1}" != "/" ]]; then TFTPDIR="/$TFTPDIR" fi +if [ -z "$HTTPPORT" ]; then + HTTPPORT="80" +fi NODESTATUS="$(echo "$NODESTATUS"| tr -d \'\" | tr A-Z a-z)" @@ -82,6 +86,13 @@ else echo "INSTALLDIR=$INSTALLDIR" >>/opt/xcat/xcatinfo fi +grep 'HTTPPORT' /opt/xcat/xcatinfo > /dev/null 2>&1 +if [ $? -eq 0 ]; then + sed -i "s/HTTPPORT=.*/HTTPPORT=$HTTPPORT/" /opt/xcat/xcatinfo +else + echo "HTTPPORT=$HTTPPORT" >> /opt/xcat/xcatinfo +fi + case "$XCATDEBUGMODE" in "1"|"2") msgutil_r "$MASTER_IP" "debug" "/opt/xcat/xcatinfo generated" "/var/log/xcat/xcat.log" "$log_label" @@ -127,7 +138,7 @@ function download_recursive() return 0 } -download_recursive "http://$MASTER_IP$INSTALLDIR/postscripts/" "/xcatpost" 2>/tmp/download.log +download_recursive "http://$MASTER_IP:${HTTPPORT}$INSTALLDIR/postscripts/" "/xcatpost" 2>/tmp/download.log if [ "$?" -ne "0" ] then msgutil_r "$MASTER_IP" "error" "failed to download postscripts from http://$MASTER_IP$INSTALLDIR/postscripts/, check /tmp/download.log on the node, halt ..." "/var/log/xcat/xcat.log" "$log_label" @@ -143,7 +154,7 @@ export NODE="#TABLE:nodelist:THISNODE:node#" msgutil_r "$MASTER_IP" "info" "trying to get mypostscript from $MASTER_IP..." "/var/log/xcat/xcat.log" "$log_label" -curl --fail --retry 20 --max-time 60 "http://$MASTER_IP$TFTPDIR/mypostscripts/mypostscript.$NODE" -o "/xcatpost/mypostscript.$NODE" 2> /tmp/download.log +curl --fail --retry 20 --max-time 60 "http://$MASTER_IP:${HTTPPORT}$TFTPDIR/mypostscripts/mypostscript.$NODE" -o "/xcatpost/mypostscript.$NODE" 2> /tmp/download.log if [ "$?" = "0" ] then case "$XCATDEBUGMODE" in diff --git a/xCAT-server/share/xcat/install/scripts/pre.rh.rhels7 b/xCAT-server/share/xcat/install/scripts/pre.rh.rhels7 index 44f1c87c6..3f9aca9b6 100755 --- a/xCAT-server/share/xcat/install/scripts/pre.rh.rhels7 +++ b/xCAT-server/share/xcat/install/scripts/pre.rh.rhels7 @@ -144,7 +144,63 @@ fi /tmp/foo.py >/foo.log 2>&1 & +base64decode() +{ + h0="0"; h1="1"; h2="2"; h3="3"; h4="4"; h5="5"; h6="6"; h7="7"; + h8="8"; h9="9"; h10="A"; h11="B"; h12="C"; h13="D"; h14="E"; h15="F"; + while : + do + i=0 + while [ "$i" -lt 4 ] + do + read -n 1 c || return + + case "${c}" in + "A") d=0 ;; "B") d=1 ;; "C") d=2 ;; "D") d=3 ;; + "E") d=4 ;; "F") d=5 ;; "G") d=6 ;; "H") d=7 ;; + "I") d=8 ;; "J") d=9 ;; "K") d=10 ;; "L") d=11 ;; + "M") d=12 ;; "N") d=13 ;; "O") d=14 ;; "P") d=15 ;; + "Q") d=16 ;; "R") d=17 ;; "S") d=18 ;; "T") d=19 ;; + "U") d=20 ;; "V") d=21 ;; "W") d=22 ;; "X") d=23 ;; + "Y") d=24 ;; "Z") d=25 ;; "a") d=26 ;; "b") d=27 ;; + "c") d=28 ;; "d") d=29 ;; "e") d=30 ;; "f") d=31 ;; + "g") d=32 ;; "h") d=33 ;; "i") d=34 ;; "j") d=35 ;; + "k") d=36 ;; "l") d=37 ;; "m") d=38 ;; "n") d=39 ;; + "o") d=40 ;; "p") d=41 ;; "q") d=42 ;; "r") d=43 ;; + "s") d=44 ;; "t") d=45 ;; "u") d=46 ;; "v") d=47 ;; + "w") d=48 ;; "x") d=49 ;; "y") d=50 ;; "z") d=51 ;; + "0") d=52 ;; "1") d=53 ;; "2") d=54 ;; "3") d=55 ;; + "4") d=56 ;; "5") d=57 ;; "6") d=58 ;; "7") d=59 ;; + "8") d=60 ;; "9") d=61 ;; "+") d=62 ;; "/") d=63 ;; + "=") d=0 ;; + *) continue ;; + esac + + eval "a${i}=${c}" + eval "b${i}=${d}" + + i=$(( i + 1 )) + done + + o0=$(( ((b0 << 2) | (b1 >> 4)) & 0xff )) + o1=$(( ((b1 << 4) | (b2 >> 2)) & 0xff )) + o2=$(( ((b2 << 6) | b3) & 0xff )) + + [ "${a2}" == "=" ] && + eval "printf \"\\x\${h$(( o0 / 16 ))}\${h$(( o0 % 16 + ))}\"" && + return + [ "${a3}" == "=" ] && + eval "printf \"\\x\${h$(( o0 / 16 ))}\${h$(( o0 % 16 + ))}\\x\${h$(( o1 / 16 ))}\${h$(( o1 % 16 + ))}\"" && + return + eval "printf \"\\x\${h$(( o0 / 16 ))}\${h$(( o0 % 16 + ))}\\x\${h$(( o1 / 16 ))}\${h$(( o1 % 16 + ))}\\x\${h$(( o2 / 16 ))}\${h$(( o2 % 16 ))}\"" + done +} #time to ascertain fstype and PReP/UEFI/legacy #also, find first available block device (sda or vda likely) @@ -178,6 +234,12 @@ if uname -r|grep -q '^3.*el7'; then FSTYPE=xfs EFIFSTYPE=efi fi + +#remove any exiting "xcatvg" VG to avoid fatal error +vgs > /tmp/vgs 2>&1 +vgchange -a n xcatvg +vgremove -f xcatvg + msgutil_r "$MASTER_IP" "info" "Found $instdisk, generate partition file..." "/var/log/xcat/xcat.log" "$log_label" echo "ignoredisk --only-use=$instdisk" >> /tmp/partitionfile if [ `uname -m` = "ppc64" -o `uname -m` = "ppc64le" ]; then @@ -191,8 +253,8 @@ fi echo "part /boot --size 512 --fstype $BOOTFSTYPE --ondisk $instdisk" >> /tmp/partitionfile echo "part swap --recommended --ondisk $instdisk" >> /tmp/partitionfile echo "part pv.01 --size 1 --grow --ondisk $instdisk" >> /tmp/partitionfile -echo "volgroup system pv.01" >> /tmp/partitionfile -echo "logvol / --vgname=system --name=root --size 1 --grow --fstype $FSTYPE" >> /tmp/partitionfile +echo "volgroup xcatvg pv.01" >> /tmp/partitionfile +echo "logvol / --vgname=xcatvg --name=root --size 1 --grow --fstype $FSTYPE" >> /tmp/partitionfile #specify "bootloader" configuration in "/tmp/partitionfile" if there is no user customized partition file BOOTLOADER="bootloader " diff --git a/xCAT-server/share/xcat/install/scripts/pre.rhels8 b/xCAT-server/share/xcat/install/scripts/pre.rhels8 index 92ad09f34..66abd34db 100644 --- a/xCAT-server/share/xcat/install/scripts/pre.rhels8 +++ b/xCAT-server/share/xcat/install/scripts/pre.rhels8 @@ -28,24 +28,24 @@ then fi cat >/tmp/baz.py <<'EOF' -#!/usr/bin/python3 +#!/usr/libexec/platform-python import socket import sys sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect(('#XCATVAR:XCATMASTER#',#TABLE:site:key=xcatiport:value#)) -print sys.argv[1] +print(sys.argv[1]) response = sock.recv(100) -if(response == "ready\n"): - sock.send(sys.argv[1]+"\n") +if(response == b"ready\n"): + sock.send((sys.argv[1]+"\n").encode()) response = sock.recv(100) sock.close() EOF cat >/tmp/foo.py <<'EOF' -#!/usr/bin/python3 +#!/usr/libexec/platform-python import socket import os @@ -56,8 +56,8 @@ sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect(('#XCATVAR:XCATMASTER#',#TABLE:site:key=xcatiport:value#)) response = sock.recv(100) -if(response == "ready\n"): - sock.send("installmonitor\n") +if(response == b"ready\n"): + sock.send("installmonitor\n".encode()) response = sock.recv(100) sock.close() @@ -77,8 +77,8 @@ try: received = newSocket.recv(200) if not received: break - command = re.split('\s+',received) - if(command[0] == "stat"): + command = re.split(b'\s+',received) + if(command[0] == b"stat"): ilog = "" line = "" post = 0 @@ -110,21 +110,21 @@ try: line = "installing " + line if(not line): line = "installing prep" - newSocket.send(line) + newSocket.send(line.encode()) break -#UNCOMMENTOENABLEDEBUGPORT# if(command[0] == "sh"): #DEBUG purposes only, wide open root priv command here. -#UNCOMMENTOENABLEDEBUGPORT# newcommand = "" +#UNCOMMENTOENABLEDEBUGPORT# if(command[0] == b"sh"): #DEBUG purposes only, wide open root priv command here. +#UNCOMMENTOENABLEDEBUGPORT# newcommand = b"" #UNCOMMENTOENABLEDEBUGPORT# for i in command[1:]: -#UNCOMMENTOENABLEDEBUGPORT# newcommand = newcommand + i + " " -#UNCOMMENTOENABLEDEBUGPORT# output = os.popen(newcommand).read() +#UNCOMMENTOENABLEDEBUGPORT# newcommand = newcommand + i + b" " +#UNCOMMENTOENABLEDEBUGPORT# output = os.popen(newcommand.decode('utf-8')).read().encode() #UNCOMMENTOENABLEDEBUGPORT# newSocket.send(output) #UNCOMMENTOENABLEDEBUGPORT# break - if(command[0] == "screendump"): + if(command[0] == b"screendump"): newcommand = "cat /dev/vcs" for i in command[1:]: newcommand = newcommand + i output = os.popen(newcommand).read() - newSocket.send(output) + newSocket.send(output.encode()) break newSocket.close() @@ -148,6 +148,64 @@ esac /tmp/foo.py >/foo.log 2>&1 & +base64decode() +{ + h0="0"; h1="1"; h2="2"; h3="3"; h4="4"; h5="5"; h6="6"; h7="7"; + h8="8"; h9="9"; h10="A"; h11="B"; h12="C"; h13="D"; h14="E"; h15="F"; + + while : + do + i=0 + while [ "$i" -lt 4 ] + do + read -n 1 c || return + + case "${c}" in + "A") d=0 ;; "B") d=1 ;; "C") d=2 ;; "D") d=3 ;; + "E") d=4 ;; "F") d=5 ;; "G") d=6 ;; "H") d=7 ;; + "I") d=8 ;; "J") d=9 ;; "K") d=10 ;; "L") d=11 ;; + "M") d=12 ;; "N") d=13 ;; "O") d=14 ;; "P") d=15 ;; + "Q") d=16 ;; "R") d=17 ;; "S") d=18 ;; "T") d=19 ;; + "U") d=20 ;; "V") d=21 ;; "W") d=22 ;; "X") d=23 ;; + "Y") d=24 ;; "Z") d=25 ;; "a") d=26 ;; "b") d=27 ;; + "c") d=28 ;; "d") d=29 ;; "e") d=30 ;; "f") d=31 ;; + "g") d=32 ;; "h") d=33 ;; "i") d=34 ;; "j") d=35 ;; + "k") d=36 ;; "l") d=37 ;; "m") d=38 ;; "n") d=39 ;; + "o") d=40 ;; "p") d=41 ;; "q") d=42 ;; "r") d=43 ;; + "s") d=44 ;; "t") d=45 ;; "u") d=46 ;; "v") d=47 ;; + "w") d=48 ;; "x") d=49 ;; "y") d=50 ;; "z") d=51 ;; + "0") d=52 ;; "1") d=53 ;; "2") d=54 ;; "3") d=55 ;; + "4") d=56 ;; "5") d=57 ;; "6") d=58 ;; "7") d=59 ;; + "8") d=60 ;; "9") d=61 ;; "+") d=62 ;; "/") d=63 ;; + "=") d=0 ;; + *) continue ;; + esac + + eval "a${i}=${c}" + eval "b${i}=${d}" + + i=$(( i + 1 )) + done + + o0=$(( ((b0 << 2) | (b1 >> 4)) & 0xff )) + o1=$(( ((b1 << 4) | (b2 >> 2)) & 0xff )) + o2=$(( ((b2 << 6) | b3) & 0xff )) + + [ "${a2}" == "=" ] && + eval "printf \"\\x\${h$(( o0 / 16 ))}\${h$(( o0 % 16 + ))}\"" && + return + [ "${a3}" == "=" ] && + eval "printf \"\\x\${h$(( o0 / 16 ))}\${h$(( o0 % 16 + ))}\\x\${h$(( o1 / 16 ))}\${h$(( o1 % 16 + ))}\"" && + return + eval "printf \"\\x\${h$(( o0 / 16 ))}\${h$(( o0 % 16 + ))}\\x\${h$(( o1 / 16 ))}\${h$(( o1 % 16 + ))}\\x\${h$(( o2 / 16 ))}\${h$(( o2 % 16 ))}\"" + done +} + # time to ascertain fstype and PReP/UEFI/legacy # also, find first available block device (sda or vda likely) # TODO: pick a likely non-SAN target if possible @@ -166,6 +224,12 @@ fi BOOTFSTYPE=ext4 FSTYPE=ext4 EFIFSTYPE=efi + +#remove any exiting "xcatvg" VG to avoid fatal error +vgs > /tmp/vgs 2>&1 +vgchange -a n xcatvg +vgremove -f xcatvg + msgutil_r "$MASTER_IP" "info" "Found $instdisk, generate partition file..." "/var/log/xcat/xcat.log" "$log_label" echo "ignoredisk --only-use=$instdisk" >>/tmp/partitionfile case "$(uname -m)" in @@ -181,12 +245,12 @@ fi # TODO: Ondisk detection, /dev/disk/by-id/edd-int13_dev80 for legacy maybe, and no idea about efi. At least maybe blacklist SAN if mptsas/mpt2sas/megaraid_sas seen... echo "part /boot --fstype=$BOOTFSTYPE --asprimary --ondisk=$instdisk --size=512" >>/tmp/partitionfile echo "part pv.000997 --grow --asprimary --ondisk=$instdisk --size=18432" >>/tmp/partitionfile -echo "volgroup system --pesize=4096 pv.000997" >>/tmp/partitionfile -echo "logvol / --fstype=$FSTYPE --name=root --vgname=system --grow --size=4096 --maxsize=8192" >>/tmp/partitionfile -echo "logvol /var --fstype=$FSTYPE --name=var --vgname=system --grow --size=2048 --maxsize=8192" >>/tmp/partitionfile -echo "logvol /tmp --fstype=$FSTYPE --name=tmp --vgname=system --grow --size=1024 --maxsize=4096" >>/tmp/partitionfile -echo "logvol /home --fstype=$FSTYPE --name=home --vgname=system --grow --percent=10 --maxsize=10240" >>/tmp/partitionfile -echo "logvol swap --name=swap --vgname=system --recommended" >>/tmp/partitionfile +echo "volgroup xcatvg --pesize=4096 pv.000997" >>/tmp/partitionfile +echo "logvol / --fstype=$FSTYPE --name=root --vgname=xcatvg --grow --size=4096 --maxsize=20480" >>/tmp/partitionfile +echo "logvol /var --fstype=$FSTYPE --name=var --vgname=xcatvg --grow --size=2048 --maxsize=8192" >>/tmp/partitionfile +echo "logvol /tmp --fstype=$FSTYPE --name=tmp --vgname=xcatvg --grow --size=1024 --maxsize=4096" >>/tmp/partitionfile +echo "logvol /home --fstype=$FSTYPE --name=home --vgname=xcatvg --grow --percent=10 --maxsize=10240" >>/tmp/partitionfile +echo "logvol swap --name=swap --vgname=xcatvg --recommended" >>/tmp/partitionfile # Specify "bootloader" configuration in "/tmp/partitionfile" if there is no user customized partition file BOOTLOADER="bootloader" diff --git a/xCAT-server/share/xcat/install/ubuntu/compute.tmpl b/xCAT-server/share/xcat/install/ubuntu/compute.tmpl index 8bc2f7538..e784e01ac 100644 --- a/xCAT-server/share/xcat/install/ubuntu/compute.tmpl +++ b/xCAT-server/share/xcat/install/ubuntu/compute.tmpl @@ -124,7 +124,7 @@ xserver-xorg xserver-xorg/config/monitor/mode-list \ d-i preseed/early_command string \ { \ echo "Running preseeding early_command Installation script..."; \ - wget http://`cat /tmp/xcatserver`/install/autoinst/#HOSTNAME#.pre; \ + wget http://`cat /tmp/xcatserver`#COLONHTTPPORT#/install/autoinst/#HOSTNAME#.pre; \ chmod u+x #HOSTNAME#.pre; \ ./#HOSTNAME#.pre; \ umount /media || true; \ @@ -135,7 +135,7 @@ d-i preseed/late_command string \ { \ cat /tmp/pre-install.log >> /target/var/log/xcat/xcat.log; \ echo "Running preseeding late_command Installation script..."; \ - wget http://`cat /tmp/xcatserver`/install/autoinst/#HOSTNAME#.post; \ + wget http://`cat /tmp/xcatserver`#COLONHTTPPORT#/install/autoinst/#HOSTNAME#.post; \ chmod u+x #HOSTNAME#.post; \ cp ./#HOSTNAME#.post /target/root/post.script; \ mount -o bind /proc /target/proc -t proc; \ diff --git a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.localdisk b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.localdisk index 93c333e25..7676e73ce 100755 --- a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.localdisk +++ b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.localdisk @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/bash MNTDIR="/sysroot" LOCAL="/.sllocal/localmnt" @@ -68,9 +68,19 @@ xCATCmd () { # $2 is the command ARCH=`uname -m` if [ x$ARCH = x"ppc64" -a x$OS = x"rh" ]; then - echo "\n${2}\n" | /usr/sbin/chroot ${MNTDIR} /usr/bin/openssl s_client -quiet -no_ssl3 $(/usr/sbin/chroot ${MNTDIR} /usr/bin/openssl s_client -help 2>&1 | grep -m 1 -o -- -no_ssl2) -connect ${1} -rand /bin/nice 2>/dev/null + /usr/sbin/chroot ${MNTDIR} /usr/bin/openssl s_client -quiet -no_ssl3 \ + $(/usr/sbin/chroot ${MNTDIR} /usr/bin/openssl s_client -help 2>&1 | + grep -m 1 -o -- -no_ssl2) \ + -connect ${1} -rand /bin/bash 2>/dev/null \ + <<<"${2}" else - echo "\n${2}\n" | LD_LIBRARY_PATH=${MNTDIR}/lib64:${MNTDIR}/usr/lib64 ${MNTDIR}/usr/bin/openssl s_client -quiet -no_ssl3 $(LD_LIBRARY_PATH=${MNTDIR}/lib64:${MNTDIR}/usr/lib64 ${MNTDIR}/usr/bin/openssl s_client -help 2>&1 | grep -m 1 -o -- -no_ssl2) -connect ${1} -rand /bin/nice 2>/dev/null + LD_LIBRARY_PATH=${MNTDIR}/lib64:${MNTDIR}/usr/lib64 \ + ${MNTDIR}/usr/bin/openssl s_client -quiet -no_ssl3 \ + $(LD_LIBRARY_PATH=${MNTDIR}/lib64:${MNTDIR}/usr/lib64 \ + ${MNTDIR}/usr/bin/openssl s_client -help 2>&1 | + grep -m 1 -o -- -no_ssl2) \ + -connect ${1} -rand /bin/bash 2>/dev/null \ + <<<"${2}" fi } diff --git a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite index ac61f1173..fa6549464 100755 --- a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite +++ b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite @@ -128,7 +128,7 @@ GetSyncInfo () { xCATCmd () { # $1 is the xCAT server # $2 is the command - echo "\n${2}\n" | LD_LIBRARY_PATH=${MNTDIR}/lib64:${MNTDIR}/usr/lib64 ${MNTDIR}/usr/bin/openssl s_client -quiet -no_ssl3 $(LD_LIBRARY_PATH=${MNTDIR}/lib64:${MNTDIR}/usr/lib64 ${MNTDIR}/usr/bin/openssl s_client -help 2>&1 | grep -m 1 -o -- -no_ssl2) -connect ${1} -rand /bin/nice 2>/dev/null + LD_LIBRARY_PATH=${MNTDIR}/lib64:${MNTDIR}/usr/lib64 ${MNTDIR}/usr/bin/openssl s_client -quiet -no_ssl3 $(LD_LIBRARY_PATH=${MNTDIR}/lib64:${MNTDIR}/usr/lib64 ${MNTDIR}/usr/bin/openssl s_client -help 2>&1 | grep -m 1 -o -- -no_ssl2) -connect ${1} -rand /bin/bash 2>/dev/null <<<"${2}" } diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64.pkglist b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64.pkglist deleted file mode 120000 index aaf3fcab3..000000000 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64.pkglist +++ /dev/null @@ -1 +0,0 @@ -compute.rhels8.ppc64le.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist index f10a83507..4405d533e 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist @@ -12,6 +12,7 @@ ethtool file gzip hostname +initscripts iputils irqbalance kernel @@ -22,7 +23,6 @@ openssh-clients openssh-server openssl parted -ppc64-utils procps-ng rpm rsync @@ -32,3 +32,5 @@ util-linux vim-minimal xz wget +python3 +NetworkManager diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.pkglist b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.pkglist index 03f7d93ec..3591e44d0 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.pkglist @@ -12,6 +12,7 @@ ethtool file gzip hostname +initscripts iputils irqbalance kernel @@ -30,3 +31,5 @@ util-linux vim-minimal xz wget +python3 +NetworkManager diff --git a/xCAT-server/share/xcat/netboot/rh/genimage b/xCAT-server/share/xcat/netboot/rh/genimage index 0b2e82380..6a1ee4d50 100755 --- a/xCAT-server/share/xcat/netboot/rh/genimage +++ b/xCAT-server/share/xcat/netboot/rh/genimage @@ -358,6 +358,14 @@ if($onlyinitrd){ my $yumcmd = "yum $non_interactive -c /tmp/genimage.$$.yum.conf --installroot=$rootimg_dir/ --disablerepo=* "; + if ($osver =~ /^rhel\D*(\d*)[.\d]*.*$/) { + $majorrel = $1; + if ($majorrel > 7) { + $yumcmd .= "--releasever=" . $majorrel . " "; + $yumcmd .= "--setopt=module_platform_id=platform:el" . $majorrel . " "; + } + } + foreach (0 .. $repnum) { $yumcmd .= "--enablerepo=$osver-$arch-$_ "; } diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64.exlist b/xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.exlist similarity index 100% rename from xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64.exlist rename to xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.exlist diff --git a/xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.otherpkgs.pkglist b/xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.otherpkgs.pkglist new file mode 100644 index 000000000..6d2f563f8 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.otherpkgs.pkglist @@ -0,0 +1,2 @@ +xcat/xcat-core/xCATsn +xcat/xcat-dep/rh8/ppc64le/goconserver diff --git a/xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.pkglist b/xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.pkglist new file mode 100644 index 000000000..de6892304 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.pkglist @@ -0,0 +1,38 @@ +bash +bc +bzip2 +chrony +coreutils +curl +dhcp-client +dracut +dracut-network +e2fsprogs +ethtool +file +gzip +hostname +initscripts +iputils +irqbalance +kernel +lsvpd +net-tools +nfs-utils +openssh-clients +openssh-server +openssl +parted +procps-ng +rpm +rsync +rsyslog +tar +util-linux +vim-minimal +xz +wget +perl-DBD-MySQL +perl-DBD-Pg +python3 +NetworkManager diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64.postinstall b/xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.postinstall similarity index 100% rename from xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64.postinstall rename to xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.postinstall diff --git a/xCAT-server/share/xcat/netboot/rh/service.rhels8.x86_64.exlist b/xCAT-server/share/xcat/netboot/rh/service.rhels8.x86_64.exlist new file mode 120000 index 000000000..fb3077c7a --- /dev/null +++ b/xCAT-server/share/xcat/netboot/rh/service.rhels8.x86_64.exlist @@ -0,0 +1 @@ +compute.rhels8.x86_64.exlist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/rh/service.rhels8.x86_64.otherpkgs.pkglist b/xCAT-server/share/xcat/netboot/rh/service.rhels8.x86_64.otherpkgs.pkglist new file mode 100644 index 000000000..8ab29e03a --- /dev/null +++ b/xCAT-server/share/xcat/netboot/rh/service.rhels8.x86_64.otherpkgs.pkglist @@ -0,0 +1,2 @@ +xcat/xcat-core/xCATsn +xcat/xcat-dep/rh8/x86_64/goconserver diff --git a/xCAT-server/share/xcat/netboot/rh/service.rhels8.x86_64.pkglist b/xCAT-server/share/xcat/netboot/rh/service.rhels8.x86_64.pkglist new file mode 100644 index 000000000..52da27a2e --- /dev/null +++ b/xCAT-server/share/xcat/netboot/rh/service.rhels8.x86_64.pkglist @@ -0,0 +1,37 @@ +bash +bc +bzip2 +chrony +coreutils +curl +dhcp-client +dracut +dracut-network +e2fsprogs +ethtool +file +gzip +hostname +initscripts +iputils +irqbalance +kernel +net-tools +nfs-utils +openssh-clients +openssh-server +openssl +parted +procps-ng +rpm +rsync +rsyslog +tar +util-linux +vim-minimal +xz +wget +perl-DBD-MySQL +perl-DBD-Pg +python3 +NetworkManager diff --git a/xCAT-server/share/xcat/netboot/rh/service.rhels8.x86_64.postinstall b/xCAT-server/share/xcat/netboot/rh/service.rhels8.x86_64.postinstall new file mode 120000 index 000000000..61a624253 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/rh/service.rhels8.x86_64.postinstall @@ -0,0 +1 @@ +compute.rhels8.x86_64.postinstall \ No newline at end of file diff --git a/xCAT-server/share/xcat/tools/go-xcat b/xCAT-server/share/xcat/tools/go-xcat index d2f8e00a2..139d945fd 100755 --- a/xCAT-server/share/xcat/tools/go-xcat +++ b/xCAT-server/share/xcat/tools/go-xcat @@ -2,7 +2,7 @@ # # go-xcat - Install xCAT automatically. # -# Version 1.0.34 +# Version 1.0.36 # # Copyright (C) 2016, 2017, 2018 International Business Machines # Eclipse Public License, Version 1.0 (EPL-1.0) @@ -21,6 +21,8 @@ # 2018-09-28 GONG Jie # - Revised debug log # - xCAT uninstallation +# 2019-03-22 GONG Jie +# - Better debug log when reading repository failed # function usage() @@ -1976,13 +1978,9 @@ do exit_if_bad "$?" "Try \`$0 --help' for more information" GO_XCAT_ACTION="$1" case "$1 $2" in - "completely uninstall") + "completely uninstall"|"smoke test") shift - GO_XCAT_ACTION="away" - ;; - "smoke test") - shift - GO_XCAT_ACTION="smoke test" + GO_XCAT_ACTION="$1 $2" ;; esac ;; @@ -1991,7 +1989,13 @@ do done case "${GO_XCAT_ACTION}" in -"away"|"check"|"install"|"uninstall"|"update") +"away") + GO_XCAT_YES=("-y") + ;; +"completely uninstall") + GO_XCAT_ACTION="away" + ;; +"check"|"install"|"uninstall"|"update") ;; "smoke test") smoke_testing @@ -2120,7 +2124,7 @@ if [[ "${RET}" -ne 0 ]] then echo "failed" echo "${ERR_MSG}" >&2 - exit "${RET}" + boo_boo_if_bad "${RET}" fi echo "done" diff --git a/xCAT-server/xCAT-wsapi/xcatws-test.py b/xCAT-server/xCAT-wsapi/xcatws-test.py index 7fa06322a..2f37126cf 100755 --- a/xCAT-server/xCAT-wsapi/xcatws-test.py +++ b/xCAT-server/xCAT-wsapi/xcatws-test.py @@ -77,20 +77,20 @@ except Exception as e: # # Send a request to get all nodes, passing in user and password # -all_nodes = requests.get(get_all_nodes + "?userName=" + username + "&userPW=" + password, verify=False) +response = requests.get(get_all_nodes + "?userName=" + username + "&userPW=" + password, verify=False) # Display returned data print "List of all nodes extracted with userid and password:" -print all_nodes.content +print response.text # # Send a request to get all nodes, passing in a token # user_data = {'userName': username,'userPW': password} token = requests.post(get_token, verify=False, headers={'Content-Type': 'application/json'}, data=json.dumps(user_data)) -all_nodes = requests.get(get_all_nodes, verify=False, headers={'X-Auth-Token': token.json()['token']['id']}) +response = requests.get(get_all_nodes, verify=False, headers={'X-Auth-Token': token.json()['token']['id']}) # Display returned data print "List of all nodes extracted with authentication token:" -print all_nodes.content +print response.text sys.exit(0) diff --git a/xCAT-test/autotest/bundle/non_default_http_port_test.bundle b/xCAT-test/autotest/bundle/non_default_http_port_test.bundle new file mode 100644 index 000000000..1e325b722 --- /dev/null +++ b/xCAT-test/autotest/bundle/non_default_http_port_test.bundle @@ -0,0 +1,28 @@ +setup_vm +genesis_work_with_non_default_http_80_port +change_http_listen_port_from_80_to_8898_in_mn +reg_linux_diskless_installation_flat +reg_linux_diskfull_installation_flat +updatenode_diskful_syncfiles +updatenode_diskful_syncfiles_rename +updatenode_diskful_syncfiles_dir +updatenode_syncfile_EXECUTE +updatenode_syncfile_EXECUTEALWAYS +updatenode_P_script1 +updatenode_f_incompatible_flags +updatenode_k_incompatible_flags +updatenode_diskful_syncfiles_P_script1 +updatenode_script3 +updatenode_P_script1_script2 +SN_setup_case +change_http_listen_port_from_80_to_8898_in_sn +reg_linux_diskfull_installation_hierarchy +updatenode_syncfile_APPEND +updatenode_syncfile_MERGE +updatenode_diskful_syncfiles_multi_files +updatenode_P_script2 +reg_linux_diskless_installation_hierarchy +reg_linux_statelite_installation_hierarchy_by_ramdisk +change_http_listen_port_from_8898_to_80_in_sn +change_http_listen_port_from_8898_to_80_in_mn +clean_up_env diff --git a/xCAT-test/autotest/bundle/physical_node_openpower_ipmi.bundle b/xCAT-test/autotest/bundle/physical_node_openpower_ipmi.bundle new file mode 100644 index 000000000..067b8f90e --- /dev/null +++ b/xCAT-test/autotest/bundle/physical_node_openpower_ipmi.bundle @@ -0,0 +1,25 @@ +#INCLUDE:hdctrl_openpower_ipmi.bundle# +reg_linux_diskfull_installation_flat +confignetwork_static_installnic +confignetwork_s_installnic_secondarynic_updatenode +confignetwork_secondarynic_updatenode +confignetwork_secondarynic_nicaliases_updatenode +confignetwork_secondarynic_nicextraparams_updatenode +confignetwork_disable_set_to_yes +confignetwork_disable_set_to_1 +confignetwork_niccustomscripts +confignetwork_secondarynic_nicnetworks_updatenode_false +confignetwork_secondarynic_nicips_updatenode_false +confignetwork_secondarynic_nictype_updatenode_false +confignetwork_2eth_bridge_br0 +confignetwork_2eth_bridge_br22_br33 +confignetwork_bond_false +confignetwork_installnic_2eth_bridge_br22_br33 +confignetwork_vlan_bond +confignetwork_vlan_eth0 +confignetwork_vlan_false +confignetwork__bridge_false +makeconservercf_null +makeconservercf_noderange +makeconservercf_d +reg_linux_diskless_installation_flat diff --git a/xCAT-test/autotest/bundle/physical_node_openpower_openbmc_perl.bundle b/xCAT-test/autotest/bundle/physical_node_openpower_openbmc_perl.bundle new file mode 100644 index 000000000..e1ddfb6bb --- /dev/null +++ b/xCAT-test/autotest/bundle/physical_node_openpower_openbmc_perl.bundle @@ -0,0 +1,26 @@ +#INCLUDE:hdctrl_openpower_openbmc.bundle# +reg_linux_diskfull_installation_flat +confignetwork_static_installnic +confignetwork_s_installnic_secondarynic_updatenode +confignetwork_secondarynic_updatenode +confignetwork_secondarynic_nicaliases_updatenode +confignetwork_secondarynic_nicextraparams_updatenode +confignetwork_disable_set_to_yes +confignetwork_disable_set_to_1 +confignetwork_niccustomscripts +confignetwork_secondarynic_nicnetworks_updatenode_false +confignetwork_secondarynic_nicips_updatenode_false +confignetwork_secondarynic_nictype_updatenode_false +confignetwork_2eth_bridge_br0 +confignetwork_2eth_bridge_br22_br33 +confignetwork_bond_false +confignetwork_installnic_2eth_bridge_br22_br33 +confignetwork_vlan_bond +confignetwork_vlan_eth0 +confignetwork_vlan_false +confignetwork__bridge_false +makeconservercf_null +makeconservercf_noderange +makeconservercf_d +reg_linux_diskless_installation_flat +reg_linux_statelite_installation_flat diff --git a/xCAT-test/autotest/bundle/physical_node_openpower_openbmc_python.bundle b/xCAT-test/autotest/bundle/physical_node_openpower_openbmc_python.bundle new file mode 100644 index 000000000..c4dcbbc9d --- /dev/null +++ b/xCAT-test/autotest/bundle/physical_node_openpower_openbmc_python.bundle @@ -0,0 +1,76 @@ +set_up_env_for_support_openbmc_in_python +#INCLUDE:hdctrl_general.bundle# +rinv_cpu +rinv_dimm +rinv_check_active_fw_count +rinv_check_active_fw_count_verbose +rinv_wrongbmcpasswd +rvitals_wattage +rvitals_fanspeed +rvitals_power +rvitals_altitude +rsetboot_net_statcheck +rsetboot_cd_statcheck +rsetboot_default_statcheck +rsetboot_h +rsetboot_help +rsetboot_v +rsetboot_node_invalidnode +rsetboot_noderange_net +rsetboot_node_invalidaction +rsetboot_group_net +rspconfig_set_ip +rspconfig_ip_invalid +rspconfig_ip_null +rspconfig_set_netmask +rspconfig_netmask_invalid +rspconfig_set_gateway +rspconfig_gateway_invalid +rspconfig_node_invalid +rspconfig_list_all +rspconfig_list_gateway +rspconfig_list_ip +rspconfig_list_netmask +rspconfig_list_vlan +rspconfig_noderange_invalid +rspconfig_set_all_invalid +rspconfig_set_vlan +rspconfig_set_vlan_invalid +rspconfig_set_hostname_equal_star_with_bmc_is_ip +rspconfig_set_hostname_equal_star_with_bmc_is_hostname +rspconfig_get_hostname +rspconfig_hostname_with_error_input +rspconfig_set_hostname +rspconfig_set_admin_passwd_with_error_input +rspconfig_set_admin_passwd_with_error_origin_password +rspconfig_sshcfg_with_error_input +reventlog_s_openbmc +rpower_softoff +rpower_suspend_OpenpowerBmc +rpower_wake_OpenpowerBmc +rpower_errorcommand_OpenpowerBmc +reg_linux_diskfull_installation_flat +confignetwork_static_installnic +confignetwork_s_installnic_secondarynic_updatenode +confignetwork_secondarynic_updatenode +confignetwork_secondarynic_nicaliases_updatenode +confignetwork_secondarynic_nicextraparams_updatenode +confignetwork_disable_set_to_yes +confignetwork_disable_set_to_1 +confignetwork_niccustomscripts +confignetwork_secondarynic_nicnetworks_updatenode_false +confignetwork_secondarynic_nicips_updatenode_false +confignetwork_secondarynic_nictype_updatenode_false +confignetwork_2eth_bridge_br0 +confignetwork_2eth_bridge_br22_br33 +confignetwork_bond_false +confignetwork_installnic_2eth_bridge_br22_br33 +confignetwork_vlan_bond +confignetwork_vlan_eth0 +confignetwork_vlan_false +confignetwork__bridge_false +makeconservercf_null +makeconservercf_noderange +makeconservercf_d +reg_linux_diskless_installation_flat +reg_linux_statelite_installation_flat diff --git a/xCAT-test/autotest/bundle/physical_node_power_hmc.bundle b/xCAT-test/autotest/bundle/physical_node_power_hmc.bundle new file mode 100644 index 000000000..5eff8ec15 --- /dev/null +++ b/xCAT-test/autotest/bundle/physical_node_power_hmc.bundle @@ -0,0 +1,28 @@ +#INCLUDE:hdctrl_ppc_hmc.bundle# +reg_linux_diskfull_installation_flat +confignetwork_static_installnic +confignetwork_s_installnic_secondarynic_updatenode +confignetwork_secondarynic_updatenode +confignetwork_secondarynic_nicaliases_updatenode +confignetwork_secondarynic_nicextraparams_updatenode +confignetwork_disable_set_to_yes +confignetwork_disable_set_to_1 +confignetwork_niccustomscripts +confignetwork_secondarynic_thirdnic_multiplevalue_updatenode +confignetwork_secondarynic_nicnetworks_updatenode_false +confignetwork_secondarynic_nicips_updatenode_false +confignetwork_secondarynic_nictype_updatenode_false +confignetwork_2eth_bridge_br0 +confignetwork_2eth_bridge_br22_br33 +confignetwork_bond_eth2_eth3 +confignetwork_bond_false +confignetwork_installnic_2eth_bridge_br22_br33 +confignetwork_vlan_bond +confignetwork_vlan_eth0 +confignetwork_vlan_false +confignetwork__bridge_false +makeconservercf_null +makeconservercf_noderange +makeconservercf_d +reg_linux_diskless_installation_flat +reg_linux_statelite_installation_flat diff --git a/xCAT-test/autotest/bundle/physical_node_x86_ipmi.bundle b/xCAT-test/autotest/bundle/physical_node_x86_ipmi.bundle new file mode 100644 index 000000000..c452eec75 --- /dev/null +++ b/xCAT-test/autotest/bundle/physical_node_x86_ipmi.bundle @@ -0,0 +1,28 @@ +#INCLUDE:hdctrl_bmc.bundle# +reg_linux_diskfull_installation_flat +confignetwork_static_installnic +confignetwork_s_installnic_secondarynic_updatenode +confignetwork_secondarynic_updatenode +confignetwork_secondarynic_nicaliases_updatenode +confignetwork_secondarynic_nicextraparams_updatenode +confignetwork_disable_set_to_yes +confignetwork_disable_set_to_1 +confignetwork_niccustomscripts +confignetwork_secondarynic_thirdnic_multiplevalue_updatenode +confignetwork_secondarynic_nicnetworks_updatenode_false +confignetwork_secondarynic_nicips_updatenode_false +confignetwork_secondarynic_nictype_updatenode_false +confignetwork_2eth_bridge_br0 +confignetwork_2eth_bridge_br22_br33 +confignetwork_bond_eth2_eth3 +confignetwork_bond_false +confignetwork_installnic_2eth_bridge_br22_br33 +confignetwork_vlan_bond +confignetwork_vlan_eth0 +confignetwork_vlan_false +confignetwork__bridge_false +makeconservercf_null +makeconservercf_noderange +makeconservercf_d +reg_linux_diskless_installation_flat +reg_linux_statelite_installation_flat diff --git a/xCAT-test/autotest/bundle/rhels6.9_ppc64.bundle b/xCAT-test/autotest/bundle/rhels6.9_ppc64.bundle index b1137d0bf..b7120f1b1 100644 --- a/xCAT-test/autotest/bundle/rhels6.9_ppc64.bundle +++ b/xCAT-test/autotest/bundle/rhels6.9_ppc64.bundle @@ -17,6 +17,7 @@ updatenode_diskful_syncfiles_P_script1 updatenode_script3 updatenode_P_script1_script2 updatenode_without_flag +updatenode_without_options confignetwork_static_installnic confignetwork_secondarynic_nicnetworks_updatenode_false confignetwork_secondarynic_nicips_updatenode_false diff --git a/xCAT-test/autotest/bundle/rhels7.4_ppc64.bundle b/xCAT-test/autotest/bundle/rhels7.4_ppc64.bundle index 060343ce4..e4ed05563 100644 --- a/xCAT-test/autotest/bundle/rhels7.4_ppc64.bundle +++ b/xCAT-test/autotest/bundle/rhels7.4_ppc64.bundle @@ -17,6 +17,7 @@ updatenode_diskful_syncfiles_P_script1 updatenode_script3 updatenode_P_script1_script2 updatenode_without_flag +updatenode_without_options confignetwork_static_installnic confignetwork_secondarynic_nicnetworks_updatenode_false confignetwork_secondarynic_nicips_updatenode_false diff --git a/xCAT-test/autotest/bundle/rhels7.4_ppc64le.bundle b/xCAT-test/autotest/bundle/rhels7.4_ppc64le.bundle index e458f98cf..9f8403be7 100644 --- a/xCAT-test/autotest/bundle/rhels7.4_ppc64le.bundle +++ b/xCAT-test/autotest/bundle/rhels7.4_ppc64le.bundle @@ -20,6 +20,7 @@ updatenode_diskful_syncfiles_P_script1 updatenode_script3 updatenode_P_script1_script2 updatenode_without_flag +updatenode_without_options confignetwork_static_installnic confignetwork_s_installnic_secondarynic_updatenode confignetwork_secondarynic_updatenode @@ -310,7 +311,6 @@ makentp_v makentp_h nodeset_check_warninginfo runcmdinstaller_h -runcmdinstaller_command get_xcat_postscripts_loginfo updatenode_postscripts_loginfo bmcdiscover_h diff --git a/xCAT-test/autotest/bundle/rhels_ppc_daily.bundle b/xCAT-test/autotest/bundle/rhels_ppc_daily.bundle new file mode 100644 index 000000000..ef275ad8e --- /dev/null +++ b/xCAT-test/autotest/bundle/rhels_ppc_daily.bundle @@ -0,0 +1,303 @@ +SN_setup_case +reg_linux_diskless_installation_hierarchy +reg_linux_diskfull_installation_hierarchy +updatenode_P_script1 +updatenode_P_script1_script2 +updatenode_P_script2 +updatenode_diskful_syncfiles +updatenode_diskful_syncfiles_P_script1 +updatenode_diskful_syncfiles_dir +updatenode_diskful_syncfiles_failing +updatenode_diskful_syncfiles_multi_files +updatenode_diskful_syncfiles_rename +updatenode_f_incompatible_flags +updatenode_h +updatenode_k_incompatible_flags +updatenode_postscripts_loginfo +updatenode_script3 +updatenode_syncfile_APPEND +updatenode_syncfile_EXECUTE +updatenode_syncfile_EXECUTEALWAYS +updatenode_syncfile_MERGE +updatenode_v +updatenode_without_flag +updatenode_without_options +xdcp_nonroot_user +xdcp_src_dst +xdsh_E +xdsh_Q_command +xdsh_T +xdsh_V +xdsh_c_cn +xdsh_e_filename +xdsh_h +xdsh_i_linux +xdsh_o +xdsh_permission_denied +xdsh_q +xdsh_regular_command +xdsh_t +assign_certain_command_permission +chdef_dynamic_group +chdef_group +chdef_group_p +chdef_m +chdef_multiple_keys +chdef_n +chdef_nicips +chdef_null +chdef_p +chdef_site_check +chdef_t_network +chdef_t_node +chdef_t_o_error +chdef_z +chtab_d +chtab_h +chtab_modify_key +chtab_modify_node +chtab_null +chtab_v +confignetwork_secondarynic_nicips_updatenode_false +confignetwork_secondarynic_nicnetworks_updatenode_false +confignetwork_secondarynic_nictype_updatenode_false +copycds_a +copycds_a_err +copycds_iso +copycds_n +copycds_n_a +copycds_n_err +disable_root_permission_in_policy_table +dumpxCATdb_a_p_nullskiptables +dumpxCATdb_a_p_nullskiptables_V +dumpxCATdb_a_p_skiptables +dumpxCATdb_h +dumpxCATdb_p_V +dumpxCATdb_p_nullskiptables +dumpxCATdb_p_nullskiptables_V +dumpxCATdb_p_skiptables +dumpxCATdb_v +encrypted_passwd_md5_diskfull +encrypted_passwd_openssl_diskfull +encrypted_passwd_sha256_diskfull +encrypted_passwd_sha512_diskfull +gettab_H +gettab_err +gettab_h +gettab_key_table +getmacs_d +getmacs_f_D +getmacs_noderange +lsdef_a +lsdef_null +lsdef_t +lsdef_t_err +lsdef_t_i_o +lsdef_t_o_l +lsdef_t_o_l_z +lsdef_t_w +lslite_h +lslite_i +lslite_noderange +lsxcatd_a +lsxcatd_d +lsxcatd_h +lsxcatd_null +makeconservercf_d +makeconservercf_noderange +makeconservercf_null +makedhcp_a +makedhcp_a_d +makedhcp_d +makedhcp_n +makedhcp_remote_network +makedns +makedns_d_node +makedns_h +makedns_n +makedns_n_noderange +makehost_n_r +makehosts_d +makehosts_h +makehosts_help +makehosts_l +makehosts_n +makehosts_n_noderange +makehosts_null +makeknownhosts_node_d +makentp_h +makentp_v +mkdef_null +mkdef_regex_bmc +mkdef_regex_ip +mkdef_regex_kvm +mkdef_regex_nicsip +mkdef_rhels73 +mkdef_t_o_error +mkdef_z +nodeadd_err_symbol +nodeadd_h +nodeadd_noderange +nodeadd_noderange_nodetype +nodeadd_null +nodeadd_v +nodech_delete +nodech_error_node +nodech_error_table +nodech_h +nodech_noderanage_table_at +nodech_noderange_shortname_groups +nodech_noderange_shortname_mgt +nodech_noderange_shortname_tags +nodech_noderange_table +nodech_noderange_table_arrow +nodech_noderange_table_comma +nodech_noderange_table_equal +nodech_noderange_table_include +nodech_noderange_table_unequal +nodech_noderange_table_uninclude +nodech_v +nodegrpch_err +nodegrpch_groups +nodegrpch_h +nodegrpch_v +nodels_H +nodels_S +nodels_b +nodels_err_noderange +nodels_err_symbol +nodels_h +nodels_noderange +nodels_noderange_shortname_groups +nodels_noderange_shortname_mgt +nodels_noderange_shortname_tags +nodels_noderange_table +nodels_noderange_table_equal +nodels_noderange_table_unequal +nodels_noderange_table_uninclude +nodels_noderange_tablecolumn +nodels_null +nodels_table_include +nodels_tablevalue +nodels_tablevalue_tablecolumn +nodels_v +noderange_10-20 +noderange_XCAT_NODE_PREFIX +noderange_XCAT_NODE_SUFFIX +noderange_exclusion +noderange_group1-group3 +noderange_group_intersection +noderange_individual_grp +noderange_individual_node +noderange_node01-node10 +noderm_err_node +noderm_h +noderm_noderange +noderm_null +nodeset_check_warninginfo +nodeset_errorcommand +nodeset_grub2 +nodeset_noderange +nodeset_yaboot +nodeset_stat +nodestat_err_node +nodestat_usage +packimage_h +packimage_v +pping_h +pping_invalidnode +pping_node +pping_v +prsync_dir_node +prsync_file_node +prsync_h +prsync_v +psh_h +psh_i +psh_l +psh_node_cmd_linux +psh_v +regnotif_err +regnotif_h +regnotif_null +regnotif_o +regnotif_v +restorexCAT_h +restorexCATdb_a_p_V +restorexCATdb_p_V +restorexCATdb_v +restorexCATdb_wrongpath +rinv_all +rinv_bus +rinv_config +rinv_firm +rinv_model +rinv_serial +rinv_noderange_err +rmdef_null +rmdef_t_err +rpower_boot +rpower_err_noderange +rpower_noderange +rpower_noderange_nodeps +rpower_off +rpower_on +rpower_stat +rscan_noderange +rscan_w +rscan_x +rscan_x_w +rscan_z +rscan_z_w +run_command_with_XCATBYPASS +runcmdinstaller_h +rvitals_all +rvitals_lcds +rvitals_noderange_err +tabdump_d +tabdump_d_nodehm +tabdump_f_d +tabdump_h +tabdump_help +tabdump_table +tabdump_v +tabdump_w_equal +tabdump_w_ge +tabdump_w_gt +tabdump_w_le +tabdump_w_lt +tabdump_w_match +tabdump_w_ne +tabdump_w_notmatch +tabgrep_err +tabgrep_h +tabgrep_node +tabgrep_null +tabprune_V_a_eventlog +tabprune_V_n_auditlog +tabprune_a_eventlog +tabprune_h +tabprune_i_auditlog +tabprune_p_auditlog +tabprune_v +tabrestore_err +tabrestore_h +tabrestore_null +tabrestore_table +unregnotif_f +unregnotif_h +unregnotif_null +unregnotif_v +xcatconfig_c +xcatconfig_u_check_xcatsslversion_rhels_sles +xcatd_restart +xcatd_start +xcatd_stop +xcatstanzafile_attribute +xcatstanzafile_colon +xcatstanzafile_defaultvalue +xcatstanzafile_multattr +xcatstanzafile_normal +xcatstanzafile_objtype +xcatstanzafile_specificvalue +xcatstanzafile_tab diff --git a/xCAT-test/autotest/bundle/rhels_ppc_weekly.bundle b/xCAT-test/autotest/bundle/rhels_ppc_weekly.bundle new file mode 100644 index 000000000..f523dfe2f --- /dev/null +++ b/xCAT-test/autotest/bundle/rhels_ppc_weekly.bundle @@ -0,0 +1,71 @@ +#INCLUDE:rhels_ppc_daily.bundle# +packimage_imagename +packimage_m_cpio_c_gzip +packimage_m_cpio_c_xz +packimage_m_invalid_archive_method +packimage_m_invalid_compress_method +packimage_m_tar_c_gzip +packimage_m_tar_c_xz +packimage_o_p_a_m +reg_linux_statelite_installation_hierarchy_by_nfs +reg_linux_statelite_installation_hierarchy_by_ramdisk +addkit_v +addkit_h +addkit_kit +addkit_i +addkit_multikit +addkit_p +addkitcomp_v +addkitcomp_h +addkitcomp_i +addkitcomp_f +buildkit_v +buildkit_h +buildkit_create +buildkit_create_l +buildkit_cleanrepo_all +buildkit_buildtar +chkkitcomp_v +chkkitcomp_h +chkkitcomp_V +lskit_v +lskit_h +lskit_F +lskit_K +lskit_R +lskit_C +lskitcomp_v +lskitcomp_h +lskitcomp_C +lskitcomp_S +lskitdeployparam_v +lskitdeployparam_h +lskitdeployparam_no_param +lskitdeployparam_k_1 +lskitdeployparam_c_1 +rmkit_v +rmkit_h +rmkit_t_no +rmkit_t_yes +rmkit_f +rmkit_V +rmkitcomp_v +rmkitcomp_h +bmcdiscover_h +bmcdiscover_nmap_range +bmcdiscover_v +bmcdiscover_range_w +bmcdiscover_range_z +bmcdiscover_help +bmcdiscover_q +bmcdiscover_version +confignetwork_static_installnic +get_xcat_postscripts_loginfo +reg_linux_diskfull_installation_flat +reg_linux_diskless_installation_flat +reg_linux_statelite_installation_flat +rmimage_diskless +rpower_reset +runcmdinstaller_command +redhat_migration1 +redhat_migration2 diff --git a/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle b/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle new file mode 100644 index 000000000..ac66a4213 --- /dev/null +++ b/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle @@ -0,0 +1,305 @@ +SN_setup_case +reg_linux_diskless_installation_hierarchy +reg_linux_diskfull_installation_hierarchy +updatenode_P_script1 +updatenode_P_script1_script2 +updatenode_P_script2 +updatenode_diskful_syncfiles +updatenode_diskful_syncfiles_P_script1 +updatenode_diskful_syncfiles_dir +updatenode_diskful_syncfiles_failing +updatenode_diskful_syncfiles_multi_files +updatenode_diskful_syncfiles_rename +updatenode_f_incompatible_flags +updatenode_h +updatenode_k_incompatible_flags +updatenode_postscripts_loginfo +updatenode_script3 +updatenode_syncfile_APPEND +updatenode_syncfile_EXECUTE +updatenode_syncfile_EXECUTEALWAYS +updatenode_syncfile_MERGE +updatenode_v +updatenode_without_flag +updatenode_without_options +xdcp_nonroot_user +xdcp_src_dst +xdsh_E +xdsh_Q_command +xdsh_T +xdsh_V +xdsh_c_cn +xdsh_e_filename +xdsh_h +xdsh_i_linux +xdsh_o +xdsh_permission_denied +xdsh_q +xdsh_regular_command +xdsh_t +assign_certain_command_permission +chdef_dynamic_group +chdef_group +chdef_group_p +chdef_m +chdef_multiple_keys +chdef_n +chdef_nicips +chdef_null +chdef_p +chdef_site_check +chdef_t_network +chdef_t_node +chdef_t_o_error +chdef_z +chtab_d +chtab_h +chtab_modify_key +chtab_modify_node +chtab_null +chtab_v +confignetwork_2eth_bridge_br0 +confignetwork_2eth_bridge_br22_br33 +confignetwork__bridge_false +confignetwork_bond_eth2_eth3 +confignetwork_bond_false +confignetwork_disable_set_to_1 +confignetwork_disable_set_to_yes +confignetwork_installnic_2eth_bridge_br22_br33 +confignetwork_niccustomscripts +confignetwork_s_installnic_secondarynic_updatenode +confignetwork_secondarynic_nicaliases_updatenode +confignetwork_secondarynic_nicextraparams_updatenode +confignetwork_secondarynic_nicips_updatenode_false +confignetwork_secondarynic_nicnetworks_updatenode_false +confignetwork_secondarynic_nictype_updatenode_false +confignetwork_secondarynic_thirdnic_multiplevalue_updatenode +confignetwork_secondarynic_updatenode +confignetwork_vlan_bond +confignetwork_vlan_eth0 +confignetwork_vlan_false +copycds_a +copycds_a_err +copycds_iso +copycds_n +copycds_n_a +copycds_n_err +disable_root_permission_in_policy_table +dumpxCATdb_a_p_nullskiptables +dumpxCATdb_a_p_nullskiptables_V +dumpxCATdb_a_p_skiptables +dumpxCATdb_h +dumpxCATdb_p_V +dumpxCATdb_p_nullskiptables +dumpxCATdb_p_nullskiptables_V +dumpxCATdb_p_skiptables +dumpxCATdb_v +encrypted_passwd_md5_diskfull +encrypted_passwd_openssl_diskfull +encrypted_passwd_sha256_diskfull +encrypted_passwd_sha512_diskfull +gettab_H +gettab_err +gettab_h +gettab_key_table +lsdef_a +lsdef_null +lsdef_t +lsdef_t_err +lsdef_t_i_o +lsdef_t_o_l +lsdef_t_o_l_z +lsdef_t_w +lslite_h +lslite_i +lslite_noderange +lsxcatd_a +lsxcatd_d +lsxcatd_h +lsxcatd_null +makeconservercf_d +makeconservercf_noderange +makeconservercf_null +makedhcp_a +makedhcp_a_d +makedhcp_d +makedhcp_n +makedhcp_remote_network +makedns +makedns_d_node +makedns_h +makedns_n +makedns_n_noderange +makehost_n_r +makehosts_d +makehosts_h +makehosts_help +makehosts_l +makehosts_n +makehosts_n_noderange +makehosts_null +makeknownhosts_node_d +makentp_h +makentp_v +mkdef_null +mkdef_regex_bmc +mkdef_regex_ip +mkdef_regex_kvm +mkdef_regex_nicsip +mkdef_rhels73 +mkdef_t_o_error +mkdef_z +nodeadd_err_symbol +nodeadd_h +nodeadd_noderange +nodeadd_noderange_nodetype +nodeadd_null +nodeadd_v +nodech_delete +nodech_error_node +nodech_error_table +nodech_h +nodech_noderanage_table_at +nodech_noderange_shortname_groups +nodech_noderange_shortname_mgt +nodech_noderange_shortname_tags +nodech_noderange_table +nodech_noderange_table_arrow +nodech_noderange_table_comma +nodech_noderange_table_equal +nodech_noderange_table_include +nodech_noderange_table_unequal +nodech_noderange_table_uninclude +nodech_v +nodegrpch_err +nodegrpch_groups +nodegrpch_h +nodegrpch_v +nodels_H +nodels_S +nodels_b +nodels_err_noderange +nodels_err_symbol +nodels_h +nodels_noderange +nodels_noderange_shortname_groups +nodels_noderange_shortname_mgt +nodels_noderange_shortname_tags +nodels_noderange_table +nodels_noderange_table_equal +nodels_noderange_table_unequal +nodels_noderange_table_uninclude +nodels_noderange_tablecolumn +nodels_null +nodels_table_include +nodels_tablevalue +nodels_tablevalue_tablecolumn +nodels_v +noderange_10-20 +noderange_XCAT_NODE_PREFIX +noderange_XCAT_NODE_SUFFIX +noderange_exclusion +noderange_group1-group3 +noderange_group_intersection +noderange_individual_grp +noderange_individual_node +noderange_node01-node10 +noderm_err_node +noderm_h +noderm_noderange +noderm_null +nodeset_check_warninginfo +nodeset_disjointdhcps_petitboot +nodeset_errorcommand +nodeset_grub2 +nodeset_noderange +nodeset_petitboot +nodeset_shell_incorrectmasterip +nodeset_stat +nodestat_err_node +nodestat_usage +packimage_h +packimage_v +pping_h +pping_invalidnode +pping_node +pping_v +prsync_dir_node +prsync_file_node +prsync_h +prsync_v +psh_h +psh_i +psh_l +psh_node_cmd_linux +psh_v +regnotif_err +regnotif_h +regnotif_null +regnotif_o +regnotif_v +restorexCAT_h +restorexCATdb_a_p_V +restorexCATdb_p_V +restorexCATdb_v +restorexCATdb_wrongpath +rinv_noderange_err +rmdef_null +rmdef_t_err +rpower_boot +rpower_err_noderange +rpower_noderange +rpower_noderange_nodeps +rpower_off +rpower_on +rpower_stat +run_command_with_XCATBYPASS +runcmdinstaller_h +rvitals_noderange_err +tabdump_d +tabdump_d_nodehm +tabdump_f_d +tabdump_h +tabdump_help +tabdump_table +tabdump_v +tabdump_w_equal +tabdump_w_ge +tabdump_w_gt +tabdump_w_le +tabdump_w_lt +tabdump_w_match +tabdump_w_ne +tabdump_w_notmatch +tabgrep_err +tabgrep_h +tabgrep_node +tabgrep_null +tabprune_V_a_eventlog +tabprune_V_n_auditlog +tabprune_a_eventlog +tabprune_h +tabprune_i_auditlog +tabprune_p_auditlog +tabprune_v +tabrestore_err +tabrestore_h +tabrestore_null +tabrestore_table +unregnotif_f +unregnotif_h +unregnotif_null +unregnotif_v +xcatconfig_c +xcatconfig_u_check_xcatsslversion_rhels_sles +xcatd_restart +xcatd_start +xcatd_stop +xcatstanzafile_attribute +xcatstanzafile_colon +xcatstanzafile_defaultvalue +xcatstanzafile_multattr +xcatstanzafile_normal +xcatstanzafile_objtype +xcatstanzafile_specificvalue +xcatstanzafile_tab diff --git a/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle b/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle new file mode 100644 index 000000000..f4f1f4460 --- /dev/null +++ b/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle @@ -0,0 +1,75 @@ +#INCLUDE:rhels_ppcle_daily.bundle# +packimage_imagename +packimage_m_cpio_c_gzip +packimage_m_cpio_c_xz +packimage_m_invalid_archive_method +packimage_m_invalid_compress_method +packimage_m_tar_c_gzip +packimage_m_tar_c_xz +packimage_o_p_a_m +reg_linux_statelite_installation_hierarchy_by_nfs +reg_linux_statelite_installation_hierarchy_by_ramdisk +addkit_v +addkit_h +addkit_kit +addkit_i +addkit_multikit +addkit_p +addkitcomp_v +addkitcomp_h +addkitcomp_i +addkitcomp_f +buildkit_v +buildkit_h +buildkit_create +buildkit_create_l +buildkit_cleanrepo_all +buildkit_buildtar +chkkitcomp_v +chkkitcomp_h +chkkitcomp_V +lskit_v +lskit_h +lskit_F +lskit_K +lskit_R +lskit_C +lskitcomp_v +lskitcomp_h +lskitcomp_C +lskitcomp_S +lskitdeployparam_v +lskitdeployparam_h +lskitdeployparam_no_param +lskitdeployparam_k_1 +lskitdeployparam_c_1 +rmkit_v +rmkit_h +rmkit_t_no +rmkit_t_yes +rmkit_f +rmkit_V +rmkitcomp_v +rmkitcomp_h +bmcdiscover_h +bmcdiscover_nmap_range +bmcdiscover_v +bmcdiscover_range_w +bmcdiscover_range_z +bmcdiscover_help +bmcdiscover_q +bmcdiscover_version +confignetwork_static_installnic +get_xcat_postscripts_loginfo +nodeset_cmdline +nodeset_runimg +nodeset_shell +reg_linux_diskfull_installation_flat +reg_linux_diskless_installation_flat +reg_linux_statelite_installation_flat +rmimage_diskless +rpower_reset +runcmdinstaller_command +redhat_migration1 +redhat_migration2 +linux_diskless_kdump diff --git a/xCAT-test/autotest/bundle/rhels_x86_daily.bundle b/xCAT-test/autotest/bundle/rhels_x86_daily.bundle new file mode 100644 index 000000000..fe78b52d0 --- /dev/null +++ b/xCAT-test/autotest/bundle/rhels_x86_daily.bundle @@ -0,0 +1,304 @@ +SN_setup_case +reg_linux_diskless_installation_hierarchy +reg_linux_diskfull_installation_hierarchy +updatenode_P_script1 +updatenode_P_script1_script2 +updatenode_P_script2 +updatenode_diskful_syncfiles +updatenode_diskful_syncfiles_P_script1 +updatenode_diskful_syncfiles_dir +updatenode_diskful_syncfiles_failing +updatenode_diskful_syncfiles_multi_files +updatenode_diskful_syncfiles_rename +updatenode_f_incompatible_flags +updatenode_h +updatenode_k_incompatible_flags +updatenode_postscripts_loginfo +updatenode_script3 +updatenode_syncfile_APPEND +updatenode_syncfile_EXECUTE +updatenode_syncfile_EXECUTEALWAYS +updatenode_syncfile_MERGE +updatenode_v +updatenode_without_flag +updatenode_without_options +xdcp_nonroot_user +xdcp_src_dst +xdsh_E +xdsh_Q_command +xdsh_T +xdsh_V +xdsh_c_cn +xdsh_e_filename +xdsh_h +xdsh_i_linux +xdsh_o +xdsh_permission_denied +xdsh_q +xdsh_regular_command +xdsh_t +assign_certain_command_permission +chdef_dynamic_group +chdef_group +chdef_group_p +chdef_m +chdef_multiple_keys +chdef_n +chdef_nicips +chdef_null +chdef_p +chdef_site_check +chdef_t_network +chdef_t_node +chdef_t_o_error +chdef_z +chtab_d +chtab_h +chtab_modify_key +chtab_modify_node +chtab_null +chtab_v +confignetwork_2eth_bridge_br0 +confignetwork_2eth_bridge_br22_br33 +confignetwork__bridge_false +confignetwork_bond_eth2_eth3 +confignetwork_bond_false +confignetwork_disable_set_to_1 +confignetwork_disable_set_to_yes +confignetwork_installnic_2eth_bridge_br22_br33 +confignetwork_niccustomscripts +confignetwork_s_installnic_secondarynic_updatenode +confignetwork_secondarynic_nicaliases_updatenode +confignetwork_secondarynic_nicextraparams_updatenode +confignetwork_secondarynic_nicips_updatenode_false +confignetwork_secondarynic_nicnetworks_updatenode_false +confignetwork_secondarynic_nictype_updatenode_false +confignetwork_secondarynic_thirdnic_multiplevalue_updatenode +confignetwork_secondarynic_updatenode +confignetwork_vlan_bond +confignetwork_vlan_eth0 +confignetwork_vlan_false +copycds_a +copycds_a_err +copycds_iso +copycds_n +copycds_n_a +copycds_n_err +disable_root_permission_in_policy_table +dumpxCATdb_a_p_nullskiptables +dumpxCATdb_a_p_nullskiptables_V +dumpxCATdb_a_p_skiptables +dumpxCATdb_h +dumpxCATdb_p_V +dumpxCATdb_p_nullskiptables +dumpxCATdb_p_nullskiptables_V +dumpxCATdb_p_skiptables +dumpxCATdb_v +encrypted_passwd_md5_diskfull +encrypted_passwd_openssl_diskfull +encrypted_passwd_sha256_diskfull +encrypted_passwd_sha512_diskfull +gettab_H +gettab_err +gettab_h +gettab_key_table +lsdef_a +lsdef_null +lsdef_t +lsdef_t_err +lsdef_t_i_o +lsdef_t_o_l +lsdef_t_o_l_z +lsdef_t_w +lslite_h +lslite_i +lslite_noderange +lsxcatd_a +lsxcatd_d +lsxcatd_h +lsxcatd_null +makeconservercf_d +makeconservercf_noderange +makeconservercf_null +makedhcp_a +makedhcp_a_d +makedhcp_d +makedhcp_n +makedhcp_remote_network +makedns +makedns_d_node +makedns_h +makedns_n +makedns_n_noderange +makehost_n_r +makehosts_d +makehosts_h +makehosts_help +makehosts_l +makehosts_n +makehosts_n_noderange +makehosts_null +makeknownhosts_node_d +makentp_h +makentp_v +mkdef_null +mkdef_regex_bmc +mkdef_regex_ip +mkdef_regex_kvm +mkdef_regex_nicsip +mkdef_rhels73 +mkdef_t_o_error +mkdef_z +nodeadd_err_symbol +nodeadd_h +nodeadd_noderange +nodeadd_noderange_nodetype +nodeadd_null +nodeadd_v +nodech_delete +nodech_error_node +nodech_error_table +nodech_h +nodech_noderanage_table_at +nodech_noderange_shortname_groups +nodech_noderange_shortname_mgt +nodech_noderange_shortname_tags +nodech_noderange_table +nodech_noderange_table_arrow +nodech_noderange_table_comma +nodech_noderange_table_equal +nodech_noderange_table_include +nodech_noderange_table_unequal +nodech_noderange_table_uninclude +nodech_v +nodegrpch_err +nodegrpch_groups +nodegrpch_h +nodegrpch_v +nodels_H +nodels_S +nodels_b +nodels_err_noderange +nodels_err_symbol +nodels_h +nodels_noderange +nodels_noderange_shortname_groups +nodels_noderange_shortname_mgt +nodels_noderange_shortname_tags +nodels_noderange_table +nodels_noderange_table_equal +nodels_noderange_table_unequal +nodels_noderange_table_uninclude +nodels_noderange_tablecolumn +nodels_null +nodels_table_include +nodels_tablevalue +nodels_tablevalue_tablecolumn +nodels_v +noderange_10-20 +noderange_XCAT_NODE_PREFIX +noderange_XCAT_NODE_SUFFIX +noderange_exclusion +noderange_group1-group3 +noderange_group_intersection +noderange_individual_grp +noderange_individual_node +noderange_node01-node10 +noderm_err_node +noderm_h +noderm_noderange +noderm_null +nodeset_check_warninginfo +nodeset_errorcommand +nodeset_xnba +nodeset_noderange +nodeset_shell_incorrectmasterip +nodeset_stat +nodestat_err_node +nodestat_noderange +nodestat_usage +packimage_h +packimage_v +pping_h +pping_invalidnode +pping_node +pping_v +prsync_dir_node +prsync_file_node +prsync_h +prsync_v +psh_h +psh_i +psh_l +psh_node_cmd_linux +psh_v +regnotif_err +regnotif_h +regnotif_null +regnotif_o +regnotif_v +restorexCAT_h +restorexCATdb_a_p_V +restorexCATdb_p_V +restorexCATdb_v +restorexCATdb_wrongpath +rinv_noderange_err +rmdef_null +rmdef_t_err +rpower_boot +rpower_err_noderange +rpower_noderange +rpower_noderange_nodeps +rpower_off +rpower_on +rpower_stat +run_command_with_XCATBYPASS +runcmdinstaller_h +rvitals_noderange_err +tabdump_d +tabdump_d_nodehm +tabdump_f_d +tabdump_h +tabdump_help +tabdump_table +tabdump_v +tabdump_w_equal +tabdump_w_ge +tabdump_w_gt +tabdump_w_le +tabdump_w_lt +tabdump_w_match +tabdump_w_ne +tabdump_w_notmatch +tabgrep_err +tabgrep_h +tabgrep_node +tabgrep_null +tabprune_V_a_eventlog +tabprune_V_n_auditlog +tabprune_a_eventlog +tabprune_h +tabprune_i_auditlog +tabprune_p_auditlog +tabprune_v +tabrestore_err +tabrestore_h +tabrestore_null +tabrestore_table +unregnotif_f +unregnotif_h +unregnotif_null +unregnotif_v +xcatconfig_c +xcatconfig_u_check_xcatsslversion_rhels_sles +xcatd_restart +xcatd_start +xcatd_stop +xcatstanzafile_attribute +xcatstanzafile_colon +xcatstanzafile_defaultvalue +xcatstanzafile_multattr +xcatstanzafile_normal +xcatstanzafile_objtype +xcatstanzafile_specificvalue +xcatstanzafile_tab diff --git a/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle b/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle new file mode 100644 index 000000000..a06f89c06 --- /dev/null +++ b/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle @@ -0,0 +1,74 @@ +#INCLUDE:rhels_x86_daily.bundle# +packimage_imagename +packimage_m_cpio_c_gzip +packimage_m_cpio_c_xz +packimage_m_invalid_archive_method +packimage_m_invalid_compress_method +packimage_m_tar_c_gzip +packimage_m_tar_c_xz +packimage_o_p_a_m +reg_linux_statelite_installation_hierarchy_by_nfs +reg_linux_statelite_installation_hierarchy_by_ramdisk +addkit_v +addkit_h +addkit_kit +addkit_i +addkit_multikit +addkit_p +addkitcomp_v +addkitcomp_h +addkitcomp_i +addkitcomp_f +buildkit_v +buildkit_h +buildkit_create +buildkit_create_l +buildkit_cleanrepo_all +buildkit_buildtar +chkkitcomp_v +chkkitcomp_h +chkkitcomp_V +lskit_v +lskit_h +lskit_F +lskit_K +lskit_R +lskit_C +lskitcomp_v +lskitcomp_h +lskitcomp_C +lskitcomp_S +lskitdeployparam_v +lskitdeployparam_h +lskitdeployparam_no_param +lskitdeployparam_k_1 +lskitdeployparam_c_1 +rmkit_v +rmkit_h +rmkit_t_no +rmkit_t_yes +rmkit_f +rmkit_V +rmkitcomp_v +rmkitcomp_h +bmcdiscover_h +bmcdiscover_nmap_range +bmcdiscover_v +bmcdiscover_range_w +bmcdiscover_range_z +bmcdiscover_help +bmcdiscover_q +bmcdiscover_version +confignetwork_static_installnic +get_xcat_postscripts_loginfo +nodeset_cmdline +nodeset_runimg +nodeset_shell +reg_linux_diskfull_installation_flat +reg_linux_diskless_installation_flat +reg_linux_statelite_installation_flat +rmimage_diskless +rpower_reset +runcmdinstaller_command +redhat_migration1 +redhat_migration2 diff --git a/xCAT-test/autotest/bundle/sles_ppc_daily.bundle b/xCAT-test/autotest/bundle/sles_ppc_daily.bundle new file mode 100644 index 000000000..2a9377444 --- /dev/null +++ b/xCAT-test/autotest/bundle/sles_ppc_daily.bundle @@ -0,0 +1,282 @@ +SN_setup_case +reg_linux_diskless_installation_hierarchy +reg_linux_diskfull_installation_hierarchy +bmcdiscover_help +bmcdiscover_q +bmcdiscover_version +xdcp_nonroot_user +xdcp_src_dst +xdsh_E +xdsh_Q_command +xdsh_T +xdsh_V +xdsh_c_cn +xdsh_e_filename +xdsh_h +xdsh_o +xdsh_permission_denied +xdsh_q +xdsh_regular_command +xdsh_t +chdef_dynamic_group +chdef_group +chdef_group_p +chdef_m +chdef_multiple_keys +chdef_n +chdef_nicips +chdef_null +chdef_p +chdef_site_check +chdef_t_network +chdef_t_node +chdef_t_o_error +chdef_z +chtab_d +chtab_h +chtab_modify_key +chtab_modify_node +chtab_null +chtab_v +confignetwork_secondarynic_nicips_updatenode_false +confignetwork_secondarynic_nicnetworks_updatenode_false +confignetwork_secondarynic_nictype_updatenode_false +confignetwork_static_installnic +copycds_a +copycds_a_err +copycds_iso +copycds_n +copycds_n_a +copycds_n_err +dumpxCATdb_a_p_nullskiptables +dumpxCATdb_a_p_nullskiptables_V +dumpxCATdb_a_p_skiptables +dumpxCATdb_h +dumpxCATdb_p_V +dumpxCATdb_p_nullskiptables +dumpxCATdb_p_nullskiptables_V +dumpxCATdb_p_skiptables +dumpxCATdb_v +encrypted_passwd_md5_diskfull +encrypted_passwd_openssl_diskfull +encrypted_passwd_sha256_diskfull +encrypted_passwd_sha512_diskfull +getmacs_d +getmacs_f_D +getmacs_noderange +gettab_H +gettab_err +gettab_h +gettab_key_table +lsdef_a +lsdef_null +lsdef_t +lsdef_t_err +lsdef_t_i_o +lsdef_t_o_l +lsdef_t_o_l_z +lsdef_t_w +lslite_h +lslite_i +lslite_noderange +lsxcatd_a +lsxcatd_d +lsxcatd_h +lsxcatd_null +makeconservercf_d +makeconservercf_noderange +makeconservercf_null +makedhcp_a +makedhcp_a_d +makedhcp_d +makedhcp_n +makedhcp_remote_network +makedns +makedns_d_node +makedns_h +makedns_n +makedns_n_noderange +makehost_n_r +makehosts_d +makehosts_h +makehosts_help +makehosts_l +makehosts_n +makehosts_n_noderange +makehosts_null +makeknownhosts_node_d +makentp_h +makentp_v +mkdef_null +mkdef_regex_bmc +mkdef_regex_ip +mkdef_regex_kvm +mkdef_regex_nicsip +mkdef_t_o_error +mkdef_z +nodeadd_err_symbol +nodeadd_h +nodeadd_noderange +nodeadd_noderange_nodetype +nodeadd_null +nodeadd_v +nodech_delete +nodech_error_node +nodech_error_table +nodech_h +nodech_noderanage_table_at +nodech_noderange_shortname_groups +nodech_noderange_shortname_mgt +nodech_noderange_shortname_tags +nodech_noderange_table +nodech_noderange_table_arrow +nodech_noderange_table_comma +nodech_noderange_table_equal +nodech_noderange_table_include +nodech_noderange_table_unequal +nodech_noderange_table_uninclude +nodech_v +nodegrpch_err +nodegrpch_groups +nodegrpch_h +nodegrpch_v +nodels_H +nodels_S +nodels_b +nodels_err_noderange +nodels_err_symbol +nodels_h +nodels_noderange +nodels_noderange_shortname_groups +nodels_noderange_shortname_mgt +nodels_noderange_shortname_tags +nodels_noderange_table +nodels_noderange_table_equal +nodels_noderange_table_unequal +nodels_noderange_table_uninclude +nodels_noderange_tablecolumn +nodels_null +nodels_table_include +nodels_tablevalue +nodels_tablevalue_tablecolumn +nodels_v +noderange_10-20 +noderange_XCAT_NODE_PREFIX +noderange_XCAT_NODE_SUFFIX +noderange_exclusion +noderange_group1-group3 +noderange_group_intersection +noderange_individual_grp +noderange_individual_node +noderange_node01-node10 +noderm_err_node +noderm_h +noderm_noderange +noderm_null +nodeset_check_warninginfo +nodeset_errorcommand +nodeset_grub2 +nodeset_noderange +nodeset_stat +nodeset_yaboot +nodestat_err_node +nodestat_usage +packimage_h +packimage_m_invalid_archive_method +packimage_m_invalid_compress_method +packimage_v +pping_h +pping_invalidnode +pping_node +pping_v +prsync_dir_node +prsync_file_node +prsync_h +prsync_v +psh_h +psh_i +psh_l +psh_node_cmd_linux +psh_v +regnotif_err +regnotif_h +regnotif_null +regnotif_o +regnotif_v +restorexCAT_h +restorexCATdb_a_p_V +restorexCATdb_p_V +restorexCATdb_v +restorexCATdb_wrongpath +rinv_all +rinv_bus +rinv_config +rinv_firm +rinv_model +rinv_noderange_err +rinv_serial +rmdef_null +rmdef_t_err +rmimage_diskless +rpower_boot +rpower_err_noderange +rpower_noderange +rpower_noderange_nodeps +rpower_off +rpower_on +rpower_reset +rpower_stat +rscan_noderange +rscan_w +rscan_x +rscan_x_w +rscan_z +rscan_z_w +rvitals_all +rvitals_lcds +rvitals_noderange_err +tabdump_d +tabdump_d_nodehm +tabdump_f_d +tabdump_h +tabdump_help +tabdump_table +tabdump_v +tabdump_w_equal +tabdump_w_ge +tabdump_w_gt +tabdump_w_le +tabdump_w_lt +tabdump_w_match +tabdump_w_ne +tabdump_w_notmatch +tabgrep_err +tabgrep_h +tabgrep_node +tabgrep_null +tabprune_V_a_eventlog +tabprune_V_n_auditlog +tabprune_a_eventlog +tabprune_h +tabprune_i_auditlog +tabprune_p_auditlog +tabprune_v +tabrestore_err +tabrestore_h +tabrestore_null +tabrestore_table +unregnotif_f +unregnotif_h +unregnotif_null +unregnotif_v +updatenode_diskful_syncfiles_failing +xcatconfig_c +xcatconfig_u_check_xcatsslversion_rhels_sles +xcatstanzafile_attribute +xcatstanzafile_colon +xcatstanzafile_defaultvalue +xcatstanzafile_multattr +xcatstanzafile_normal +xcatstanzafile_objtype +xcatstanzafile_specificvalue +xcatstanzafile_tab diff --git a/xCAT-test/autotest/bundle/sles_ppc_weekly.bundle b/xCAT-test/autotest/bundle/sles_ppc_weekly.bundle new file mode 100644 index 000000000..898f66a67 --- /dev/null +++ b/xCAT-test/autotest/bundle/sles_ppc_weekly.bundle @@ -0,0 +1,14 @@ +#INCLUDE:sles_ppc_daily.bundle# +packimage_imagename +packimage_m_cpio_c_gzip +packimage_m_cpio_c_xz +packimage_m_tar_c_gzip +packimage_m_tar_c_xz +packimage_o_p_a_m +reg_linux_statelite_installation_hierarchy_by_nfs +reg_linux_statelite_installation_hierarchy_by_ramdisk +reg_linux_diskfull_installation_flat +reg_linux_diskless_installation_flat +reg_linux_statelite_installation_flat +sles_migration1 +sles_migration2 diff --git a/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle b/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle new file mode 100644 index 000000000..300ee1ea2 --- /dev/null +++ b/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle @@ -0,0 +1,249 @@ +SN_setup_case +reg_linux_diskless_installation_hierarchy +reg_linux_diskfull_installation_hierarchy +assign_certain_command_permission +bmcdiscover_help +bmcdiscover_q +bmcdiscover_version +xdcp_nonroot_user +xdsh_E +xdsh_Q_command +xdsh_T +xdsh_V +xdsh_c_cn +xdsh_e_filename +xdsh_h +xdsh_i_linux +xdsh_o +xdsh_permission_denied +xdsh_q +xdsh_regular_command +xdsh_t +chdef_nicips +chdef_null +chdef_site_check +chdef_t_o_error +chdef_z +chtab_d +chtab_err_symble +chtab_err_table +chtab_h +chtab_modify_key +chtab_modify_node +chtab_null +chtab_v +confignetwork_disable_set_to_1 +confignetwork_disable_set_to_yes +confignetwork_niccustomscripts +confignetwork_s_installnic_secondarynic_updatenode +confignetwork_secondarynic_nicaliases_updatenode +confignetwork_secondarynic_nicextraparams_updatenode +confignetwork_secondarynic_nicips_updatenode_false +confignetwork_secondarynic_nicnetworks_updatenode_false +confignetwork_secondarynic_nictype_updatenode_false +confignetwork_secondarynic_thirdnic_multiplevalue_updatenode +confignetwork_secondarynic_updatenode +confignetwork_static_installnic +copycds_a +copycds_a_err +copycds_iso +copycds_n +copycds_n_a +copycds_n_err +disable_root_permission_in_policy_table +dumpxCATdb_a_p_nullskiptables +dumpxCATdb_a_p_nullskiptables_V +dumpxCATdb_a_p_skiptables +dumpxCATdb_h +dumpxCATdb_p_V +dumpxCATdb_p_nullskiptables +dumpxCATdb_p_nullskiptables_V +dumpxCATdb_p_skiptables +dumpxCATdb_v +encrypted_passwd_md5_diskfull +encrypted_passwd_openssl_diskfull +encrypted_passwd_sha256_diskfull +encrypted_passwd_sha512_diskfull +gettab_H +gettab_err +gettab_h +gettab_key_table +lsdef_a +lsdef_null +lsdef_t +lsdef_t_err +lsdef_t_i_o +lsdef_t_o_l +lsdef_t_o_l_z +lsdef_t_w +lslite_h +lslite_i +lslite_noderange +lsxcatd_a +lsxcatd_d +lsxcatd_h +lsxcatd_null +makeconservercf_d +makeconservercf_noderange +makeconservercf_null +makedhcp_a +makedhcp_a_d +makedhcp_d +makedhcp_n +makedhcp_remote_network +makedns +makedns_d_node +makedns_n +makedns_n_noderange +makehost_n_r +makehosts_h +makehosts_help +makehosts_n +makehosts_n_noderange +makeknownhosts_node_d +mkdef_null +mkdef_regex_bmc +mkdef_regex_ip +mkdef_regex_kvm +mkdef_regex_nicsip +mkdef_t_o_error +mkdef_z +nodeadd_err_symbol +nodeadd_h +nodeadd_noderange +nodeadd_noderange_nodetype +nodeadd_null +nodeadd_v +nodech_delete +nodech_error_node +nodech_error_table +nodech_h +nodech_noderanage_table_at +nodech_noderange_shortname_groups +nodech_noderange_shortname_mgt +nodech_noderange_shortname_tags +nodech_noderange_table +nodech_noderange_table_arrow +nodech_noderange_table_comma +nodech_noderange_table_equal +nodech_noderange_table_include +nodech_noderange_table_unequal +nodech_noderange_table_uninclude +nodech_v +nodegrpch_err +nodegrpch_groups +nodegrpch_h +nodegrpch_v +nodels_H +nodels_S +nodels_b +nodels_err_noderange +nodels_err_symbol +nodels_h +nodels_noderange +nodels_noderange_shortname_groups +nodels_noderange_shortname_mgt +nodels_noderange_shortname_tags +nodels_noderange_table +nodels_noderange_table_equal +nodels_noderange_table_unequal +nodels_noderange_table_uninclude +nodels_noderange_tablecolumn +nodels_null +nodels_table_include +nodels_tablevalue +nodels_tablevalue_tablecolumn +nodels_v +noderm_err_node +noderm_h +noderm_noderange +noderm_null +nodeset_check_warninginfo +nodeset_disjointdhcps_petitboot +nodeset_errorcommand +nodeset_noderange +nodeset_shell_incorrectmasterip +nodeset_stat +nodeset_grub2 +nodeset_petitboot +nodestat_err_node +nodestat_usage +packimage_h +packimage_v +pping_h +pping_invalidnode +pping_node +pping_v +prsync_dir_node +prsync_file_node +prsync_h +prsync_v +psh_h +psh_i +psh_l +psh_node_cmd_linux +psh_v +regnotif_err +regnotif_h +regnotif_null +regnotif_o +regnotif_v +restorexCAT_h +restorexCATdb_a_p_V +restorexCATdb_p_V +restorexCATdb_v +restorexCATdb_wrongpath +rinv_noderange_err +rmdef_null +rmdef_t_err +rmimage_diskless +rpower_err_noderange +run_command_with_XCATBYPASS +rvitals_noderange_err +tabdump_d +tabdump_d_nodehm +tabdump_f_d +tabdump_h +tabdump_help +tabdump_table +tabdump_v +tabdump_w_equal +tabdump_w_ge +tabdump_w_gt +tabdump_w_le +tabdump_w_lt +tabdump_w_match +tabdump_w_ne +tabdump_w_notmatch +tabgrep_err +tabgrep_h +tabgrep_node +tabgrep_null +tabprune_V_a_eventlog +tabprune_V_n_auditlog +tabprune_a_eventlog +tabprune_h +tabprune_i_auditlog +tabprune_v +tabrestore_err +tabrestore_h +tabrestore_null +tabrestore_table +unregnotif_f +unregnotif_h +unregnotif_null +unregnotif_v +updatenode_diskful_syncfiles_failing +xcatconfig_c +xcatconfig_u_check_xcatsslversion_rhels_sles +xcatd_restart +xcatd_start +xcatd_stop +xcatstanzafile_attribute +xcatstanzafile_colon +xcatstanzafile_defaultvalue +xcatstanzafile_multattr +xcatstanzafile_normal +xcatstanzafile_objtype +xcatstanzafile_specificvalue +xcatstanzafile_tab diff --git a/xCAT-test/autotest/bundle/sles_ppcle_weekly.bundle b/xCAT-test/autotest/bundle/sles_ppcle_weekly.bundle new file mode 100644 index 000000000..08534fe14 --- /dev/null +++ b/xCAT-test/autotest/bundle/sles_ppcle_weekly.bundle @@ -0,0 +1,21 @@ +#INCLUDE:sles_ppcle_daily.bundle# +packimage_imagename +packimage_m_cpio_c_gzip +packimage_m_cpio_c_pigz +packimage_m_cpio_c_xz +packimage_m_invalid_archive_method +packimage_m_invalid_compress_method +packimage_m_tar_c_gzip +packimage_m_tar_c_pigz +packimage_m_tar_c_xz +packimage_o_p_a_m +reg_linux_statelite_installation_hierarchy_by_nfs +reg_linux_statelite_installation_hierarchy_by_ramdisk +nodeset_cmdline +nodeset_runimg +nodeset_shell +reg_linux_diskfull_installation_flat +reg_linux_diskless_installation_flat +reg_linux_statelite_installation_flat +sles_migration1 +sles_migration2 diff --git a/xCAT-test/autotest/bundle/sles_x86_daily.bundle b/xCAT-test/autotest/bundle/sles_x86_daily.bundle new file mode 100644 index 000000000..d90a2bfd5 --- /dev/null +++ b/xCAT-test/autotest/bundle/sles_x86_daily.bundle @@ -0,0 +1,248 @@ +SN_setup_case +reg_linux_diskless_installation_hierarchy +reg_linux_diskfull_installation_hierarchy +assign_certain_command_permission +bmcdiscover_help +bmcdiscover_q +bmcdiscover_version +xdcp_nonroot_user +xdsh_E +xdsh_Q_command +xdsh_T +xdsh_V +xdsh_c_cn +xdsh_e_filename +xdsh_h +xdsh_i_linux +xdsh_o +xdsh_permission_denied +xdsh_q +xdsh_regular_command +xdsh_t +chdef_nicips +chdef_null +chdef_site_check +chdef_t_o_error +chdef_z +chtab_d +chtab_err_symble +chtab_err_table +chtab_h +chtab_modify_key +chtab_modify_node +chtab_null +chtab_v +confignetwork_disable_set_to_1 +confignetwork_disable_set_to_yes +confignetwork_niccustomscripts +confignetwork_s_installnic_secondarynic_updatenode +confignetwork_secondarynic_nicaliases_updatenode +confignetwork_secondarynic_nicextraparams_updatenode +confignetwork_secondarynic_nicips_updatenode_false +confignetwork_secondarynic_nicnetworks_updatenode_false +confignetwork_secondarynic_nictype_updatenode_false +confignetwork_secondarynic_thirdnic_multiplevalue_updatenode +confignetwork_secondarynic_updatenode +confignetwork_static_installnic +copycds_a +copycds_a_err +copycds_iso +copycds_n +copycds_n_a +copycds_n_err +disable_root_permission_in_policy_table +dumpxCATdb_a_p_nullskiptables +dumpxCATdb_a_p_nullskiptables_V +dumpxCATdb_a_p_skiptables +dumpxCATdb_h +dumpxCATdb_p_V +dumpxCATdb_p_nullskiptables +dumpxCATdb_p_nullskiptables_V +dumpxCATdb_p_skiptables +dumpxCATdb_v +encrypted_passwd_md5_diskfull +encrypted_passwd_openssl_diskfull +encrypted_passwd_sha256_diskfull +encrypted_passwd_sha512_diskfull +gettab_H +gettab_err +gettab_h +gettab_key_table +lsdef_a +lsdef_null +lsdef_t +lsdef_t_err +lsdef_t_i_o +lsdef_t_o_l +lsdef_t_o_l_z +lsdef_t_w +lslite_h +lslite_i +lslite_noderange +lsxcatd_a +lsxcatd_d +lsxcatd_h +lsxcatd_null +makeconservercf_d +makeconservercf_noderange +makeconservercf_null +makedhcp_a +makedhcp_a_d +makedhcp_d +makedhcp_n +makedhcp_remote_network +makedns +makedns_d_node +makedns_n +makedns_n_noderange +makehost_n_r +makehosts_h +makehosts_help +makehosts_n +makehosts_n_noderange +makeknownhosts_node_d +mkdef_null +mkdef_regex_bmc +mkdef_regex_ip +mkdef_regex_kvm +mkdef_regex_nicsip +mkdef_t_o_error +mkdef_z +nodeadd_err_symbol +nodeadd_h +nodeadd_noderange +nodeadd_noderange_nodetype +nodeadd_null +nodeadd_v +nodech_delete +nodech_error_node +nodech_error_table +nodech_h +nodech_noderanage_table_at +nodech_noderange_shortname_groups +nodech_noderange_shortname_mgt +nodech_noderange_shortname_tags +nodech_noderange_table +nodech_noderange_table_arrow +nodech_noderange_table_comma +nodech_noderange_table_equal +nodech_noderange_table_include +nodech_noderange_table_unequal +nodech_noderange_table_uninclude +nodech_v +nodegrpch_err +nodegrpch_groups +nodegrpch_h +nodegrpch_v +nodels_H +nodels_S +nodels_b +nodels_err_noderange +nodels_err_symbol +nodels_h +nodels_noderange +nodels_noderange_shortname_groups +nodels_noderange_shortname_mgt +nodels_noderange_shortname_tags +nodels_noderange_table +nodels_noderange_table_equal +nodels_noderange_table_unequal +nodels_noderange_table_uninclude +nodels_noderange_tablecolumn +nodels_null +nodels_table_include +nodels_tablevalue +nodels_tablevalue_tablecolumn +nodels_v +noderm_err_node +noderm_h +noderm_noderange +noderm_null +nodeset_check_warninginfo +nodeset_errorcommand +nodeset_noderange +nodeset_shell_incorrectmasterip +nodeset_stat +nodeset_xnba +nodestat_err_node +nodestat_noderange +nodestat_usage +packimage_h +packimage_v +pping_h +pping_invalidnode +pping_node +pping_v +prsync_dir_node +prsync_file_node +prsync_h +prsync_v +psh_h +psh_i +psh_l +psh_node_cmd_linux +psh_v +regnotif_err +regnotif_h +regnotif_null +regnotif_o +regnotif_v +restorexCAT_h +restorexCATdb_a_p_V +restorexCATdb_p_V +restorexCATdb_v +restorexCATdb_wrongpath +rinv_noderange_err +rmdef_null +rmdef_t_err +rmimage_diskless +rpower_err_noderange +run_command_with_XCATBYPASS +rvitals_noderange_err +tabdump_d +tabdump_d_nodehm +tabdump_f_d +tabdump_h +tabdump_help +tabdump_table +tabdump_v +tabdump_w_equal +tabdump_w_ge +tabdump_w_gt +tabdump_w_le +tabdump_w_lt +tabdump_w_match +tabdump_w_ne +tabdump_w_notmatch +tabgrep_err +tabgrep_h +tabgrep_node +tabgrep_null +tabprune_V_a_eventlog +tabprune_V_n_auditlog +tabprune_a_eventlog +tabprune_h +tabprune_i_auditlog +tabprune_v +tabrestore_err +tabrestore_h +tabrestore_null +tabrestore_table +unregnotif_f +unregnotif_h +unregnotif_null +unregnotif_v +updatenode_diskful_syncfiles_failing +xcatconfig_c +xcatconfig_u_check_xcatsslversion_rhels_sles +xcatd_restart +xcatd_start +xcatd_stop +xcatstanzafile_attribute +xcatstanzafile_colon +xcatstanzafile_defaultvalue +xcatstanzafile_multattr +xcatstanzafile_normal +xcatstanzafile_objtype +xcatstanzafile_specificvalue +xcatstanzafile_tab diff --git a/xCAT-test/autotest/bundle/sles_x86_weekly.bundle b/xCAT-test/autotest/bundle/sles_x86_weekly.bundle new file mode 100644 index 000000000..f6928afe4 --- /dev/null +++ b/xCAT-test/autotest/bundle/sles_x86_weekly.bundle @@ -0,0 +1,21 @@ +#INCLUDE:sles_x86_daily.bundle# +packimage_imagename +packimage_m_cpio_c_gzip +packimage_m_cpio_c_pigz +packimage_m_cpio_c_xz +packimage_m_invalid_archive_method +packimage_m_invalid_compress_method +packimage_m_tar_c_gzip +packimage_m_tar_c_pigz +packimage_m_tar_c_xz +packimage_o_p_a_m +reg_linux_statelite_installation_hierarchy_by_nfs +reg_linux_statelite_installation_hierarchy_by_ramdisk +nodeset_cmdline +nodeset_runimg +nodeset_shell +reg_linux_diskfull_installation_flat +reg_linux_diskless_installation_flat +reg_linux_statelite_installation_flat +sles_migration1 +sles_migration2 diff --git a/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle b/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle new file mode 100644 index 000000000..b1cc64c19 --- /dev/null +++ b/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle @@ -0,0 +1,229 @@ +reg_linux_diskless_installation_flat +reg_linux_diskfull_installation_flat +assign_certain_command_permission +bmcdiscover_help +bmcdiscover_q +bmcdiscover_version +chdef_nicips +chdef_null +chdef_site_check +chdef_t_o_error +chdef_z +chtab_d +chtab_h +chtab_modify_key +chtab_modify_node +chtab_null +chtab_v +confignetwork_secondarynic_nicips_updatenode_false +confignetwork_secondarynic_nicnetworks_updatenode_false +confignetwork_secondarynic_nictype_updatenode_false +confignetwork_static_installnic +copycds_a +copycds_a_err +copycds_iso +copycds_n +copycds_n_a +copycds_n_err +disable_root_permission_in_policy_table +dumpxCATdb_a_p_nullskiptables +dumpxCATdb_a_p_nullskiptables_V +dumpxCATdb_a_p_skiptables +dumpxCATdb_h +dumpxCATdb_p_V +dumpxCATdb_p_nullskiptables +dumpxCATdb_p_nullskiptables_V +dumpxCATdb_p_skiptables +dumpxCATdb_v +encrypted_passwd_md5_diskfull +encrypted_passwd_openssl_diskfull +encrypted_passwd_sha256_diskfull +encrypted_passwd_sha512_diskfull +gettab_H +gettab_err +gettab_h +gettab_key_table +lsdef_a +lsdef_null +lsdef_t +lsdef_t_err +lsdef_t_i_o +lsdef_t_o_l +lsdef_t_o_l_z +lsdef_t_w +lsxcatd_a +lsxcatd_d +lsxcatd_h +lsxcatd_null +makeconservercf_d +makeconservercf_noderange +makeconservercf_null +makedhcp_a_ubuntu +makedhcp_d +makedhcp_n +makedhcp_remote_network +makedns_d_node +makedns_n_noderange +makedns_ubuntu_n +makehost_n_r +makehosts_h +makehosts_help +makehosts_n +makehosts_n_noderange +makeknownhosts_node_d +mkdef_null +mkdef_regex_bmc +mkdef_regex_ip +mkdef_regex_kvm +mkdef_regex_nicsip +mkdef_t_o_error +mkdef_z +nodeadd_err_symbol +nodeadd_h +nodeadd_noderange +nodeadd_noderange_nodetype +nodeadd_null +nodeadd_v +nodech_delete +nodech_error_node +nodech_error_table +nodech_h +nodech_noderanage_table_at +nodech_noderange_shortname_groups +nodech_noderange_shortname_mgt +nodech_noderange_shortname_tags +nodech_noderange_table +nodech_noderange_table_arrow +nodech_noderange_table_comma +nodech_noderange_table_equal +nodech_noderange_table_include +nodech_noderange_table_unequal +nodech_noderange_table_uninclude +nodech_v +nodegrpch_err +nodegrpch_groups +nodegrpch_h +nodegrpch_v +nodels_H +nodels_S +nodels_b +nodels_err_noderange +nodels_err_symbol +nodels_h +nodels_noderange +nodels_noderange_shortname_groups +nodels_noderange_shortname_mgt +nodels_noderange_shortname_tags +nodels_noderange_table +nodels_noderange_table_equal +nodels_noderange_table_unequal +nodels_noderange_table_uninclude +nodels_noderange_tablecolumn +nodels_null +nodels_table_include +nodels_tablevalue +nodels_tablevalue_tablecolumn +nodels_v +noderm_err_node +noderm_h +noderm_noderange +noderm_null +nodeset_errorcommand +nodeset_check_warninginfo +nodeset_grub2 +nodeset_noderange +nodeset_petitboot +nodeset_shell_incorrectmasterip +nodeset_stat +nodestat_err_node +nodestat_usage +packimage_h +packimage_v +pping_h +pping_invalidnode +pping_node +pping_v +prsync_dir_node +prsync_file_node +prsync_h +prsync_v +psh_h +psh_i +psh_l +psh_node_cmd_linux +psh_v +regnotif_err +regnotif_h +regnotif_null +regnotif_o +regnotif_v +restorexCAT_h +restorexCATdb_a_p_V +restorexCATdb_p_V +restorexCATdb_v +restorexCATdb_wrongpath +rmdef_null +rmdef_t_err +rpower_err_noderange +run_command_with_XCATBYPASS +rvitals_noderange_err +tabdump_d +tabdump_d_nodehm +tabdump_f_d +tabdump_h +tabdump_help +tabdump_table +tabdump_v +tabdump_w_equal +tabdump_w_ge +tabdump_w_gt +tabdump_w_le +tabdump_w_lt +tabdump_w_match +tabdump_w_ne +tabdump_w_notmatch +tabgrep_err +tabgrep_h +tabgrep_node +tabgrep_null +tabprune_V_a_eventlog +tabprune_V_n_auditlog +tabprune_a_eventlog +tabprune_h +tabprune_i_auditlog +tabprune_v +tabrestore_err +tabrestore_h +tabrestore_null +tabrestore_table +unregnotif_f +unregnotif_h +unregnotif_null +unregnotif_v +updatenode_diskful_syncfiles_failing +xcatconfig_c +xcatconfig_u_check_xcatsslversion_ubuntu +xcatd_restart +xcatd_start +xcatd_stop +xcatstanzafile_attribute +xcatstanzafile_colon +xcatstanzafile_defaultvalue +xcatstanzafile_multattr +xcatstanzafile_normal +xcatstanzafile_objtype +xcatstanzafile_specificvalue +xcatstanzafile_tab +xdcp_nonroot_user +xdsh_E +xdsh_Q_command +xdsh_T +xdsh_V +xdsh_c_cn +xdsh_e_filename +xdsh_h +xdsh_o +xdsh_permission_denied +xdsh_q +xdsh_regular_command +xdsh_t diff --git a/xCAT-test/autotest/bundle/ubuntu_ppcle_weekly.bundle b/xCAT-test/autotest/bundle/ubuntu_ppcle_weekly.bundle new file mode 100644 index 000000000..f45b09f29 --- /dev/null +++ b/xCAT-test/autotest/bundle/ubuntu_ppcle_weekly.bundle @@ -0,0 +1,16 @@ +#INCLUDE:ubuntu_ppcle_daily.bundle# +nodeset_cmdline +nodeset_runimg +nodeset_shell +packimage_imagename +packimage_m_cpio_c_gzip +packimage_m_cpio_c_pigz +packimage_m_cpio_c_xz +packimage_m_invalid_archive_method +packimage_m_invalid_compress_method +packimage_m_tar_c_gzip +packimage_m_tar_c_pigz +packimage_m_tar_c_xz +packimage_o_p_a_m +rmimage_diskless +ubuntu_migration2_p8le diff --git a/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle b/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle new file mode 100644 index 000000000..52fc1f477 --- /dev/null +++ b/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle @@ -0,0 +1,229 @@ +reg_linux_diskless_installation_flat +reg_linux_diskfull_installation_flat +assign_certain_command_permission +bmcdiscover_help +bmcdiscover_q +bmcdiscover_version +chdef_nicips +chdef_null +chdef_site_check +chdef_t_o_error +chdef_z +chtab_d +chtab_h +chtab_modify_key +chtab_modify_node +chtab_null +chtab_v +confignetwork_secondarynic_nicips_updatenode_false +confignetwork_secondarynic_nicnetworks_updatenode_false +confignetwork_secondarynic_nictype_updatenode_false +confignetwork_static_installnic +copycds_a +copycds_a_err +copycds_iso +copycds_n +copycds_n_a +copycds_n_err +disable_root_permission_in_policy_table +dumpxCATdb_a_p_nullskiptables +dumpxCATdb_a_p_nullskiptables_V +dumpxCATdb_a_p_skiptables +dumpxCATdb_h +dumpxCATdb_p_V +dumpxCATdb_p_nullskiptables +dumpxCATdb_p_nullskiptables_V +dumpxCATdb_p_skiptables +dumpxCATdb_v +encrypted_passwd_md5_diskfull +encrypted_passwd_openssl_diskfull +encrypted_passwd_sha256_diskfull +encrypted_passwd_sha512_diskfull +gettab_H +gettab_err +gettab_h +gettab_key_table +lsdef_a +lsdef_null +lsdef_t +lsdef_t_err +lsdef_t_i_o +lsdef_t_o_l +lsdef_t_o_l_z +lsdef_t_w +lsxcatd_a +lsxcatd_d +lsxcatd_h +lsxcatd_null +makeconservercf_d +makeconservercf_noderange +makeconservercf_null +makedhcp_a_ubuntu +makedhcp_d +makedhcp_n +makedhcp_remote_network +makedns_d_node +makedns_n_noderange +makedns_ubuntu_n +makehost_n_r +makehosts_h +makehosts_help +makehosts_n +makehosts_n_noderange +makeknownhosts_node_d +mkdef_null +mkdef_regex_bmc +mkdef_regex_ip +mkdef_regex_kvm +mkdef_regex_nicsip +mkdef_t_o_error +mkdef_z +nodeadd_err_symbol +nodeadd_h +nodeadd_noderange +nodeadd_noderange_nodetype +nodeadd_null +nodeadd_v +nodech_delete +nodech_error_node +nodech_error_table +nodech_h +nodech_noderanage_table_at +nodech_noderange_shortname_groups +nodech_noderange_shortname_mgt +nodech_noderange_shortname_tags +nodech_noderange_table +nodech_noderange_table_arrow +nodech_noderange_table_comma +nodech_noderange_table_equal +nodech_noderange_table_include +nodech_noderange_table_unequal +nodech_noderange_table_uninclude +nodech_v +nodegrpch_err +nodegrpch_groups +nodegrpch_h +nodegrpch_v +nodels_H +nodels_S +nodels_b +nodels_err_noderange +nodels_err_symbol +nodels_h +nodels_noderange +nodels_noderange_shortname_groups +nodels_noderange_shortname_mgt +nodels_noderange_shortname_tags +nodels_noderange_table +nodels_noderange_table_equal +nodels_noderange_table_unequal +nodels_noderange_table_uninclude +nodels_noderange_tablecolumn +nodels_null +nodels_table_include +nodels_tablevalue +nodels_tablevalue_tablecolumn +nodels_v +noderm_err_node +noderm_h +noderm_noderange +noderm_null +nodeset_errorcommand +nodeset_check_warninginfo +nodeset_noderange +nodeset_xnba +nodeset_shell_incorrectmasterip +nodeset_stat +nodestat_err_node +nodestat_usage +nodestat_noderange +packimage_h +packimage_v +pping_h +pping_invalidnode +pping_node +pping_v +prsync_dir_node +prsync_file_node +prsync_h +prsync_v +psh_h +psh_i +psh_l +psh_node_cmd_linux +psh_v +regnotif_err +regnotif_h +regnotif_null +regnotif_o +regnotif_v +restorexCAT_h +restorexCATdb_a_p_V +restorexCATdb_p_V +restorexCATdb_v +restorexCATdb_wrongpath +rmdef_null +rmdef_t_err +rpower_err_noderange +run_command_with_XCATBYPASS +rvitals_noderange_err +tabdump_d +tabdump_d_nodehm +tabdump_f_d +tabdump_h +tabdump_help +tabdump_table +tabdump_v +tabdump_w_equal +tabdump_w_ge +tabdump_w_gt +tabdump_w_le +tabdump_w_lt +tabdump_w_match +tabdump_w_ne +tabdump_w_notmatch +tabgrep_err +tabgrep_h +tabgrep_node +tabgrep_null +tabprune_V_a_eventlog +tabprune_V_n_auditlog +tabprune_a_eventlog +tabprune_h +tabprune_i_auditlog +tabprune_v +tabrestore_err +tabrestore_h +tabrestore_null +tabrestore_table +unregnotif_f +unregnotif_h +unregnotif_null +unregnotif_v +updatenode_diskful_syncfiles_failing +xcatconfig_c +xcatconfig_u_check_xcatsslversion_ubuntu +xcatd_restart +xcatd_start +xcatd_stop +xcatstanzafile_attribute +xcatstanzafile_colon +xcatstanzafile_defaultvalue +xcatstanzafile_multattr +xcatstanzafile_normal +xcatstanzafile_objtype +xcatstanzafile_specificvalue +xcatstanzafile_tab +xdcp_nonroot_user +xdsh_E +xdsh_Q_command +xdsh_T +xdsh_V +xdsh_c_cn +xdsh_e_filename +xdsh_h +xdsh_o +xdsh_permission_denied +xdsh_q +xdsh_regular_command +xdsh_t diff --git a/xCAT-test/autotest/bundle/ubuntu_x86_weekly.bundle b/xCAT-test/autotest/bundle/ubuntu_x86_weekly.bundle new file mode 100644 index 000000000..c25018857 --- /dev/null +++ b/xCAT-test/autotest/bundle/ubuntu_x86_weekly.bundle @@ -0,0 +1,16 @@ +#INCLUDE:ubuntu_x86_daily.bundle# +nodeset_cmdline +nodeset_runimg +nodeset_shell +packimage_imagename +packimage_m_cpio_c_gzip +packimage_m_cpio_c_pigz +packimage_m_cpio_c_xz +packimage_m_invalid_archive_method +packimage_m_invalid_compress_method +packimage_m_tar_c_gzip +packimage_m_tar_c_pigz +packimage_m_tar_c_xz +packimage_o_p_a_m +rmimage_diskless +ubuntu_migration2_vm diff --git a/xCAT-test/autotest/testcase/chdef/cases0 b/xCAT-test/autotest/testcase/chdef/cases0 index ff35b1aad..dc3c0ab03 100644 --- a/xCAT-test/autotest/testcase/chdef/cases0 +++ b/xCAT-test/autotest/testcase/chdef/cases0 @@ -273,3 +273,46 @@ check:output=~300 cmd:if [ -f /tmp/sitevalue ];then var=`cat /tmp/sitevalue`;chdef -t site clustersite dhcplease=$var;rm -rf /tmp/sitevalue;fi check:rc==0 end + +start:chdef_network_not_exist +description:This case is use to create a network, but not set net and mask. +label:mn_only,db +cmd:chdef -t network aaaaa_not_exist +check:output=~No object definitions have been created or modified +#check:rc!=0 +cmd:chdef -t network aaaaa_not_exist mtu=1500 +check:rc!=0 +check:output=~Net or mask value should not be empty +cmd:chdef -t network aaaaa_not_exist mtu=1500 net=10.0.0.0 +check:rc!=0 +check:output=~Net or mask value should not be empty +cmd:chdef -t network aaaaa_not_exist mtu=1500 mask=255.255.255.0 +check:rc!=0 +check:output=~Net or mask value should not be empty +cmd:chdef -t network aaaaa_not_exist mask=255.255.255.0 net=100.0.0.0 mtu=1500 +check:rc==0 +check:output=~1 object definitions have been created or modified +cmd:lsdef -t network aaaaa_not_exist +check:rc==0 +cmd:chdef -t network aaaaa_not_exist gateway=10.0.0.101 +check:rc==0 +cmd:lsdef -t network aaaaa_not_exist -i gateway +check:output=~10.0.0.101 +cmd:chdef -t network bbbbb_not_exist mask=255.255.255.0 net=100.0.0.0 +check:rc!=0 +check:output=~A network definition called 'aaaaa_not_exist' already exists +cmd:echo ' +bbbbb_not_exist: + objtype=network + net=150.0.0.0 +' > /tmp/bbbbb_not_exist.def +cmd:cat /tmp/bbbbb_not_exist.def |mkdef -z +check:rc!=0 +check:output=~Net or mask value should not be empty +cmd:lsdef -t network -o bbbbb_not_exist +check:rc!=0 +cmd:rmdef -t network -o aaaaa_not_exist +check:rc==0 +cmd:rm -rf /tmp/bbbbb_not_exist.def +end + diff --git a/xCAT-test/autotest/testcase/chtab/cases0 b/xCAT-test/autotest/testcase/chtab/cases0 index b0191bd38..68ad379e8 100644 --- a/xCAT-test/autotest/testcase/chtab/cases0 +++ b/xCAT-test/autotest/testcase/chtab/cases0 @@ -79,7 +79,7 @@ description:chtab with error table label:mn_only,ci_test,db cmd:chtab error=error site.comment=error check:rc!=0 -check:output=~no such column|column \"error\" does not exist +check:output=~no such column|column \"error\" does not exist|Unknown column \'error\' end diff --git a/xCAT-test/autotest/testcase/commoncmd/retry_install.sh b/xCAT-test/autotest/testcase/commoncmd/retry_install.sh new file mode 100755 index 000000000..4986e344f --- /dev/null +++ b/xCAT-test/autotest/testcase/commoncmd/retry_install.sh @@ -0,0 +1,69 @@ +#!/bin/bash + +declare -i installsuccess=0 +declare -i a=0 +declare -i tryreinstall=1 +node=$1 +osimage=$2 + +if [ $# -eq 3 ]; +then + times=$3+1 + echo "Try to retry rinstall $3 times ......" +else + times=6 + echo "Try to retry rinstall 5 times ......" +fi + + +for (( tryreinstall = 1 ; tryreinstall < $times ; ++tryreinstall )) +do + echo "Try to install $node on the $tryreinstall time..." + + echo "rinstall $node osimage=$osimage" + rinstall $node osimage=$osimage + if [ $? != 0 ];then + echo "rinstall failed, double check xcat command rinstall to see if it is a bug..." + exit 1 + fi + + #sleep while for installation. + sleep 360 + while [ ! `lsdef -l $node|grep status|grep booted` ] + do + sleep 10 + echo "The status is not booted..." + a=++a + if [ $a -gt 400 ];then + a=0 + break + fi + done + + lsdef -l $node|grep status|grep booted + tobooted=$? + echo "The tobooted is $tobooted" + + ping -c 2 $node + pingable=$? + echo "The pingable is $pingable" + + xdsh $node date + canruncmd=$? + echo "The canruncmd is $canruncmd" + + if [[ $canruncmd -eq 0 && $tobooted -eq 0 && $pingable -eq 0 ]];then + echo "The provision succeed on the $tryreinstall time....." + installsuccess=1 + break + fi + +done + +if [ $installsuccess -eq 1 ];then + echo "The provision succeed......" + exit 0 +else + echo "The provision failed......" + exit 1 +fi diff --git a/xCAT-test/autotest/testcase/confignetwork/cases0 b/xCAT-test/autotest/testcase/confignetwork/cases0 index 127e9c2f7..34bcc43b2 100644 --- a/xCAT-test/autotest/testcase/confignetwork/cases0 +++ b/xCAT-test/autotest/testcase/confignetwork/cases0 @@ -22,7 +22,7 @@ cmd:copycds $$ISO check:rc==0 cmd:chdef $$CN postscripts="confignetwork -s" check:rc==0 -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 cmd:sleep 300 cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 20;((a++));if [ $a -gt 300 ];then break;fi done @@ -32,10 +32,12 @@ check:output=~64 bytes from $$CN cmd:lsdef -l $$CN | grep status check:rc==0 check:output=~booted -cmd:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$installnic"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$installnic"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi +cmd:xdsh $$CN hostname +check:output=~$$CN +cmd:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$installnic"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$installnic"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep __GETNODEATTR($$CN,ip)__ /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi check:rc==0 check:output=~__GETNODEATTR($$CN,ip)__ -check:output!~dhcp +check:output=~BOOTPROTO=none|static cmd:chdef -m -t node $$CN postscripts="confignetwork -s" check:rc==0 end @@ -70,7 +72,7 @@ cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-comput check:rc==0 cmd:packimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 cmd:sleep 180 cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 60 ];then break;fi done @@ -80,10 +82,12 @@ check:output=~64 bytes from $$CN cmd:lsdef -l $$CN | grep status check:rc==0 check:output=~booted -cmd:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$installnic"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$installnic"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi +cmd:xdsh $$CN hostname +check:output=~$$CN +cmd:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$installnic"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$installnic"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi check:rc==0 check:output=~__GETNODEATTR($$CN,ip)__ -check:output!~dhcp +check:output=~BOOTPROTO=none|static cmd:chdef -m -t node $$CN postbootscripts="confignetwork -s" check:rc==0 cmd:if [ -d $rootimgdir.regbak ]; then mv $rootimgdir.regbak $rootimgdir -f;fi @@ -123,7 +127,7 @@ cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-comput check:rc==0 cmd:packimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 cmd:sleep 180 cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 60 ];then break;fi done @@ -133,14 +137,14 @@ check:output=~64 bytes from $$CN cmd:lsdef -l $$CN | grep status check:rc==0 check:output=~booted -cmd:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$installnic"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$installnic"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces";else echo "Sorry,this is not supported os"; fi +cmd:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$installnic"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$installnic"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces";else echo "Sorry,this is not supported os"; fi check:rc==0 check:output=~__GETNODEATTR($$CN,ip)__ -check:output!~dhcp -cmd:secondarynic=`xdsh $$CN ip addr |grep 100.1.0.100|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$secondarynic"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$secondarynic"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces";else echo "Sorry,this is not supported os"; fi +check:output=~BOOTPROTO=none|static +cmd:secondarynic=`xdsh $$CN ip addr |grep 100.1.0.100|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$secondarynic"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$secondarynic"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces";else echo "Sorry,this is not supported os"; fi check:rc==0 check:output=~100.1.0.100 -check:output!~dhcp +check:output=~BOOTPROTO=none|static cmd:chdef -m -t node $$CN postbootscripts="confignetwork -s" check:rc==0 cmd:if [ -d $rootimgdir.regbak ]; then mv $rootimgdir.regbak $rootimgdir -f;fi @@ -158,27 +162,28 @@ check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/;cp -f /etc/network/interfaces /tmp";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/;cp -f /etc/network/interfaces /tmp";else echo "Sorry,this is not supported os"; fi check:rc==0 -cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 -cmd:chdef $$CN nicips.$$SECONDNIC=11.1.0.100 nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=11_1_0_0-255_255_0_0 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 check:rc==0 cmd:updatenode $$CN -P "confignetwork -s" check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi -check:output=~11.1.0.100 -cmd:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$installnic"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$installnic"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi -check:rc==0 -check:output=~__GETNODEATTR($$CN,ip)__ -check:output!~dhcp -cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 -cmd:xdsh $$CN "ip addr del 11.1.0.100/16 dev $$SECONDNIC" -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi -check:rc==0 +cmd:rmdef -t network -o confignetworks_test1 cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;if grep SUSE /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $second1ip /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$installnic"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-*$installnic*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi +check:rc==0 +check:output=~__GETNODEATTR($$CN,ip)__ +check:output=~BOOTPROTO=none|static +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi +cmd:xdsh $$CN "systemctl status NetworkManager >/dev/null 2>/dev/null && which nmcli >/dev/null 2>/dev/null && nmcli con reload" cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces" end @@ -190,7 +195,7 @@ check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC mtu=1496 check:rc==0 @@ -198,17 +203,18 @@ cmd:chdef $$CN nicips.$$SECONDNIC=11.1.0.100 nictypes.$$SECONDNIC=Ethernet nicne check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi -check:output=~11.1.0.100 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep MTU /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep MTU /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep mtu /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi -check:output=~MTU=1496|mtu 1496 -cmd:xdsh $$CN "ip addr del 11.1.0.100/16 dev $$SECONDNIC" cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi -check:rc==0 cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +check:output=~11.1.0.100 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep MTU /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep -i MTU /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep mtu /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +check:output=~MTU=1496|mtu 1496 +cmd:xdsh $$CN "ip addr del 11.1.0.100/16 dev $$SECONDNIC" +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/";else echo "Sorry,this is not supported os"; fi +cmd:xdsh $$CN "systemctl status NetworkManager >/dev/null 2>/dev/null && which nmcli >/dev/null 2>/dev/null && nmcli con reload" cmd:xdsh $$CN "rm -rf /tmp/backupnet/" end @@ -220,7 +226,7 @@ check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:cp -f /etc/hosts /etc/hosts.bak cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC @@ -236,22 +242,22 @@ check:output=~aliases1-1 aliases1-1-1 check:output=~aliases1-2 cmd:updatenode $$CN -P confignetwork check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi check:output=~11.1.0.100 -check:output!~dhcp -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi +check:output=~BOOTPROTO=none|static +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi check:output=~12.1.0.100 -check:output!~dhcp +check:output=~BOOTPROTO=none|static cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 cmd:rmdef -t network -o 12_1_0_0-255_255_0_0 cmd:xdsh $$CN "ip addr del 11.1.0.100/16 dev $$SECONDNIC" cmd:xdsh $$CN "ip addr del 12.1.0.100/16 dev $$SECONDNIC" -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -f /etc/network/interfaces.d/$$SECONDNIC /etc/network/interfaces.d/$$SECONDNIC:1";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -f /etc/network/interfaces.d/$$SECONDNIC /etc/network/interfaces.d/$$SECONDNIC:1";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 cmd:mv -f /etc/hosts.bak /etc/hosts -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/";else echo "Sorry,this is not supported os"; fi cmd:xdsh $$CN "rm -rf /tmp/backupnet/" end @@ -263,14 +269,14 @@ check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:cp -f /etc/hosts /etc/hosts.bak -cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 -cmd:mkdef -t network -o 12_1_0_0-255_255_0_0 net=12.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=101.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test2 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 -cmd:chdef $$CN nicips.$$SECONDNIC="11.1.0.100|12.1.0.100" nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC="11_1_0_0-255_255_0_0|12_1_0_0-255_255_0_0" nichostnamesuffixes.$$SECONDNIC="-$$SECONDNIC-1|-$$SECONDNIC-2" nicextraparams.$$SECONDNIC="CONNECTED_MODE=yes" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=101;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var3;second2ip=$var2$var3;chdef $$CN nicips.$$SECONDNIC="$second1ip|$second2ip" nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC="confignetworks_test1|confignetworks_test2" nichostnamesuffixes.$$SECONDNIC="-$$SECONDNIC-1|-$$SECONDNIC-2" nicextraparams.$$SECONDNIC="CONNECTED_MODE=yes" check:rc==0 cmd:makehosts $$CN check:rc==0 @@ -279,23 +285,26 @@ check:output=~$$CN-$$SECONDNIC-1 check:output=~$$CN-$$SECONDNIC-2 cmd:updatenode $$CN -P confignetwork check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi -check:output=~11.1.0.100 -check:output!~dhcp -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi -check:output=~12.1.0.100 -check:output=~CONNECTED_MODE=yes|CONNECTED_MODE yes -check:output!~dhcp -cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 -cmd:rmdef -t network -o 12_1_0_0-255_255_0_0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -f /etc/network/interfaces.d/$$SECONDNIC /etc/network/interfaces.d/$$SECONDNIC:1";else echo "Sorry,this is not supported os"; fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $second1ip /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 -cmd:xdsh $$CN "ip addr del 11.1.0.100/16 dev $$SECONDNIC" -cmd:xdsh $$CN "ip addr del 12.1.0.100/16 dev $$SECONDNIC" +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +check:output=~BOOTPROTO=none|static +check:output=~CONNECTED_MODE=yes|CONNECTED_MODE yes +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $second1ip /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +check:output=~CONNECTED_MODE=yes|CONNECTED_MODE yes +check:output=~BOOTPROTO=none|static +cmd:rmdef -t network -o confignetworks_test1 +cmd:rmdef -t network -o confignetworks_test2 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -f /etc/network/interfaces.d/$$SECONDNIC /etc/network/interfaces.d/$$SECONDNIC:1";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 cmd:mv -f /etc/hosts.bak /etc/hosts -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/";else echo "Sorry,this is not supported os"; fi cmd:xdsh $$CN "rm -rf /tmp/backupnet/" end @@ -364,7 +373,7 @@ cmd:chtab node=$$CN nics.disable=yes check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:output!~11.1.0.100 cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 check:rc==0 @@ -385,7 +394,7 @@ cmd:chtab node=$$CN nics.disable=1 check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:output!~11.1.0.100 cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 check:rc==0 @@ -429,7 +438,7 @@ check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 @@ -454,21 +463,21 @@ check:output=~$$CN-$$THIRDNIC-1 check:output=~$$CN-$$THIRDNIC-2 cmd:updatenode $$CN -P confignetwork check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:output=~11.1.0.100 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:output=~12.1.0.100 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 13.1.0.200 /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 13.1.0.200 /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 13.1.0.200 /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 13.1.0.200 /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 13.1.0.200 /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 13.1.0.200 /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi check:output=~13.1.0.200 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 14.1.0.100 /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 14.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 14.1.0.100 /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 14.1.0.100 /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 14.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 14.1.0.100 /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi check:output=~14.1.0.100 cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 cmd:rmdef -t network -o 12_1_0_0-255_255_0_0 cmd:rmdef -t network -o 13_1_0_0-255_255_0_0 cmd:rmdef -t network -o 14_1_0_0-255_255_0_0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC /etc/network/interfaces.d/$$SECONDNIC:1";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC /etc/network/interfaces.d/$$SECONDNIC:1";else echo "Sorry,this is not supported os"; fi check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC /etc/network/interfaces.d/$$THIRDNIC:1";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC /etc/network/interfaces.d/$$THIRDNIC:1";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:xdsh $$CN "ip addr del 11.1.0.100/16 dev $$SECONDNIC" cmd:xdsh $$CN "ip addr del 12.1.0.100/16 dev $$SECONDNIC" @@ -477,7 +486,7 @@ cmd:xdsh $$CN "ip addr del 14.1.0.100/16 dev $$THIRDNIC" cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 cmd:mv -f /etc/hosts.bak /etc/hosts -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/";else echo "Sorry,this is not supported os"; fi cmd:xdsh $$CN "rm -rf /tmp/backupnet/" end @@ -489,45 +498,44 @@ check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi -cmd:if grep "Red Hat" /etc/*release;then xdsh $$CN "yum -y install bridge-utils";fi -cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC +cmd:xdsh $$CN "if grep SUSE /etc/*release;then cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/; elif grep -E \"Red Hat|CentOS\" /etc/*release;then cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/; elif grep Ubuntu /etc/*release;then cp -f /etc/network/interfaces.d/* /tmp/backupnet/;else echo \"Sorry,this is not supported os\"; fi" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 -cmd:chdef $$CN nicips.$$SECONDNIC=11.1.0.100 nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=11_1_0_0-255_255_0_0 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi -check:output=~11.1.0.100 cmd:chdef $$CN nicips.$$SECONDNIC= nictypes.$$SECONDNIC= nicnetworks.$$SECONDNIC= check:rc==0 -cmd:mkdef -t network -o 60_0_0_0-255_0_0_0 net=60.0.0.0 mask=255.0.0.0 mgtifname=$$SECONDNIC +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=105.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test6 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 -cmd:mkdef -t network -o 70_0_0_0-255_0_0_0 net=70.0.0.0 mask=255.0.0.0 mgtifname=$$SECONDNIC +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=106.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test7 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 -cmd:chdef $$CN nicnetworks.$$SECONDNIC.6="60_0_0_0-255_0_0_0" nicnetworks.$$SECONDNIC.7="70_0_0_0-255_0_0_0" nictypes.$$SECONDNIC.6=vlan nictypes.$$SECONDNIC.7=vlan nicips.$$SECONDNIC.6=60.5.106.9 nicips.$$SECONDNIC.7=70.5.106.9 nicdevices.$$SECONDNIC.6=$$SECONDNIC nicdevices.$$SECONDNIC.7=$$SECONDNIC nictypes.$$SECONDNIC=ethernet +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "if grep SUSE /etc/*release;then grep $second1ip /etc/sysconfig/network/ifcfg-$$SECONDNIC; elif grep -E \"Red Hat|CentOS\" /etc/*release;then grep $second1ip /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*; elif grep Ubuntu /etc/*release;then grep $second1ip /etc/network/interfaces.d/$$SECONDNIC;else echo \"Sorry,this is not supported os\"; fi" +check:rc==0 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=105;var2=106;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second6ip=$var1$var3;second7ip=$var2$var3;chdef $$CN nicnetworks.$$SECONDNIC.6=confignetworks_test6 nicnetworks.$$SECONDNIC.7=confignetworks_test7 nictypes.$$SECONDNIC.6=vlan nictypes.$$SECONDNIC.7=vlan nicips.$$SECONDNIC.6=$second6ip nicips.$$SECONDNIC.7=$second7ip nicdevices.$$SECONDNIC.6=$$SECONDNIC nicdevices.$$SECONDNIC.7=$$SECONDNIC nictypes.$$SECONDNIC=ethernet check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 60.5.106.9 /etc/sysconfig/network/ifcfg-$$SECONDNIC.6"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 60.5.106.9 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC.6"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 60.5.106.9 /etc/network/interfaces.d/$$SECONDNIC.6";else echo "Sorry,this is not supported os"; fi -check:output=~60.5.106.9 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 70.5.106.9 /etc/sysconfig/network/ifcfg-$$SECONDNIC.7"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 70.5.106.9 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC.7"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 70.5.106.9 /etc/network/interfaces.d/$$SECONDNIC.7";else echo "Sorry,this is not supported os"; fi -check:output=~70.5.106.9 -cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi -check:rc==0 -cmd:rmdef -t network -o 60_0_0_0-255_0_0_0 -cmd:rmdef -t network -o 70_0_0_0-255_0_0_0 -cmd:xdsh $$CN "ip addr del 60.5.106.9/8 dev $$SECONDNIC.6" -cmd:xdsh $$CN "ip addr del 70.5.106.9/8 dev $$SECONDNIC.7" -cmd:xdsh $$CN "ip link del dev $$SECONDNIC.6" -cmd:xdsh $$CN "ip link del dev $$SECONDNIC.7" -cmd:xdsh $$CN "ip addr del 11.1.0.100/16 dev $$SECONDNIC" -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC.6 /etc/sysconfig/network/ifcfg-$$SECONDNIC.7"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC.6 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC.7"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC.6 /etc/network/interfaces.d/$$SECONDNIC.7";else echo "Sorry,this is not supported os"; fi -check:rc==0 cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=105;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second6ip=$var1$var3; echo $second6ip; xdsh $$CN "if grep SUSE /etc/*release;then grep $second6ip /etc/sysconfig/network/ifcfg-$$SECONDNIC.6;elif grep -E \"Red Hat|CentOS\" /etc/*release;then grep $second6ip /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC.6*; elif grep Ubuntu /etc/*release;then grep $second6ip /etc/network/interfaces.d/$$SECONDNIC.6;else echo \"Sorry,this is not supported os\"; fi" +check:rc==0 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var2=106;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second7ip=$var2$var3; echo $second6ip; xdsh $$CN "if grep SUSE /etc/*release;then grep $second7ip /etc/sysconfig/network/ifcfg-$$SECONDNIC.7; elif grep -E \"Red Hat|CentOS\" /etc/*release;then grep $second7ip /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC.7*; elif grep Ubuntu /etc/*release;then grep $second7ip /etc/network/interfaces.d/$$SECONDNIC.7;else echo \"Sorry,this is not supported os\"; fi" +check:rc==0 +cmd:xdsh $$CN "if grep SUSE /etc/*release;then rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC; elif grep -E \"Red Hat|CentOS\" /etc/*release;then rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC*; elif grep Ubuntu /etc/*release;then rm -rf /etc/network/interfaces.d/$$SECONDNIC;else echo \"Sorry,this is not supported os\"; fi" +check:rc==0 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=105;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second6ip=$var1$var3;xdsh $$CN "ip addr del $second6ip/8 dev $$SECONDNIC.6" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var2=106;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second7ip=$var2$var3;xdsh $$CN "ip addr del $second7ip/8 dev $$SECONDNIC.7" +cmd:rmdef -t network -o confignetworks_test1 +cmd:rmdef -t network -o confignetworks_test6 +cmd:rmdef -t network -o confignetworks_test7 +cmd:xdsh $$CN "ip link del dev $$SECONDNIC.6" +cmd:xdsh $$CN "ip link del dev $$SECONDNIC.7" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" +cmd:xdsh $$CN "if grep SUSE /etc/*release;then rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC.6 /etc/sysconfig/network/ifcfg-$$SECONDNIC.7; elif grep -E \"Red Hat|CentOS\" /etc/*release;then rm -rf /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC.6 /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC.7; elif grep Ubuntu /etc/*release;then rm -rf /etc/network/interfaces.d/$$SECONDNIC.6 /etc/network/interfaces.d/$$SECONDNIC.7;else echo \"Sorry,this is not supported os\"; fi" +check:rc==0 +cmd:xdsh $$CN "if grep SUSE /etc/*release;then cp -f /tmp/backupnet/* /etc/sysconfig/network/; elif grep -E \"Red Hat .* 8.*|CentOS .* 8.*\" /etc/*release; then cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/; nmcli con reload;elif grep -E \"Red Hat|CentOS\" /etc/*release;then cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/; elif grep Ubuntu /etc/*release;then cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/;else echo \"Sorry,this is not supported os\"; fi" check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces" check:rc==0 @@ -541,15 +549,14 @@ check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi -cmd:if grep "Red Hat" /etc/*release;then xdsh $$CN "yum -y install bridge-utils";fi +cmd:xdsh $$CN "if grep SUSE /etc/*release;then cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/; elif grep -E \"Red Hat|CentOS\" /etc/*release;then cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/; elif grep Ubuntu /etc/*release;then cp -f /etc/network/interfaces.d/* /tmp/backupnet/;else echo \"Sorry,this is not supported os\"; fi" cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC mtu=1500 check:rc==0 cmd:chdef $$CN nicips.$$SECONDNIC=11.1.0.100 nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=11_1_0_0-255_255_0_0 check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:xdsh $$CN "if grep SUSE /etc/*release;then grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC; elif grep -E \"Red Hat|CentOS\" /etc/*release;then grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC; elif grep Ubuntu /etc/*release;then grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC;else echo \"Sorry,this is not supported os\"; fi" check:output=~11.1.0.100 cmd:chdef $$CN nicips.$$SECONDNIC= nictypes.$$SECONDNIC= nicnetworks.$$SECONDNIC= check:rc==0 @@ -568,11 +575,11 @@ cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 cmd:rmdef -t network -o 60_0_0_0-255_0_0_0 cmd:rmdef -t network -o 70_0_0_0-255_0_0_0 cmd:xdsh $$CN "ip addr del 11.1.0.100/16 dev $$SECONDNIC" -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:xdsh $$CN "if grep SUSE /etc/*release;then rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC; elif grep -E \"Red Hat|CentOS\" /etc/*release;then rm -rf /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*; elif grep Ubuntu /etc/*release;then rm -rf /etc/network/interfaces.d/$$SECONDNIC;else echo \"Sorry,this is not supported os\"; fi" check:rc==0 cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi +cmd:xdsh $$CN "if grep SUSE /etc/*release;then cp -f /tmp/backupnet/* /etc/sysconfig/network/; elif grep -E \"Red Hat .* 8.*|CentOS .* 8.*\" /etc/*release; then cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/; nmcli con reload;elif grep -E \"Red Hat|CentOS\" /etc/*release;then cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/; elif grep Ubuntu /etc/*release;then cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/;else echo \"Sorry,this is not supported os\"; fi" check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces" check:rc==0 @@ -586,49 +593,49 @@ check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi -cmd:if grep "Red Hat" /etc/*release;then xdsh $$CN "yum -y install bridge-utils";fi -cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi +cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "yum -y install bridge-utils";fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 -cmd:chdef $$CN nicips.$$SECONDNIC=11.1.0.100 nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=11_1_0_0-255_255_0_0 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 check:rc==0 -cmd:mkdef -t network -o 12_1_0_0-255_255_0_0 net=12.1.0.0 mask=255.255.0.0 mgtifname=$$THIRDNIC +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=101.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test2 net=$secondnet mask=255.255.0.0 mgtifname=$$THIRDNIC check:rc==0 -cmd:chdef $$CN nicips.$$THIRDNIC=12.1.0.100 nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC=12_1_0_0-255_255_0_0 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$THIRDNIC=$second1ip nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC=confignetworks_test2 check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 cmd:chdef $$CN nicips.$$SECONDNIC= nictypes.$$SECONDNIC= nicnetworks.$$SECONDNIC= nicips.$$THIRDNIC= nictypes.$$THIRDNIC= nicnetworks.$$THIRDNIC= check:rc==0 -cmd:mkdef -t network -o 30_5_0_0-255_255_0_0 net=30.5.0.0 mask=255.255.0.0 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=102.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test3 net=$secondnet mask=255.255.0.0 check:rc==0 -cmd:chdef $$CN nicnetworks.bond0=30_5_0_0-255_255_0_0 nictypes.$$SECONDNIC=ethernet nictypes.$$THIRDNIC=ethernet nictypes.bond0=bond nicips.bond0=30.5.106.9 nicdevices.bond0="$$SECONDNIC|$$THIRDNIC" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;bond0ip=$var1$var2;chdef $$CN nicnetworks.bond0=confignetworks_test3 nictypes.$$SECONDNIC=ethernet nictypes.$$THIRDNIC=ethernet nictypes.bond0=bond nicips.bond0=$bond0ip nicdevices.bond0="$$SECONDNIC|$$THIRDNIC" check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 30.5.106.9 /etc/sysconfig/network/ifcfg-bond0"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 30.5.106.9 /etc/sysconfig/network-scripts/ifcfg-bond0"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 30.5.106.9 /etc/network/interfaces.d/bond0";else echo "Sorry,this is not supported os"; fi -check:output=~30.5.106.9 -check:rc==0 cmd:xdsh $$CN "ls /sys/class/net" check:output=~bond0 cmd:xdsh $$CN "cat /sys/class/net/bonding_masters" check:output=~bond0 -cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;bond0ip=$var1$var2;if grep SUSE /etc/*release;then xdsh $$CN "grep $bond0ip /etc/sysconfig/network/ifcfg-bond0"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $bond0ip /etc/sysconfig/network-scripts/ifcfg-*bond0"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $bond0ip /etc/network/interfaces.d/bond0";else echo "Sorry,this is not supported os"; fi check:rc==0 -cmd:rmdef -t network -o 12_1_0_0-255_255_0_0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi +cmd:rmdef -t network -o confignetworks_test1 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 -cmd:rmdef -t network -o 30_5_0_0-255_255_0_0 -cmd:xdsh $$CN "ip addr del 30.5.106.9/16 dev bond0" +cmd:rmdef -t network -o confignetworks_test2 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:rmdef -t network -o confignetworks_test3 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;bond0ip=$var1$var2;xdsh $$CN "ip addr del $bond0ip/16 dev bond0" cmd:xdsh $$CN "ip link del dev bond0" cmd:xdsh $$CN "echo -bond0 > /sys/class/net/bonding_masters" -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-bond0"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-bond0"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/bond0";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-bond0"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/bond0";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi check:rc==0 +cmd:xdsh $$CN "systemctl status NetworkManager >/dev/null 2>/dev/null && which nmcli >/dev/null 2>/dev/null && nmcli con reload" cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces" check:rc==0 end @@ -641,42 +648,41 @@ check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi -cmd:if grep "Red Hat" /etc/*release;then xdsh $$CN "yum -y install bridge-utils";fi -cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi +cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "yum -y install bridge-utils";fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 -cmd:chdef $$CN nicips.$$SECONDNIC=11.1.0.100 nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=11_1_0_0-255_255_0_0 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 check:rc==0 -cmd:mkdef -t network -o 12_1_0_0-255_255_0_0 net=12.1.0.0 mask=255.255.0.0 mgtifname=$$THIRDNIC -check:rc==0 -cmd:chdef $$CN nicips.$$THIRDNIC=12.1.0.100 nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC=12_1_0_0-255_255_0_0 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=101.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test2 net=$secondnet mask=255.255.0.0 mgtifname=$$THIRDNIC check:rc==0 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$THIRDNIC=$second1ip nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC=confignetworks_test2 cmd:updatenode $$CN -P confignetwork check:rc==0 cmd:chdef $$CN nicips.$$SECONDNIC= nictypes.$$SECONDNIC= nicnetworks.$$SECONDNIC= nicips.$$THIRDNIC= nictypes.$$THIRDNIC= nicnetworks.$$THIRDNIC= check:rc==0 -cmd:mkdef -t network -o 30_5_0_0-255_255_0_0 net=30.5.0.0 mask=255.255.0.0 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=102.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test3 net=$secondnet mask=255.255.0.0 check:rc==0 -cmd:chdef $$CN nicnetworks.bond0=30_5_0_0-255_255_0_0 nictypes.$$SECONDNIC=ethernet nictypes.$$THIRDNIC=ethernet nictypes.bond0=bond nicips.bond0=30.5.106.9 nicdevices.bond0= +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;bond0ip=$var1$var2;chdef $$CN nicnetworks.bond0=confignetworks_test3 nictypes.$$SECONDNIC=ethernet nictypes.$$THIRDNIC=ethernet nictypes.bond0=bond nicips.bond0=$bond0ip nicdevices.bond0= check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc!=0 -cmd:chdef $$CN nicnetworks.bond0=30_5_0_0-255_255_0_0 nictypes.$$SECONDNIC=ethernet nictypes.$$THIRDNIC=ethernet nictypes.bond0=bond nicips.bond0=30.5.106.9 nicdevices.$$SECONDNIC=bond0 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;bond0ip=$var1$var2;chdef $$CN nicnetworks.bond0=confignetworks_test3 nictypes.$$SECONDNIC=ethernet nictypes.$$THIRDNIC=ethernet nictypes.bond0=bond nicips.bond0=$bond0ip nicdevices.$$SECONDNIC=bond0 check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc!=0 -cmd:xdsh $$CN "ip addr del 11.1.0.100/16 dev $$SECONDNIC" -cmd:xdsh $$CN "ip addr del 12.1.0.100/16 dev $$THIRDNIC" -cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$THIRDNIC" +cmd:rmdef -t network -o confignetworks_test1 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 -cmd:rmdef -t network -o 12_1_0_0-255_255_0_0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi +cmd:rmdef -t network -o confignetworks_test2 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 -cmd:rmdef -t network -o 30_5_0_0-255_255_0_0 +cmd:rmdef -t network -o confignetworks_test3 cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces" check:rc==0 @@ -690,59 +696,59 @@ check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi -cmd:if grep "Red Hat" /etc/*release;then xdsh $$CN "yum -y install bridge-utils";fi -cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC mtu=1500 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi +cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "yum -y install bridge-utils";fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC mtu=1500 check:rc==0 -cmd:chdef $$CN nicips.$$SECONDNIC=11.1.0.100 nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=11_1_0_0-255_255_0_0 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 check:rc==0 -cmd:mkdef -t network -o 12_1_0_0-255_255_0_0 net=12.1.0.0 mask=255.255.0.0 mgtifname=$$THIRDNIC mtu=1500 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=101.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test2 net=$secondnet mask=255.255.0.0 mgtifname=$$THIRDNIC mtu=1500 check:rc==0 -cmd:chdef $$CN nicips.$$THIRDNIC=12.1.0.100 nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC=12_1_0_0-255_255_0_0 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$THIRDNIC=$second1ip nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC=confignetworks_test2 check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 cmd:chdef $$CN nicips.$$SECONDNIC= nictypes.$$SECONDNIC= nicnetworks.$$SECONDNIC= nicips.$$THIRDNIC= nictypes.$$THIRDNIC= nicnetworks.$$THIRDNIC= check:rc==0 -cmd:mkdef -t network -o 30_5_0_0-255_255_0_0 net=30.5.0.0 mask=255.255.0.0 mtu=1500 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=102.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test3 net=$secondnet mask=255.255.0.0 mtu=1500 check:rc==0 -cmd:mkdef -t network -o 40_5_0_0-255_255_0_0 net=40.5.0.0 mask=255.255.0.0 mtu=1500 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=103.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test4 net=$secondnet mask=255.255.0.0 mtu=1500 check:rc==0 -cmd:chdef $$CN nicdevices.bond0.2=bond0 nicdevices.bond0.3=bond0 nicips.bond0.2=30.5.106.8 nicips.bond0.3=40.5.106.8 nicnetworks.bond0.2=30_5_0_0-255_255_0_0 nicnetworks.bond0.3=40_5_0_0-255_255_0_0 nictypes.bond0.2=vlan nictypes.bond0.3=vlan nictypes.bond0=bond nictypes.$$SECONDNIC=ethernet nictypes.$$THIRDNIC=ethernet nicdevices.bond0="$$SECONDNIC|$$THIRDNIC" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=103;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;bond2ip=$var1$var3;bond3ip=$var2$var3;chdef $$CN nicdevices.bond0.2=bond0 nicdevices.bond0.3=bond0 nicips.bond0.2=$bond2ip nicips.bond0.3=$bond3ip nicnetworks.bond0.2=confignetworks_test3 nicnetworks.bond0.3=confignetworks_test4 nictypes.bond0.2=vlan nictypes.bond0.3=vlan nictypes.bond0=bond nictypes.$$SECONDNIC=ethernet nictypes.$$THIRDNIC=ethernet nicdevices.bond0="$$SECONDNIC|$$THIRDNIC" check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 30.5.106.8 /etc/sysconfig/network/ifcfg-bond0.2"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 30.5.106.8 /etc/sysconfig/network-scripts/ifcfg-bond0.2"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 30.5.106.8 /etc/network/interfaces.d/bond0.2";else echo "Sorry,this is not supported os"; fi -check:output=~30.5.106.8 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 40.5.106.8 /etc/sysconfig/network/ifcfg-bond0.3"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 40.5.106.8 /etc/sysconfig/network-scripts/ifcfg-bond0.3"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 40.5.106.8 /etc/network/interfaces.d/bond0.3";else echo "Sorry,this is not supported os"; fi -check:output=~40.5.106.8 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;bond2ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $bond2ip /etc/sysconfig/network/ifcfg-bond0.2"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $bond2ip /etc/sysconfig/network-scripts/ifcfg-bond0.2"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $bond2ip /etc/network/interfaces.d/bond0.2";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var2=103;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;bond3ip=$var2$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $bond3ip /etc/sysconfig/network/ifcfg-bond0.3"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $bond3ip /etc/sysconfig/network-scripts/ifcfg-bond0.3"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $bond3ip /etc/network/interfaces.d/bond0.3";else echo "Sorry,this is not supported os"; fi +check:rc==0 cmd:xdsh $$CN "ls /sys/class/net" check:output=~bond0 check:output=~bond0.2 check:output=~bond0.3 cmd:xdsh $$CN "cat /sys/class/net/bonding_masters" check:output=~bond0 -cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:rmdef -t network -o confignetworks_test1 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 -cmd:rmdef -t network -o 12_1_0_0-255_255_0_0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi +cmd:rmdef -t network -o confignetworks_test2 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 -cmd:rmdef -t network -o 30_5_0_0-255_255_0_0 -cmd:rmdef -t network -o 40_5_0_0-255_255_0_0 -cmd:xdsh $$CN "ip addr del 11.1.0.100/16 dev $$SECONDNIC" -cmd:xdsh $$CN "ip addr del 12.1.0.100/16 dev $$THIRDNIC" -cmd:xdsh $$CN "ip addr del 30.5.106.9/16 dev bond0.2" -cmd:xdsh $$CN "ip addr del 40.5.106.9/16 dev bond0.3" +cmd:rmdef -t network -o confignetworks_test3 +cmd:rmdef -t network -o confignetworks_test4 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$THIRDNIC" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;bond2ip=$var1$var3;xdsh $$CN "ip addr del $bond2ip/16 dev bond0.2" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var2=103;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;bond3ip=$var2$var3;xdsh $$CN "ip addr del $bond3ip/16 dev bond0.3" cmd:xdsh $$CN "ip link del dev bond0" cmd:xdsh $$CN "ip link del dev bond0.2" cmd:xdsh $$CN "ip link del dev bond0.3" cmd:xdsh $$CN "echo -bond0 > /sys/class/net/bonding_masters" -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-bond0 /etc/sysconfig/network/ifcfg-bond0.2 /etc/sysconfig/network/ifcfg-bond0.3"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-bond0 /etc/sysconfig/network/ifcfg-bond0.2 /etc/sysconfig/network/ifcfg-bond0.3"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/bond0 /etc/sysconfig/network/ifcfg-bond0.2 /etc/sysconfig/network/ifcfg-bond0.3";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-bond0 /etc/sysconfig/network/ifcfg-bond0.2 /etc/sysconfig/network/ifcfg-bond0.3"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-bond0 /etc/sysconfig/network/ifcfg-bond0.2 /etc/sysconfig/network/ifcfg-bond0.3"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/bond0 /etc/sysconfig/network/ifcfg-bond0.2 /etc/sysconfig/network/ifcfg-bond0.3";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces" check:rc==0 @@ -756,50 +762,49 @@ check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi -cmd:if grep "Red Hat" /etc/*release;then xdsh $$CN "yum -y install bridge-utils";fi -cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi +cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "yum -y install bridge-utils";fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 -cmd:chdef $$CN nicips.$$SECONDNIC=11.1.0.100 nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=11_1_0_0-255_255_0_0 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 check:rc==0 -cmd:mkdef -t network -o 12_1_0_0-255_255_0_0 net=12.1.0.0 mask=255.255.0.0 mgtifname=$$THIRDNIC -check:rc==0 -cmd:chdef $$CN nicips.$$THIRDNIC=12.1.0.200 nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC=12_1_0_0-255_255_0_0 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=101.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test2 net=$secondnet mask=255.255.0.0 mgtifname=$$THIRDNIC check:rc==0 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$THIRDNIC=$second1ip nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC=confignetworks_test2 cmd:updatenode $$CN -P confignetwork check:rc==0 cmd:chdef $$CN nicips.$$SECONDNIC= nictypes.$$SECONDNIC= nicnetworks.$$SECONDNIC= nicips.$$THIRDNIC= nictypes.$$THIRDNIC= nicnetworks.$$THIRDNIC= check:rc==0 -cmd:mkdef -t network -o 30_5_0_0-255_255_0_0 net=30.5.0.0 mask=255.255.0.0 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=102.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test3 net=$secondnet mask=255.255.0.0 check:rc==0 -cmd:chdef $$CN nicnetworks.br0=30_5_0_0-255_255_0_0 nicdevices.br0=bond0 nictypes.br0=bridge nicips.br0=30.5.106.9 nicdevices.bond0="$$SECONDNIC|$$THIRDNIC" nictypes.bond0=bond nictypes.$$SECONDNIC=ethernet nictypes.$$THIRDNIC=ethernet +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=103;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;br0ip=$var1$var2;chdef $$CN nicnetworks.br0=confignetworks_test3 nicdevices.br0=bond0 nictypes.br0=bridge nicips.br0=$br0ip nicdevices.bond0="$$SECONDNIC|$$THIRDNIC" nictypes.bond0=bond nictypes.$$SECONDNIC=ethernet nictypes.$$THIRDNIC=ethernet check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 30.5.106.9 /etc/sysconfig/network/ifcfg-br0"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 30.5.106.9 /etc/sysconfig/network-scripts/ifcfg-br0"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 30.5.106.9 /etc/network/interfaces.d/br0";else echo "Sorry,this is not supported os"; fi -check:output=~30.5.106.9 -check:rc==0 cmd:xdsh $$CN "ls /sys/class/net" check:output=~br0 cmd:xdsh $$CN "cat /sys/class/net/bonding_masters" check:output=~bond0 -cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=103;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;br0ip=$var1$var2;if grep SUSE /etc/*release;then xdsh $$CN "grep $br0ip /etc/sysconfig/network/ifcfg-br0"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $br0ip /etc/sysconfig/network-scripts/ifcfg-*br0"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $br0ip /etc/network/interfaces.d/br0";else echo "Sorry,this is not supported os"; fi check:rc==0 -cmd:rmdef -t network -o 12_1_0_0-255_255_0_0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi +cmd:rmdef -t network -o confignetworks_test1 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 -cmd:rmdef -t network -o 30_5_0_0-255_255_0_0 -cmd:xdsh $$CN "ip addr del 30.5.106.9/16 dev br0" -cmd:xdsh $$CN "ip addr del 11.1.0.100/16 dev $$SECONDNIC" -cmd:xdsh $$CN "ip addr del 12.1.0.200/16 dev $$THIRDNIC" +cmd:rmdef -t network -o confignetworks_test2 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:rmdef -t network -o confignetworks_test3 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=103;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;br0ip=$var1$var2;xdsh $$CN "ip addr del $br0ip/16 dev br0" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$THIRDNIC" cmd:xdsh $$CN "ip link del dev br0" cmd:xdsh $$CN "echo -bond0 > /sys/class/net/bonding_masters" -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-br0"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-br0"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/br0";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-br0"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/br0";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi +cmd:xdsh $$CN "systemctl status NetworkManager >/dev/null 2>/dev/null && which nmcli >/dev/null 2>/dev/null && nmcli con reload" cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces" end @@ -811,62 +816,58 @@ check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi -cmd:if grep "Red Hat" /etc/*release;then xdsh $$CN "yum -y install bridge-utils";fi -cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi +cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "yum -y install bridge-utils";fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 -cmd:chdef $$CN nicips.$$SECONDNIC=11.1.0.100 nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=11_1_0_0-255_255_0_0 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 check:rc==0 -cmd:mkdef -t network -o 12_1_0_0-255_255_0_0 net=12.1.0.0 mask=255.255.0.0 mgtifname=$$THIRDNIC -check:rc==0 -cmd:chdef $$CN nicips.$$THIRDNIC=12.1.0.100 nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC=12_1_0_0-255_255_0_0 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=101.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test2 net=$secondnet mask=255.255.0.0 mgtifname=$$THIRDNIC check:rc==0 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$THIRDNIC=$second1ip nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC=confignetworks_test2 cmd:updatenode $$CN -P confignetwork check:rc==0 cmd:chdef $$CN nicips.$$SECONDNIC= nictypes.$$SECONDNIC= nicnetworks.$$SECONDNIC= nicips.$$THIRDNIC= nictypes.$$THIRDNIC= nicnetworks.$$THIRDNIC= check:rc==0 -cmd:mkdef -t network -o 30_5_0_0-255_255_0_0 net=30.5.0.0 mask=255.255.0.0 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=102.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test3 net=$secondnet mask=255.255.0.0 check:rc==0 -cmd:mkdef -t network -o 40_5_0_0-255_255_0_0 net=40.5.0.0 mask=255.255.0.0 -check:rc==0 -cmd:chdef $$CN nicdevices.br22=bond0.2 nicdevices.br33=bond0.3 nictypes.br22=bridge nictypes.br33=bridge nicnetworks.br22=30_5_0_0-255_255_0_0 nicnetworks.br33=40_5_0_0-255_255_0_0 nicips.br22=30.5.106.8 nicips.br33=40.5.106.8 nicdevices.bond0.2=bond0 nicdevices.bond0.3=bond0 nictypes.bond0.2=vlan nictypes.bond0.3=vlan nictypes.bond0=bond nictypes.$$SECONDNIC=ethernet nictypes.$$THIRDNIC=ethernet nicdevices.bond0="$$SECONDNIC|$$THIRDNIC" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=103.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test4 net=$secondnet mask=255.255.0.0 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=103;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;br22ip=$var1$var3;br33ip=$var2$var3;chdef $$CN nicdevices.br22=bond0.2 nicdevices.br33=bond0.3 nictypes.br22=bridge nictypes.br33=bridge nicnetworks.br22=confignetworks_test3 nicnetworks.br33=confignetworks_test4 nicips.br22=$br22ip nicips.br33=$br33ip nicdevices.bond0.2=bond0 nicdevices.bond0.3=bond0 nictypes.bond0.2=vlan nictypes.bond0.3=vlan nictypes.bond0=bond nictypes.$$SECONDNIC=ethernet nictypes.$$THIRDNIC=ethernet nicdevices.bond0="$$SECONDNIC|$$THIRDNIC" check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 30.5.106.8 /etc/sysconfig/network/ifcfg-br22"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 30.5.106.8 /etc/sysconfig/network-scripts/ifcfg-br22"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 30.5.106.8 /etc/network/interfaces.d/br22";else echo "Sorry,this is not supported os"; fi -check:output=~30.5.106.8 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;br22ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $br22ip /etc/sysconfig/network/ifcfg-br22"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $br22ip /etc/sysconfig/network-scripts/ifcfg-br22"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $br22ip /etc/network/interfaces.d/br22";else echo "Sorry,this is not supported os"; fi check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 40.5.106.8 /etc/sysconfig/network/ifcfg-br33"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 40.5.106.8 /etc/sysconfig/network-scripts/ifcfg-br33"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 40.5.106.8 /etc/network/interfaces.d/br33";else echo "Sorry,this is not supported os"; fi -check:output=~40.5.106.8 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=103;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;br33ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $br33ip /etc/sysconfig/network/ifcfg-br33"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $br33ip /etc/sysconfig/network-scripts/ifcfg-br33"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $br33ip /etc/network/interfaces.d/br33";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:xdsh $$CN "ls /sys/class/net" check:output=~br22 check:output=~br33 cmd:xdsh $$CN "cat /sys/class/net/bonding_masters" check:output=~bond0 -cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:rmdef -t network -o confignetworks_test1 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 -cmd:rmdef -t network -o 12_1_0_0-255_255_0_0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi +cmd:rmdef -t network -o confignetworks_test2 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 -cmd:rmdef -t network -o 30_5_0_0-255_255_0_0 -cmd:xdsh $$CN "ip addr del 30.5.106.8/16 dev br22" +cmd:rmdef -t network -o confignetworks_test3 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;br22ip=$var1$var2;xdsh $$CN "ip addr del $br22ip/16 dev br22" cmd:xdsh $$CN "ip link del dev br22" -cmd:rmdef -t network -o 40_5_0_0-255_255_0_0 -cmd:xdsh $$CN "ip addr del 40.5.106.8/16 dev br33" +cmd:rmdef -t network -o confignetworks_test4 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=103;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;br33ip=$var1$var2;xdsh $$CN "ip addr del $br33ip/16 dev br33" cmd:xdsh $$CN "ip link del dev br33" cmd:xdsh $$CN "ip link del dev bond0.2" cmd:xdsh $$CN "ip link del dev bond0.3" cmd:xdsh $$CN "ip link del dev bond0" -cmd:xdsh $$CN "ip addr del 11.1.0.100/16 dev $$SECONDNIC" -cmd:xdsh $$CN "ip addr del 12.1.0.100/16 dev $$THIRDNIC" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;secondip=$var1$var2;xdsh $$CN "ip addr del $secondip/16 dev $$SECONDNIC" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;secondip=$var1$var2;xdsh $$CN "ip addr del $secondip/16 dev $$THIRDNIC" cmd:xdsh $$CN "echo -bond0 > /sys/class/net/bonding_masters" -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-bond0 /etc/sysconfig/network/ifcfg-bond0.2 /etc/sysconfig/network/ifcfg-bond0.3 /etc/sysconfig/network/ifcfg-br22 /etc/sysconfig/network/ifcfg-br33"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-bond0 /etc/sysconfig/network-scripts/ifcfg-bond0.2 /etc/sysconfig/network-scripts/ifcfg-bond0.3 /etc/sysconfig/network-scripts/ifcfg-br22 /etc/sysconfig/network-scripts/ifcfg-br33"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/bond0 /etc/network/interfaces.d/bond0.2 /etc/network/interfaces.d/bond0.3 /etc/network/interfaces.d/br22 /etc/network/interfaces.d/br33";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-bond0 /etc/sysconfig/network/ifcfg-bond0.2 /etc/sysconfig/network/ifcfg-bond0.3 /etc/sysconfig/network/ifcfg-br22 /etc/sysconfig/network/ifcfg-br33"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-bond0 /etc/sysconfig/network-scripts/ifcfg-bond0.2 /etc/sysconfig/network-scripts/ifcfg-bond0.3 /etc/sysconfig/network-scripts/ifcfg-br22 /etc/sysconfig/network-scripts/ifcfg-br33"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/bond0 /etc/network/interfaces.d/bond0.2 /etc/network/interfaces.d/bond0.3 /etc/network/interfaces.d/br22 /etc/network/interfaces.d/br33";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces" end @@ -878,8 +879,8 @@ check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi -cmd:if grep "Red Hat" /etc/*release;then xdsh $$CN "yum -y install bridge-utils";fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi +cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "yum -y install bridge-utils";fi cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 cmd:chdef $$CN nicips.$$SECONDNIC=11.1.0.100 nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=11_1_0_0-255_255_0_0 @@ -900,14 +901,14 @@ cmd:chdef $$CN nicdevices.br22=bond0.2 nicdevices.br33=bond0.3 nictypes.br22=bri check:rc==0 cmd:updatenode $$CN -P "confignetwork -s" check:rc==0 -cmd:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$installnic"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$installnic"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi +cmd:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$installnic"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$installnic"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi check:rc==0 check:output=~__GETNODEATTR($$CN,ip)__ -check:output!~dhcp -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 30.5.106.8 /etc/sysconfig/network/ifcfg-br22"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 30.5.106.8 /etc/sysconfig/network-scripts/ifcfg-br22"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 30.5.106.8 /etc/network/interfaces.d/br22";else echo "Sorry,this is not supported os"; fi +check:output=~BOOTPROTO=none|static +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 30.5.106.8 /etc/sysconfig/network/ifcfg-br22"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 30.5.106.8 /etc/sysconfig/network-scripts/ifcfg-br22"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 30.5.106.8 /etc/network/interfaces.d/br22";else echo "Sorry,this is not supported os"; fi check:output=~30.5.106.8 check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 40.5.106.8 /etc/sysconfig/network/ifcfg-br33"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 40.5.106.8 /etc/sysconfig/network-scripts/ifcfg-br33"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 40.5.106.8 /etc/network/interfaces.d/br33";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 40.5.106.8 /etc/sysconfig/network/ifcfg-br33"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 40.5.106.8 /etc/sysconfig/network-scripts/ifcfg-br33"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 40.5.106.8 /etc/network/interfaces.d/br33";else echo "Sorry,this is not supported os"; fi check:output=~40.5.106.8 check:rc==0 cmd:xdsh $$CN "ls /sys/class/net" @@ -916,10 +917,10 @@ check:output=~br33 cmd:xdsh $$CN "cat /sys/class/net/bonding_masters" check:output=~bond0 cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:rmdef -t network -o 12_1_0_0-255_255_0_0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:rmdef -t network -o 30_5_0_0-255_255_0_0 cmd:xdsh $$CN "ip addr del 30.5.106.8/16 dev br22" @@ -932,11 +933,11 @@ cmd:xdsh $$CN "ip link del dev bond0.3" cmd:xdsh $$CN "ip link del dev bond0" cmd:xdsh $$CN "ip addr del 11.1.0.100/16 dev $$SECONDNIC" cmd:xdsh $$CN "ip addr del 12.1.0.100/16 dev $$THIRDNIC" -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-bond0 /etc/sysconfig/network/ifcfg-bond0.2 /etc/sysconfig/network/ifcfg-bond0.3 /etc/sysconfig/network/ifcfg-br22 /etc/sysconfig/network/ifcfg-br33"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-bond0 /etc/sysconfig/network-scripts/ifcfg-bond0.2 /etc/sysconfig/network-scripts/ifcfg-bond0.3 /etc/sysconfig/network-scripts/ifcfg-br22 /etc/sysconfig/network-scripts/ifcfg-br33"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/bond0 /etc/network/interfaces.d/bond0.2 /etc/network/interfaces.d/bond0.3 /etc/network/interfaces.d/br22 /etc/network/interfaces.d/br33";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-bond0 /etc/sysconfig/network/ifcfg-bond0.2 /etc/sysconfig/network/ifcfg-bond0.3 /etc/sysconfig/network/ifcfg-br22 /etc/sysconfig/network/ifcfg-br33"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-bond0 /etc/sysconfig/network-scripts/ifcfg-bond0.2 /etc/sysconfig/network-scripts/ifcfg-bond0.3 /etc/sysconfig/network-scripts/ifcfg-br22 /etc/sysconfig/network-scripts/ifcfg-br33"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/bond0 /etc/network/interfaces.d/bond0.2 /etc/network/interfaces.d/bond0.3 /etc/network/interfaces.d/br22 /etc/network/interfaces.d/br33";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces" end @@ -948,8 +949,8 @@ check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi -cmd:if grep "Red Hat" /etc/*release;then xdsh $$CN "yum -y install bridge-utils";fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi +cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "yum -y install bridge-utils";fi cmd:mkdef -t network -o 30_5_0_0-255_255_0_0 net=30.5.0.0 mask=255.255.0.0 check:rc==0 cmd:mkdef -t network -o 40_5_0_0-255_255_0_0 net=40.5.0.0 mask=255.255.0.0 @@ -969,7 +970,7 @@ cmd:xdsh $$CN "ip link del dev bond0.3" cmd:xdsh $$CN "ip link del dev bond0" cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces" end @@ -980,7 +981,7 @@ cmd:lsdef $$CN -z && lsdef -l $$CN -z >/tmp/CN.stanza check:rc==0 cmd:xdsh $$CN "mkdir -p /tmp/backupnet" check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/;cp -f /etc/network/interfaces /tmp";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/;cp -f /etc/network/interfaces /tmp";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:xdsh $$CN "ps -A --format pid,comm | awk '/dhclient/ { print \$1 }' | xargs -r -n 1 kill" cmd:xdsh $$CN "ps -A --format pid,comm | awk '/dhclient/ { print \$1 }' | xargs -r -n 1 kill -KILL" @@ -992,7 +993,8 @@ cmd:xdsh $$CN date check:rc==0 # Clean up cmd:test -e /tmp/CN.stanza && rmdef $$CN && mkdef -z /dev/null 2>/dev/null && which nmcli >/dev/null 2>/dev/null && nmcli con reload" end diff --git a/xCAT-test/autotest/testcase/confignetwork/cases1 b/xCAT-test/autotest/testcase/confignetwork/cases1 new file mode 100644 index 000000000..735840e46 --- /dev/null +++ b/xCAT-test/autotest/testcase/confignetwork/cases1 @@ -0,0 +1,47 @@ +start:confignetwork_secondarynic_third_regex_updatenode +description:this case is to verify if confignetwork could config serveral nics with regex patten.This case is to verify defect 3602. +label:others,network +cmd:lsdef $$CN;if [ $? -eq 0 ]; then lsdef -l $$CN -z >/tmp/CN.standa ;fi +check:rc==0 +cmd:xdsh $$CN "rm -rf /tmp/backupnet/" +cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" +check:rc==0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:mkdef -t network -o 30_0_0_0-255_255_0_0 net=30.0.0.0 mask=255.0.0.0 mgtifname=$$SECONDNIC +check:rc==0 +cmd:mkdef -t network -o 40_0_0_0-255_255_0_0 net=40.0.0.0 mask=255.0.0.0 mgtifname=$$THIRDNIC +check:rc==0 +cmd:chdef $$CN nicips.$$SECONDNIC="|\D+\d+\D+\d+\D+\d+\D+(\d+)|30.0.0.(\$1/1000+9)|" nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC="30_0_0_0-255_255_0_0" +check:rc==0 +cmd:chdef $$CN nicips.$$THIRDNIC="|\D+\d+\D+\d+\D+\d+\D+(\d+)|40.0.0.(\$1/1000+8)|" nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC="40_0_0_0-255_255_0_0" +check:rc==0 +cmd:lsdef $$CN +cmd:cp /etc/hosts /etc/hosts.bak +cmd:rc==0 +cmd:makehosts $$CN +check:rc==0 +cmd:cat /etc/hosts +check:output=~$$CN-$$SECONDNIC +check:output=~$$CN-$$THIRDNIC +cmd:updatenode $$CN -P confignetwork +check:rc==0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 30.0.0.9 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 30.0.0.9 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 30.0.0.9 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +check:output=~30.0.0.9 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 40.0.0.8 /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 40.0.0.8 /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 40.0.0.8 /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi +check:output=~40.0.0.8 +cmd:rmdef -t network -o 30_0_0_0-255_255_0_0 +cmd:rmdef -t network -o 40_0_0_0-255_255_0_0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:xdsh $$CN "ip addr del 30.0.0.9/8 dev $$SECONDNIC" +cmd:xdsh $$CN "ip addr del 40.0.0.8/8 dev $$THIRDNIC" +cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi +check:rc==0 +cmd:mv -f /etc/hosts.bak /etc/hosts +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/";else echo "Sorry,this is not supported os"; fi +cmd:xdsh $$CN "rm -rf /tmp/backupnet/" +end + diff --git a/xCAT-test/autotest/testcase/getmacs/cases0 b/xCAT-test/autotest/testcase/getmacs/cases0 index 659ac4919..61e22c4cb 100644 --- a/xCAT-test/autotest/testcase/getmacs/cases0 +++ b/xCAT-test/autotest/testcase/getmacs/cases0 @@ -2,30 +2,40 @@ start:getmacs_noderange label:others cmd:tabdump mac > /tmp/mac.csv cmd:chtab -d node=$$CN mac +cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN; fi +cmd:sleep 10 cmd:getmacs $$CN check:rc==0 check:output=~[a-f0-9A-F]{12}|[a-f0-9A-F]{2}:[a-f0-9A-F]{2}:[a-f0-9A-F]{2}:[a-f0-9A-F]{2}:[a-f0-9A-F]{2}:[a-f0-9A-F]{2} cmd:tabdump mac | grep $$CN check:output=~[a-f0-9A-F]{12}|[a-f0-9A-F]{2}:[a-f0-9A-F]{2}:[a-f0-9A-F]{2}:[a-f0-9A-F]{2}:[a-f0-9A-F]{2}:[a-f0-9A-F]{2} cmd:tabrestore /tmp/mac.csv +cmd:if [ -x /usr/bin/goconserver ]; then makegocons -d $$CN; else makeconservercf -d $$CN; fi cmd:rm /tmp/mac.csv end + start:getmacs_d label:others cmd:tabdump mac > /tmp/mac.csv cmd:chtab -d node=$$CN mac +cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN; fi +cmd:sleep 10 cmd:getmacs $$CN -d check:rc==0 check:output=~[a-f0-9A-F]{12}|[a-f0-9A-F]{2}:[a-f0-9A-F]{2}:[a-f0-9A-F]{2}:[a-f0-9A-F]{2}:[a-f0-9A-F]{2}:[a-f0-9A-F]{2} cmd:tabdump mac | grep $$CN check:output!~[a-f0-9A-F]{12}|[a-f0-9A-F]{2}:[a-f0-9A-F]{2}:[a-f0-9A-F]{2}:[a-f0-9A-F]{2}:[a-f0-9A-F]{2}:[a-f0-9A-F]{2} cmd:tabrestore /tmp/mac.csv +cmd:if [ -x /usr/bin/goconserver ]; then makegocons -d $$CN; else makeconservercf -d $$CN; fi cmd:rm /tmp/mac.csv end + start:getmacs_f_D label:others cmd:tabdump mac > /tmp/mac.csv cmd:chtab -d node=$$CN mac +cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN; fi +cmd:sleep 10 cmd:getmacs $$CN -f -D check:rc==0 check:output=~[a-f0-9A-F]{12}|[a-f0-9A-F]{2}:[a-f0-9A-F]{2}:[a-f0-9A-F]{2}:[a-f0-9A-F]{2}:[a-f0-9A-F]{2}:[a-f0-9A-F]{2} @@ -35,4 +45,5 @@ cmd:tabrestore /tmp/mac.csv cmd:rm /tmp/mac.csv cmd:rpower $$CN on cmd:sleep 300 +cmd:if [ -x /usr/bin/goconserver ]; then makegocons -d $$CN; else makeconservercf -d $$CN; fi end diff --git a/xCAT-test/autotest/testcase/go_xcat/case0 b/xCAT-test/autotest/testcase/go_xcat/case0 index 7af2a8a04..5578faac9 100644 --- a/xCAT-test/autotest/testcase/go_xcat/case0 +++ b/xCAT-test/autotest/testcase/go_xcat/case0 @@ -18,9 +18,9 @@ check:rc==0 cmd:xdsh $$CN "cd /xcat-core; ./mklocalrepo.sh" check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update"; fi check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/go-xcat.log" cmd:if grep SUSE /etc/*release;then xdsh $$CN "cd /; ./go-xcat --xcat-core=/etc/zypp/repos.d/xCAT-core.repo -y install"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cd /; ./go-xcat --xcat-core=/etc/yum.repos.d/xCAT-core.repo -y install"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cd /; ./go-xcat --xcat-core=/etc/apt/sources.list.d/xcat-core.list -y install";else echo "Sorry,this is not supported os"; fi @@ -57,9 +57,9 @@ check:rc==0 cmd:xdsh $$CN "cd /; tar -jxf /xcat-core.tar.bz2" check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update"; fi check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/go-xcat.log" cmd:xdsh $$CN "cd /; ./go-xcat --xcat-core=/xcat-core -y install" @@ -96,9 +96,9 @@ check:rc==0 cmd:xdsh $$CN "cd /; bunzip2 /xcat-core.tar.bz2" check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update"; fi check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/go-xcat.log" cmd:xdsh $$CN "cd /; ./go-xcat --xcat-core=/xcat-core.tar -y install" @@ -135,9 +135,9 @@ check:rc==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/xcat-dep*.tar.bz2 /xcat-dep.tar.bz2" check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update"; fi check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/go-xcat.log" cmd:xdsh $$CN "cd /; ./go-xcat --xcat-core=/xcat-core.tar.bz2 --xcat-dep=/xcat-dep.tar.bz2 -y install" @@ -182,9 +182,9 @@ check:rc==0 cmd:xdsh $$CN "cd /xcat-core; ./mklocalrepo.sh" check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update"; fi check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/go-xcat.log" cmd:if grep SUSE /etc/*release;then xdsh $$CN "cd /; ./go-xcat --xcat-core=/etc/zypp/repos.d/xCAT-core.repo --xcat-dep=/etc/zypp/repos.d/xCAT-dep.repo -y install"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cd /; ./go-xcat --xcat-core=/etc/yum.repos.d/xCAT-core.repo --xcat-dep=/etc/yum.repos.d/xCAT-dep.repo -y install"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cd /; ./go-xcat --xcat-core=/etc/apt/sources.list.d/xcat-core.list --xcat-dep=/etc/apt/sources.list.d/xcat-dep.list -y install"; else echo "Sorry,this is not supported os"; fi @@ -225,9 +225,9 @@ check:rc==0 cmd:xdsh $$CN "cd /; tar -jxf /xcat-core.tar.bz2" check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update"; fi check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/go-xcat.log" cmd:xdsh $$CN "cd /; ./go-xcat --xcat-core=/xcat-core --xcat-dep=/xcat-dep -y install" @@ -262,9 +262,9 @@ check:rc==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/xcat-dep*.tar.bz2 /xcat-dep.tar.bz2" check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update"; fi check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/go-xcat.log" cmd:xdsh $$CN "cd /; ./go-xcat --xcat-core=/xcat-core.tar.bz2 --xcat-dep=/xcat-dep.tar.bz2 -y install" diff --git a/xCAT-test/autotest/testcase/go_xcat/case1 b/xCAT-test/autotest/testcase/go_xcat/case1 index de11a1a6a..134f0a843 100644 --- a/xCAT-test/autotest/testcase/go_xcat/case1 +++ b/xCAT-test/autotest/testcase/go_xcat/case1 @@ -13,9 +13,9 @@ check:rc==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/opt/xcat/share/xcat/tools/go-xcat ./" check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update"; fi check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/go-xcat.log" cmd:xdsh $$CN "cd /; ./go-xcat --yes install" @@ -48,9 +48,9 @@ check:rc==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/opt/xcat/share/xcat/tools/go-xcat ./" check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update"; fi check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/go-xcat.log" cmd:migration_version=`echo $$MIGRATION2_VERSION |cut -d "." -f -2`; xdsh $$CN "cd /; ./go-xcat -x $migration_version -y install" @@ -90,9 +90,9 @@ check:rc==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/opt/xcat/share/xcat/tools/go-xcat ./" check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update"; fi check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/go-xcat.log" cmd:xdsh $$CN "cd /; ./go-xcat --xcat-version=devel -y install" @@ -125,9 +125,9 @@ check:rc==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/opt/xcat/share/xcat/tools/go-xcat ./" check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update"; fi check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/go-xcat.log" cmd:migration_version=`echo $$MIGRATION2_VERSION |cut -d "." -f -2`; xdsh $$CN "cd /; ./go-xcat --xcat-version=$migration_version -y install" diff --git a/xCAT-test/autotest/testcase/go_xcat/case2 b/xCAT-test/autotest/testcase/go_xcat/case2 index 058a19de3..98bdef85b 100644 --- a/xCAT-test/autotest/testcase/go_xcat/case2 +++ b/xCAT-test/autotest/testcase/go_xcat/case2 @@ -43,9 +43,9 @@ check:rc==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/opt/xcat/share/xcat/tools/go-xcat ./" check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update"; fi check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/go-xcat.log" cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "cd /; ./go-xcat --xcat-core=http://xcat.org/files/xcat/repos/apt/$$BRANCH/core-snap/";else xdsh $$CN "cd /; ./go-xcat --xcat-core=http://xcat.org/files/xcat/repos/yum/$$BRANCH/core-snap/ -y install"; fi @@ -79,9 +79,9 @@ check:rc==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/opt/xcat/share/xcat/tools/go-xcat ./" check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update"; fi check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/go-xcat.log" cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "cd /; ./go-xcat --xcat-core=http://xcat.org/files/xcat/xcat-core/devel/Ubuntu/core-snap/core-debs-snap.tar.bz2";else xdsh $$CN "cd /; ./go-xcat --xcat-core=http://xcat.org/files/xcat/xcat-core/devel/Linux/core-snap/core-rpms-snap.tar.bz2 -y install"; fi @@ -147,9 +147,9 @@ cmd:xdsh $$CN "cd /; scp -r $$MN:/opt/xcat/share/xcat/tools/go-xcat ./" check:rc==0 cmd:dir="__GETNODEATTR($$CN,os)__"; if grep SUSE /etc/*release;then os=`echo $dir |cut -c 1-6` && xdsh $$CN "cd /xcat-dep/$os/__GETNODEATTR($$CN,arch)__/; ./mklocalrepo.sh" ; elif grep "Red Hat" /etc/*release;then os=`echo $dir |cut -c 1-2` && xdsh $$CN "cd /xcat-dep/$os`echo __GETNODEATTR($$CN,os)__ | cut -c6`/__GETNODEATTR($$CN,arch)__/; ./mklocalrepo.sh"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cd /xcat-dep; ./mklocalrepo.sh"; else echo "Sorry,this is not supported os"; fi cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update"; fi check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/go-xcat.log" cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "cd /; ./go-xcat --xcat-core=http://xcat.org/files/xcat/repos/apt/devel/core-snap/ --xcat-dep=http://xcat.org/files/xcat/repos/apt/xcat-dep/ -y install"; else xdsh $$CN "cd /; ./go-xcat --xcat-core=http://xcat.org/files/xcat/repos/yum/devel/core-snap/ --xcat-dep=http://xcat.org/files/xcat/repos/yum/xcat-dep/ -y install"; fi @@ -183,9 +183,9 @@ check:rc==0 cmd:cp /xcat-dep-*.tar.bz2 /install/ check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update"; fi check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/go-xcat.log" cmd:dep=`ls /install/xcat-dep-*.tar.bz2`;if grep Ubuntu /etc/*release;then xdsh $$CN "cd /; ./go-xcat --xcat-core=http://xcat.org/files/xcat/xcat-core/devel/Ubuntu/core-snap/core-debs-snap.tar.bz2 --xcat-dep=http://$$MN/$dep -y install"; else xdsh $$CN "cd /; ./go-xcat --xcat-core=http://xcat.org/files/xcat/xcat-core/devel/Linux/core-snap/core-rpms-snap.tar.bz2 --xcat-dep=http://$$MN/$dep -y install"; fi diff --git a/xCAT-test/autotest/testcase/go_xcat/case4 b/xCAT-test/autotest/testcase/go_xcat/case4 index c5603a64b..c214cb912 100644 --- a/xCAT-test/autotest/testcase/go_xcat/case4 +++ b/xCAT-test/autotest/testcase/go_xcat/case4 @@ -16,9 +16,9 @@ check:rc==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/xcat-dep*.tar.bz2 /xcat-dep.tar.bz2" check:rc==0 cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi check:rc==0 -cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update"; fi check:rc==0 cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "cd /; ./go-xcat --xcat-core=$$UBUNTU_MIGRATION2_CORE --xcat-dep=$$UBUNTU_MIGRATION2_DEP -y install";else xdsh $$CN "cd /; ./go-xcat -x $$MIGRATION1_VERSION -y install";fi check:rc==0 diff --git a/xCAT-test/autotest/testcase/httpport/cases0 b/xCAT-test/autotest/testcase/httpport/cases0 index a756fbf35..1c633b2aa 100644 --- a/xCAT-test/autotest/testcase/httpport/cases0 +++ b/xCAT-test/autotest/testcase/httpport/cases0 @@ -1,5 +1,5 @@ -start:http_port_change -description:Add test cases for bug fix 2629, change http port and then generate genesis (mknb). +start:genesis_work_with_non_default_http_80_port +description: change http port from default 80 to 8898 and then make sure generate genesis (mknb) work. label:mn_only,discovery cmd:netstat -nlp|grep -E "apache2|httpd" check:output =~ 80 @@ -97,3 +97,65 @@ check:rc==0 cmd:dir="/tftpboot/pxelinux.cfg/p"; rm -rf $dir; if [ -d ${dir}".bak" ];then mv ${dir}".bak" $dir; fi cmd:dir="/tftpboot/xcat/xnba/nets"; rm -rf $dir; if [ -d ${dir}".bak" ];then mv ${dir}".bak" $dir; fi end + +start:change_http_listen_port_from_80_to_8898_in_mn +description:This test case is used to simulate a http service which does not use default 80 port in mn. This is not a regular test case, just used to set up environment. +label:others,simulator +cmd:netstat -nlp|grep -E "apache2|httpd" +check:output =~ 80 +cmd:lsdef -t site -i httpport -c |awk -F"=" '{print $2}' +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/httpport/change_http_port.sh 80 8898 +cmd:netstat -nlp|grep -E "apache2|httpd" +check:output =~ 8898 +check:rc==0 +cmd:chdef -t site httpport=8898 +check:rc==0 +cmd:lsdef -t site -i httpport -c +check:output =~ 8898 +check:rc==0 +end + +start:change_http_listen_port_from_8898_to_80_in_mn +description:This test case is used to restore environment which has been modified by test case change_http_listen_port_from_80_to_8898_in_mn. This is not a regular test case, just used to set up environment. +label:others,simulator +cmd:netstat -nlp|grep -E "apache2|httpd" +check:output =~ 8898 +cmd:lsdef -t site -i httpport -c |awk -F"=" '{print $2}' +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/httpport/change_http_port.sh 8898 80 +cmd:netstat -nlp|grep -E "apache2|httpd" +check:output =~ 80 +check:rc==0 +cmd:chdef -t site httpport=80 +check:rc==0 +cmd:lsdef -t site -i httpport -c +check:output =~ 80 +check:rc==0 +end + +start:change_http_listen_port_from_80_to_8898_in_sn +description:This test case is used to simulate a http service which does not use default 80 port in sn. This is not a regular test case, just used to set up environment. +label:others,simulator +cmd:xdsh $$SN "netstat -nlp|grep -E 'apache2|httpd'" +check:output =~ 80 +cmd:xdsh $$SN "lsdef -t site -i httpport -c |awk -F'=' '{print $2}'" +cmd:scp /opt/xcat/share/xcat/tools/autotest/testcase/httpport/change_http_port.sh $$SN:/tmp +cmd:xdsh $$SN "ls -l /tmp/ |grep change_http_port.sh" +cmd:xdsh $$SN "chmod +x /tmp/change_http_port.sh && /tmp/change_http_port.sh 80 8898" +cmd:xdsh $$SN "netstat -nlp|grep -E 'apache2|httpd' |grep 8898" +check:output =~ 8898 +check:rc==0 +end + +start:change_http_listen_port_from_8898_to_80_in_sn +description:This test case is used to restore environment which has been modified by test case change_http_listen_port_from_80_to_8898_in_sn. This is not a regular test case, just used to set up environment. +label:others,simulator +cmd:xdsh $$SN "netstat -nlp|grep -E 'apache2|httpd'" +check:output =~ 8898 +cmd:xdsh $$SN "lsdef -t site -i httpport -c |awk -F'=' '{print $2}'" +cmd:scp /opt/xcat/share/xcat/tools/autotest/testcase/httpport/change_http_port.sh $$SN:/tmp +cmd:xdsh $$SN "ls -l /tmp/ |grep change_http_port.sh" +cmd:xdsh $$SN "chmod +x /tmp/change_http_port.sh && /tmp/change_http_port.sh 8898 80" +cmd:xdsh $$SN "netstat -nlp|grep -E 'apache2|httpd' |grep 80" +check:output =~ 80 +check:rc==0 +end diff --git a/xCAT-test/autotest/testcase/httpport/change_http_port.sh b/xCAT-test/autotest/testcase/httpport/change_http_port.sh index 527bd290d..4ddf8b0ff 100755 --- a/xCAT-test/autotest/testcase/httpport/change_http_port.sh +++ b/xCAT-test/autotest/testcase/httpport/change_http_port.sh @@ -11,8 +11,12 @@ echo "The original httpd port is $port in $config" echo "start to change httpd listen port to $2" sed -i "s/^Listen $1/Listen $2/g" $config -if [ -f "/etc/apache2/sites-enabled/000-default.conf" ]; then - sed -i "s/VirtualHost \*:$1/VirtualHost \*:$2/g" /etc/apache2/sites-enabled/000-default.conf +echo "Restart http service" +service apache2 status > /dev/null 2>&1 +if [ "$?" -eq "0" ]; then + if [ -f "/etc/apache2/sites-enabled/000-default.conf" ]; then + sed -i "s/VirtualHost \*:$1/VirtualHost \*:$2/g" /etc/apache2/sites-enabled/000-default.conf + fi service apache2 stop sleep 1 service apache2 start @@ -21,4 +25,4 @@ else sleep 1 service httpd start fi -exit +exit $? diff --git a/xCAT-test/autotest/testcase/installation/SN_diskless_setup_case b/xCAT-test/autotest/testcase/installation/SN_diskless_setup_case index ee1517af5..371584a04 100644 --- a/xCAT-test/autotest/testcase/installation/SN_diskless_setup_case +++ b/xCAT-test/autotest/testcase/installation/SN_diskless_setup_case @@ -11,10 +11,10 @@ cmd:chtab key=nameservers site.value="" check:rc==0 cmd:makedns -n check:rc==0 -cmd:makeconservercf $$SN +cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$SN; else makeconservercf $$SN;fi check:rc==0 -cmd:cat /etc/conserver.cf | grep $$SN -check:output=~$$SN +#cmd:cat /etc/conserver.cf | grep $$SN +#check:output=~$$SN cmd:sleep 20 cmd:if [[ "__GETNODEATTR($$SN,arch)__" = "ppc64" ]]; then getmacs -D $$SN -V; fi check:rc==0 @@ -45,7 +45,7 @@ check:rc==0 cmd:cd /install/post/otherpkgs/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__/xcat/xcat-core && createrepo . check:rc==0 -cmd:if [[ "__GETNODEATTR($$SN,os)__" =~ "rh" ]]; then path="rh";elif [[ "__GETNODEATTR($$SN,os)__" =~ "sles" ]];then path="sles";fi; ver="__GETNODEATTR($$SN,os)__"; tmp=${ver%.*};ver=`echo "$tmp"|sed 's:[a-zA-Z]::g'`;cd /install/post/otherpkgs/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__/xcat/xcat-dep/$path$ver/__GETNODEATTR($$SN,arch)__ && createrepo .; +cmd:if [[ "__GETNODEATTR($$SN,os)__" =~ "rh" ]]; then path="rh";elif [[ "__GETNODEATTR($$SN,os)__" =~ "sles" ]];then path="sles";fi; ver="__GETNODEATTR($$SN,os)__"; tmp=${ver%%.*};ver=`echo "$tmp"|sed 's:[a-zA-Z]::g'`;cd /install/post/otherpkgs/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__/xcat/xcat-dep/$path$ver/__GETNODEATTR($$SN,arch)__ && createrepo .; check:rc==0 cmd:mkdef -t osimage -o __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-netboot-service --template __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-netboot-compute profile=service provmethod=netboot postscripts=servicenode @@ -54,21 +54,24 @@ check:rc==0 cmd:chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-netboot-service otherpkgdir=/install/post/otherpkgs/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__ check:rc==0 -cmd:if [[ "__GETNODEATTR($$SN,os)__" =~ "rh" ]]; then path="rh";elif [[ "__GETNODEATTR($$SN,os)__" =~ "sles" ]];then path="sles";fi; ver="__GETNODEATTR($$SN,os)__"; chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-netboot-service otherpkglist=/opt/xcat/share/xcat/netboot/$path/service.${ver%.*}.__GETNODEATTR($$SN,arch)__.otherpkgs.pkglist pkglist=/opt/xcat/share/xcat/netboot/$path/service.${ver%.*}.__GETNODEATTR($$SN,arch)__.pkglist exlist=/opt/xcat/share/xcat/netboot/$path/service.${ver%.*}.__GETNODEATTR($$SN,arch)__.exlist postinstall=/opt/xcat/share/xcat/netboot/$path/service.${ver%.*}.__GETNODEATTR($$SN,arch)__.postinstall; echo "xcat/xcat-core/xCAT-openbmc-py" >> /opt/xcat/share/xcat/netboot/$path/service.${ver%.*}.__GETNODEATTR($$SN,arch)__.otherpkgs.pkglist; cat /opt/xcat/share/xcat/netboot/$path/service.${ver%.*}.__GETNODEATTR($$SN,arch)__.otherpkgs.pkglist +cmd:if [[ "__GETNODEATTR($$SN,os)__" =~ "rh" ]]; then path="rh";elif [[ "__GETNODEATTR($$SN,os)__" =~ "sles" ]];then path="sles";fi; ver="__GETNODEATTR($$SN,os)__"; chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-netboot-service otherpkglist=/opt/xcat/share/xcat/netboot/$path/service.${ver%%.*}.__GETNODEATTR($$SN,arch)__.otherpkgs.pkglist pkglist=/opt/xcat/share/xcat/netboot/$path/service.${ver%%.*}.__GETNODEATTR($$SN,arch)__.pkglist exlist=/opt/xcat/share/xcat/netboot/$path/service.${ver%%.*}.__GETNODEATTR($$SN,arch)__.exlist postinstall=/opt/xcat/share/xcat/netboot/$path/service.${ver%%.*}.__GETNODEATTR($$SN,arch)__.postinstall check:rc==0 cmd:path="/install/netboot/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__/service"; if [ -d "$path" ]; then mv $path $path."org"; fi; mkdir -p $path check:rc==0 + cmd:chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-netboot-service rootimgdir=/install/netboot/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__/service check:rc==0 -cmd:chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-netboot-service -p pkgdir=$$PYTHON_DEP_EPEL_DIR,$$PYTHON_DEP_EXTRAS_DIR,$$PYTHON_DEP_FED_DIR +#if there was xCAT-openbmc-py been installed in MN, install xCAT-openbmc-py in SN accordingly +cmd:if rpm -qa|grep xCAT-openbmc-py 2>&1; then osimage="__GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-netboot-service";otherpkglist=$(lsdef -t osimage $osimage -i otherpkglist -c|awk -F"=" '{print $2}'); echo "xcat/xcat-core/xCAT-openbmc-py" >> $otherpkglist; chdef -t osimage $osimage -p pkgdir=$$PYTHON_DEP_EPEL_DIR,$$PYTHON_DEP_EXTRAS_DIR,$$PYTHON_DEP_FED_DIR; else echo "there is no xCAT-openbmc-py installed in MN, skip installing xCAT-openbmc-py in SN"; exit 0;fi check:rc==0 cmd:lsdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-netboot-service check:rc==0 +cmd:osimage="__GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-netboot-service";otherpkglist=$(lsdef -t osimage $osimage -i otherpkglist -c|awk -F"=" '{print $2}'); cat $otherpkglist cmd:if [ ! -d /tmp/mountoutput ]; then mkdir -p /tmp/mountoutput; fi cmd:mount |sort > /tmp/mountoutput/file.org @@ -77,24 +80,20 @@ cmd:genimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-netboot-service check:rc==0 cmd:mount |sort > /tmp/mountoutput/file.new -cmd:diff -y /tmp/mountoutput/file.org /tmp/mountoutput/file.new +cmd:diff -y /tmp/mountoutput/file.org /tmp/mountoutput/file.new --ignore-matching-lines="fusectl" check:rc==0 cmd:rm -rf /tmp/mountoutput cmd:packimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-netboot-service check:rc==0 -cmd:rinstall $$SN osimage=__GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-netboot-service +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$SN __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-netboot-service check:rc==0 check:output=~Provision node\(s\)\: $$SN cmd:if [[ -f /var/lib/dhcp/db/dhcpd.leases ]]; then cat /var/lib/dhcp/db/dhcpd.leases; elif [[ -f /var/lib/dhcpd/dhcpd.leases ]];then cat /var/lib/dhcpd/dhcpd.leases;elif [[ -f /var/lib/dhcp/dhcpd.leases ]];then cat /var/lib/dhcp/dhcpd.leases; fi -cmd:sleep 180 - -cmd:a=0;while ! `lsdef -l $$SN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 60 ];then break;fi done - cmd:ping $$SN -c 3 check:rc==0 check:output=~64 bytes from $$SN @@ -107,12 +106,15 @@ check:output=~\d\d:\d\d:\d\d cmd:xdsh $$SN mount check:rc==0 check:output=~on / type tmpfs -cmd:xdsh $$SN rpm -qa|grep "xCAT-openbmc-py" +cmd:xdsh $$SN cat /opt/xcat/xcatinfo check:rc==0 -check:output=~xCAT-openbmc-py-\d -cmd:xdsh $$SN rpm -qa|grep "gevent" +check:output=~NODE=$$SN +check:output=~IMAGENAME='__GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-netboot-service' +check:output=~IMAGEUUID='\w+-\w+-\w+-\w+-\w+' +cmd:if rpm -qa|grep xCAT-openbmc-py 2>&1; then xdsh $$SN rpm -qa|grep "xCAT-openbmc-py" ;else echo "there is no xCAT-openbmc-py installed in MN, skip check xCAT-openbmc-py installation in SN"; exit 0;fi +check:rc==0 +cmd:if rpm -qa|grep xCAT-openbmc-py 2>&1; then xdsh $$SN rpm -qa|grep "gevent" ;else echo "there is no xCAT-openbmc-py installed in MN, skip check gevent installation in SN"; exit 0;fi check:rc==0 -check:output=~ gevent-\d cmd:xdsh $$SN "service httpd status" check:rc==0 cmd:xdsh $$SN "service systemd status" @@ -121,4 +123,5 @@ cmd:xdsh $$SN "cat /var/log/xcat/xcat.log" cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-netboot-service|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir.org ]; then rm -rf $rootimgdir; mv $rootimgdir.org $rootimgdir; fi check:rc==0 cmd:xdsh $$SN "cat /var/log/xcat/xcat.log" +cmd:if [ -x /usr/bin/goconserver ]; then makegocons -d $$SN; else makeconservercf -d $$SN;fi end diff --git a/xCAT-test/autotest/testcase/installation/SN_setup_case b/xCAT-test/autotest/testcase/installation/SN_setup_case index 566600ba9..75527edf2 100644 --- a/xCAT-test/autotest/testcase/installation/SN_setup_case +++ b/xCAT-test/autotest/testcase/installation/SN_setup_case @@ -12,10 +12,10 @@ check:rc==0 cmd:makedns -n check:rc==0 -cmd:makeconservercf $$SN +cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$SN; else makeconservercf $$SN;fi check:rc==0 -cmd:cat /etc/conserver.cf | grep $$SN -check:output=~$$SN +#cmd:cat /etc/conserver.cf | grep $$SN +#check:output=~$$SN cmd:sleep 20 cmd:if [[ "__GETNODEATTR($$SN,arch)__" = "ppc64" ]]; then getmacs -D $$SN -V; fi check:rc==0 @@ -23,6 +23,7 @@ cmd:makedhcp -n check:rc==0 cmd:makedhcp -a check:rc==0 +cmd:sleep 2 cmd:if cat /etc/*release |grep SUSE >/dev/null;then cat /var/lib/dhcp/db/dhcpd.leases|grep $$SN;elif cat /etc/*release |grep "Red Hat" >/dev/null;then cat /var/lib/dhcpd/dhcpd.leases|grep $$SN;fi check:output=~$$SN cmd:chdef -t node $$SN groups=service,all @@ -45,19 +46,22 @@ check:rc==0 cmd:cd /install/post/otherpkgs/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__/xcat/xcat-core && createrepo . check:rc==0 -cmd:if [[ "__GETNODEATTR($$SN,os)__" =~ "rh" ]]; then path="rh";elif [[ "__GETNODEATTR($$SN,os)__" =~ "sles" ]];then path="sles";fi; ver="__GETNODEATTR($$SN,os)__"; tmp=${ver%.*};ver=`echo "$tmp"|sed 's:[a-zA-Z]::g'`;cd /install/post/otherpkgs/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__/xcat/xcat-dep/$path$ver/__GETNODEATTR($$SN,arch)__ && createrepo .; +cmd:if [[ "__GETNODEATTR($$SN,os)__" =~ "rh" ]]; then path="rh";elif [[ "__GETNODEATTR($$SN,os)__" =~ "sles" ]];then path="sles";fi; ver="__GETNODEATTR($$SN,os)__"; tmp=${ver%%.*};ver=`echo "$tmp"|sed 's:[a-zA-Z]::g'`;cd /install/post/otherpkgs/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__/xcat/xcat-dep/$path$ver/__GETNODEATTR($$SN,arch)__ && createrepo .; check:rc==0 cmd:chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service otherpkgdir=/install/post/otherpkgs/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__ check:rc==0 -cmd:if [[ "__GETNODEATTR($$SN,os)__" =~ "rh" ]]; then path="rh";elif [[ "__GETNODEATTR($$SN,os)__" =~ "sles" ]];then path="sles";fi; ver="__GETNODEATTR($$SN,os)__"; chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service otherpkglist=/opt/xcat/share/xcat/install/$path/service.${ver%.*}.__GETNODEATTR($$SN,arch)__.otherpkgs.pkglist; +cmd:if [[ "__GETNODEATTR($$SN,os)__" =~ "rh" ]]; then path="rh";elif [[ "__GETNODEATTR($$SN,os)__" =~ "sles" ]];then path="sles";fi; ver="__GETNODEATTR($$SN,os)__"; chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service otherpkglist=/opt/xcat/share/xcat/install/$path/service.${ver%%.*}.__GETNODEATTR($$SN,arch)__.otherpkgs.pkglist; check:rc==0 -#cmd:chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service pkgdir="/install/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__" -#check:rc==0 +#add support python in sn +#if xCAT-openbmc-py has been installed in MN, will install xCAT-openbmc-py in sn +cmd:if rpm -qa|grep xCAT-openbmc-py 2>&1; then osimage="__GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service"; otherpkgdir=$(lsdef -t osimage $osimage -i otherpkgdir -c|awk -F"=" '{print $2}'); otherpkglist=$(lsdef -t osimage $osimage -i otherpkglist -c|awk -F"=" '{print $2}');mkdir -p $otherpkgdir/xcat/Packages; cp -r $$PYTHON_DEP_FED_DIR/Packages/*.rpm $otherpkgdir/xcat/Packages; cp -r $$PYTHON_DEP_EPEL_DIR/Packages/* $otherpkgdir/xcat/Packages; cp -r $$PYTHON_DEP_EXTRAS_DIR/Packages/* $otherpkgdir/xcat/Packages; cd $otherpkgdir/xcat/Packages && createrepo .; echo "xcat/Packages/python2-gevent" >> $otherpkglist; echo "xcat/Packages/python2-greenlet" >> $otherpkglist; echo "xcat/xcat-core/xCAT-openbmc-py" >> $otherpkglist; echo "--To check otherpkgdir"; ls -Rl $otherpkgdir/xcat/Packages; if ! ls -l $otherpkgdir/xcat/Packages|grep python2-gevent- > /dev/null 2>&1; then echo "there is no python2-gevent package under $otherpkgdir/xcat/Packages";exit 1; fi; if ! ls -l $otherpkgdir/xcat/Packages|grep python2-greenlet- > /dev/null 2>&1; then echo "there is no python2-greenlet under $otherpkgdir/xcat/Packages";exit 1; fi; echo "--To check otherpkglist"; cat $otherpkglist; if ! grep python2-gevent $otherpkglist > /dev/null 2>&1; then echo "there is no entry about python2-gevent in $otherpkglist"; exit 1;fi; if ! grep python2-greenlet $otherpkglist > /dev/null 2>&1; then echo "there is no entry about python2-greenlet in $otherpkglist"; exit 1;fi; exit 0; else echo "there is no xCAT-openbmc-py installed in MN, skip installing xCAT-openbmc-py in SN"; exit 0;fi +check:rc==0 -cmd:rinstall $$SN osimage=__GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service + +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$SN __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service check:rc==0 check:output=~Provision node\(s\)\: $$SN @@ -91,9 +95,20 @@ check:output=~/install on /install cmd:xdsh $$SN "mount" check:rc==0 check:output=~/tftpboot on /tftpboot +cmd:xdsh $$SN cat /opt/xcat/xcatinfo +check:rc==0 +check:output=~NODE=$$SN +check:output=~IMAGENAME=__GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service +cmd:if rpm -qa|grep xCAT-openbmc-py 2>&1; then xdsh $$SN "rpm -qa|grep xCAT-openbmc-py";else echo "there is no xCAT-openbmc-py installed in MN, skip check xCAT-openbmc-py installation in SN"; exit 0;fi +check:rc==0 +cmd:if rpm -qa|grep xCAT-openbmc-py 2>&1; then xdsh $$SN "rpm -qa|grep python2-gevent"; else echo "there is no xCAT-openbmc-py installed in MN, skip check python2-gevent installation in SN"; exit 0;fi +check:rc==0 +cmd:if rpm -qa|grep xCAT-openbmc-py 2>&1; then xdsh $$SN "rpm -qa|grep python2-greenlet"; else echo "there is no xCAT-openbmc-py installed in MN, skip check python2-greenlet installation in SN"; exit 0;fi +check:rc==0 cmd:xdsh $$SN "cat /var/log/xcat/xcat.log" cmd:if [[ "__GETNODEATTR($$SN,arch)__" =~ "x86_64" ]]; then if [[ "__GETNODEATTR($$SN,os)__" =~ "sles" ]];then xdsh $$SN "zypper -n install perl-Sys-Virt"; elif [[ "__GETNODEATTR($$SN,os)__" =~ "rh" ]];then xdsh $$SN "yum install -y perl-Sys-Virt";fi;fi check:rc==0 cmd:makentp -a check:rc==0 +cmd:if [ -x /usr/bin/goconserver ]; then makegocons -d $$SN; else makeconservercf -d $$SN;fi end diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat index ee6747707..b13c10e2a 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat @@ -7,15 +7,14 @@ cmd:df -T cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi cmd:MINIISO=NUll;if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "ppc64" ]];then mkdir /tmp/iso; mount -o loop $$MINIISO /tmp/iso ; mkdir -p /install/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/install/netboot; cp /tmp/iso/install/initrd.gz /install/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/install/netboot;umount /tmp/iso; rmdir /tmp/iso; fi check:rc==0 - +cmd: if lsdef service > /dev/null 2>&1; then chdef service -m groups=service;fi +check:rc==0 cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN check:rc==0 cmd:makedns -n check:rc==0 -cmd:makeconservercf +cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN; fi check:rc==0 -cmd:cat /etc/conserver.cf | grep $$CN -check:output=~$$CN cmd:sleep 20 cmd:if [[ "__GETNODEATTR($$CN,arch)__" = "ppc64" ]] && [[ "__GETNODEATTR($$CN,mgt)__" != "ipmi" ]]; then getmacs -D $$CN; fi check:rc==0 @@ -41,12 +40,10 @@ cmd:if ! ([[ "__GETNODEATTR($$CN,os)__" = "sles12.1" ]] || [[ "__GETNODEATTR($$C check:rc==0 cmd:lsdef -l $$CN check:rc==0 -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:if [[ -f /var/lib/dhcp/db/dhcpd.leases ]]; then cat /var/lib/dhcp/db/dhcpd.leases; elif [[ -f /var/lib/dhcpd/dhcpd.leases ]];then cat /var/lib/dhcpd/dhcpd.leases;elif [[ -f /var/lib/dhcp/dhcpd.leases ]];then cat /var/lib/dhcp/dhcpd.leases; fi -cmd:sleep 300 -cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 20;((a++));if [ $a -gt 300 ];then break;fi done cmd:ping $$CN -c 3 check:rc==0 check:output=~64 bytes from $$CN @@ -58,6 +55,10 @@ check:rc==0 check:output=~\d\d:\d\d:\d\d cmd:xdsh $$CN mount check:rc==0 +cmd:xdsh $$CN cat /opt/xcat/xcatinfo +check:rc==0 +check:output=~NODE=$$CN +check:output=~IMAGENAME=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute cmd:sleep 120 #comment for further discussion #cmd:if ! ([[ "__GETNODEATTR($$CN,os)__" = "sles12.1" ]] || [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu" && "__GETNODEATTR($$CN,arch)__" = "x86_64" ]]) ;then xdsh $$CN service ntpd status;fi @@ -72,6 +73,7 @@ check:output=~64 bytes from $$CN cmd:xdsh $$CN "cat /var/log/xcat/xcat.log" cmd:xdsh $$CN "cat /test.synclist" check:rc==0 +cmd:if [ -x /usr/bin/goconserver ]; then makegocons -d $$CN; else makeconservercf -d $$CN; fi cmd:if [[ -f /test.synclist.bak ]] ;then mv -f /test.synclist.bak /tmp/test.synclist;else rm -rf /test.synclist;fi cmd:chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute synclists= end diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy index b055cf563..f78bf840a 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy @@ -20,10 +20,10 @@ check:rc==0 cmd:makedns -n check:rc==0 -cmd:makeconservercf +cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN;fi check:rc==0 -cmd:cat /etc/conserver.cf | grep $$CN -check:output=~$$CN +#cmd:cat /etc/conserver.cf | grep $$CN +#check:output=~$$CN cmd:sleep 20 cmd:if [[ "__GETNODEATTR($$CN,arch)__" = "ppc64" ]]; then getmacs -D $$CN; fi check:rc==0 @@ -42,7 +42,7 @@ cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-ins check:rc==0 cmd:updatenode $$CN -f check:rc==0 -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN @@ -53,8 +53,6 @@ cmd:if [[ "__GETNODEATTR($$CN,arch)__" =~ "ppc" ]]; then sleep 120;elif [[ "__GE #check:rc==0 #check:output!~booted -cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 60;((a++));if [ $a -gt 50 ];then break;fi done - cmd:ping $$CN -c 3 check:rc==0 check:output=~64 bytes from $$CN @@ -66,9 +64,15 @@ check:rc==0 check:output=~\d\d:\d\d:\d\d cmd:xdsh $$CN mount check:rc==0 +cmd:xdsh $$CN cat /opt/xcat/xcatinfo +check:rc==0 +check:output=~NODE=$$CN +check:output=~IMAGENAME=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +check:output=~SERVICEGROUP=$$SN cmd:xdsh $$CN "cat /var/log/xcat/xcat.log" cmd:xdsh $$CN "cat /test.synclist" check:rc==0 +cmd:if [ -x /usr/bin/goconserver ]; then makegocons -d $$CN; else makeconservercf -d $$CN; fi cmd:if [[ -f /test.synclist.bak ]] ;then mv -f /test.synclist.bak /test.synclist;else rm -rf /test.synclist;fi cmd:chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute synclists= end diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat index f183bba92..c1bfd7c5c 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat @@ -4,15 +4,15 @@ label:flat_cn_diskless,provision #stop:yes cmd:fdisk -l cmd:df -T +cmd: if lsdef service > /dev/null 2>&1; then chdef service -m groups=service;fi +check:rc==0 cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN check:rc==0 cmd:makedns -n check:rc==0 -cmd:makeconservercf $$CN +cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN; fi check:rc==0 -cmd:cat /etc/conserver.cf | grep $$CN -check:output=~$$CN cmd:sleep 20 cmd:if [[ "__GETNODEATTR($$CN,arch)__" = "ppc64" ]] && [[ "__GETNODEATTR($$CN,mgt)__" != "ipmi" ]]; then getmacs -D $$CN; fi check:rc==0 @@ -37,19 +37,17 @@ cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-comput check:rc==0 cmd:mount |sort > /tmp/mountoutput/file.new cmd:cat /tmp/mountoutput/file.new -cmd:diff /tmp/mountoutput/file.org /tmp/mountoutput/file.new +cmd:diff /tmp/mountoutput/file.org /tmp/mountoutput/file.new --ignore-matching-lines="fusectl" check:rc==0 cmd:rm -rf /tmp/mountoutput cmd:packimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:if [[ -f /var/lib/dhcp/db/dhcpd.leases ]]; then cat /var/lib/dhcp/db/dhcpd.leases; elif [[ -f /var/lib/dhcpd/dhcpd.leases ]];then cat /var/lib/dhcpd/dhcpd.leases;elif [[ -f /var/lib/dhcp/dhcpd.leases ]];then cat /var/lib/dhcp/dhcpd.leases; fi -cmd:sleep 300 -cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 60 ];then break;fi done cmd:ping $$CN -c 3 check:rc==0 @@ -63,6 +61,11 @@ check:output=~\d\d:\d\d:\d\d cmd:xdsh $$CN mount check:rc==0 check:output=~on / type tmpfs +cmd:xdsh $$CN cat /opt/xcat/xcatinfo +check:rc==0 +check:output=~NODE=$$CN +check:output=~IMAGENAME='__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute' +check:output=~IMAGEUUID='\w+-\w+-\w+-\w+-\w+' cmd:sleep 120 cmd:ping $$CN -c 3 check:rc==0 @@ -73,6 +76,7 @@ check:rc==0 cmd:xdsh $$CN "cat /var/log/xcat/xcat.log" cmd:xdsh $$CN "cat /test.synclist" check:rc==0 +cmd:if [ -x /usr/bin/goconserver ]; then makegocons -d $$CN; else makeconservercf -d $$CN; fi cmd:if [[ -f /test.synclist.bak ]] ;then mv -f /test.synclist.bak /test.synclist;else rm -rf /test.synclist;fi cmd:chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute synclists= check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat_postscripts_failed b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat_postscripts_failed index d29e28cd0..1b0d15691 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat_postscripts_failed +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat_postscripts_failed @@ -41,7 +41,7 @@ cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-comput check:rc==0 cmd:mount |sort > /tmp/mountoutput/file.new cmd:cat /tmp/mountoutput/file.new -cmd:diff /tmp/mountoutput/file.org /tmp/mountoutput/file.new +cmd:diff /tmp/mountoutput/file.org /tmp/mountoutput/file.new --ignore-matching-lines="fusectl" check:rc==0 cmd:rm -rf /tmp/mountoutput cmd:packimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy index 23354bf69..b24aafdd1 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy @@ -16,10 +16,8 @@ check:rc==0 cmd:makedns -n check:rc==0 -cmd:makeconservercf $$CN +cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN; fi check:rc==0 -cmd:cat /etc/conserver.cf | grep $$CN -check:output=~$$CN cmd:sleep 20 cmd:if [[ "__GETNODEATTR($$CN,arch)__" = "ppc64" ]]; then getmacs -D $$CN; fi check:rc==0 @@ -49,13 +47,11 @@ check:rc==0 cmd:updatenode $$CN -f check:rc==0 -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:xdsh $$SN "if [[ -f /var/lib/dhcp/db/dhcpd.leases ]]; then cat /var/lib/dhcp/db/dhcpd.leases; elif [[ -f /var/lib/dhcpd/dhcpd.leases ]];then cat /var/lib/dhcpd/dhcpd.leases;elif [[ -f /var/lib/dhcp/dhcpd.leases ]];then cat /var/lib/dhcp/dhcpd.leases; fi" -cmd:sleep 300 -cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 60 ];then break;fi done cmd:ping $$CN -c 3 check:rc==0 @@ -69,11 +65,18 @@ check:output=~\d\d:\d\d:\d\d cmd:xdsh $$CN mount check:rc==0 check:output=~on / type tmpfs +cmd:xdsh $$CN cat /opt/xcat/xcatinfo +check:rc==0 +check:output=~NODE=$$CN +check:output=~IMAGENAME='__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute' +check:output=~IMAGEUUID='\w+-\w+-\w+-\w+-\w+' +check:output=~SERVICEGROUP=$$SN cmd:xdsh $$CN "cat /var/log/xcat/xcat.log" cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir.regbak ]; then rm -rf $rootimgdir; mv $rootimgdir.regbak $rootimgdir; fi check:rc==0 cmd:xdsh $$CN "cat /test.synclist" check:rc==0 +cmd:if [ -x /usr/bin/goconserver ]; then makegocons -d $$CN; else makeconservercf -d $$CN; fi cmd:if [[ -f /test.synclist.bak ]] ;then mv -f /test.synclist.bak /test.synclist;else rm -rf /test.synclist;fi cmd:chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute synclists= check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat index 2b3c37a7b..a7f5223bc 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat @@ -4,13 +4,14 @@ label:others,provision,statelite #stop:yes cmd:fdisk -l cmd:df -T - +cmd: if lsdef service > /dev/null 2>&1; then chdef service -m groups=service;fi +check:rc==0 cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN check:rc==0 cmd:makedns -n check:rc==0 -cmd:makeconservercf $$CN +cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN; fi check:rc==0 cmd:sleep 20 cmd:if [[ "__GETNODEATTR($$CN,arch)__" = "ppc64" ]]; then getmacs -D $$CN; fi @@ -37,7 +38,7 @@ cmd:cat /etc/exports|grep nodedata; if [ "$?" -ne "0" ]; then echo "/nodedata *( check:rc==0 cmd:cd /etc; export exports;cd - check:rc==0 -cmd:if cat /etc/*release |grep SUSE >/dev/null;then service nfsserver restart; elif cat /etc/*release |grep "Red Hat" >/dev/null;then service nfs restart; fi +cmd:if cat /etc/*release |grep SUSE >/dev/null;then service nfsserver restart; elif cat /etc/*release |grep "Red Hat" >/dev/null;then if [ -f /usr/lib/systemd/system/nfs-server.service ]; then service nfs-server restart; else service nfs restart;fi; fi check:rc==0 cmd:chtab node=$$CN statelite.statemnt="$$MN:/nodedata" check:rc==0 @@ -50,19 +51,18 @@ check:rc==0 cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir ]; then mv $rootimgdir $rootimgdir.regbak;fi check:rc==0 +cmd:chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute rootfstype=nfs +check:rc==0 cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute check:rc==0 cmd:liteimg __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute check:rc==0 -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:if [[ -f /var/lib/dhcp/db/dhcpd.leases ]]; then cat /var/lib/dhcp/db/dhcpd.leases; elif [[ -f /var/lib/dhcpd/dhcpd.leases ]];then cat /var/lib/dhcpd/dhcpd.leases;elif [[ -f /var/lib/dhcp/dhcpd.leases ]];then cat /var/lib/dhcp/dhcpd.leases; fi -cmd:sleep 300 -cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 60 ];then break;fi done - cmd:ping $$CN -c 3 check:rc==0 check:output=~64 bytes from $$CN @@ -93,13 +93,11 @@ check:rc==0 cmd:liteimg __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute check:rc==0 -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:if [[ -f /var/lib/dhcp/db/dhcpd.leases ]]; then cat /var/lib/dhcp/db/dhcpd.leases; elif [[ -f /var/lib/dhcpd/dhcpd.leases ]];then cat /var/lib/dhcpd/dhcpd.leases;elif [[ -f /var/lib/dhcp/dhcpd.leases ]];then cat /var/lib/dhcp/dhcpd.leases; fi -cmd:sleep 300 -cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 60 ];then break;fi done cmd:ping $$CN -c 3 check:rc==0 @@ -126,7 +124,7 @@ cmd:rm -rf /tmp/image;mkdir /tmp/image check:rc==0 cmd:imgexport __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute /tmp/image/image.tgz check:rc==0 - +cmd:if [ -x /usr/bin/goconserver ]; then makegocons -d $$CN; else makeconservercf -d $$CN; fi cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir.regbak ]; then rm -rf $rootimgdir; mv $rootimgdir.regbak $rootimgdir; fi check:rc==0 end diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs index 7fdbd8707..187d837b7 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs @@ -17,7 +17,7 @@ check:rc==0 cmd:makedns -n check:rc==0 -cmd:makeconservercf +cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN; fi check:rc==0 cmd:sleep 20 cmd:if [[ "__GETNODEATTR($$CN,arch)__" = "ppc64" ]]; then getmacs -D $$CN; fi @@ -41,7 +41,7 @@ cmd:xdsh $$SN 'cat /etc/exports|grep nodedata; if [ "$?" -ne "0" ]; then echo "/ check:rc==0 cmd:xdsh $$SN 'cd /etc; export exports;cd -' check:rc==0 -cmd:if cat /etc/*release |grep SUSE >/dev/null;then xdsh $$SN 'service nfsserver restart'; elif cat /etc/*release |grep "Red Hat" >/dev/null;then xdsh $$SN 'service nfs restart'; fi +cmd:if cat /etc/*release |grep SUSE >/dev/null;then xdsh $$SN 'service nfsserver restart'; elif cat /etc/*release |grep "Red Hat" >/dev/null;then xdsh $$SN 'if [ -f /usr/lib/systemd/system/nfs-server.service ]; then service nfs-server restart; else service nfs restart;fi'; fi check:rc==0 cmd:xdsh $$SN 'showmount -e' @@ -75,13 +75,11 @@ check:rc==0 cmd:prsync /install $$SN:/ check:rc==0 -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:xdsh $$SN "if [[ -f /var/lib/dhcp/db/dhcpd.leases ]]; then cat /var/lib/dhcp/db/dhcpd.leases; elif [[ -f /var/lib/dhcpd/dhcpd.leases ]];then cat /var/lib/dhcpd/dhcpd.leases;elif [[ -f /var/lib/dhcp/dhcpd.leases ]];then cat /var/lib/dhcp/dhcpd.leases; fi" -cmd:sleep 300 -cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 60 ];then break;fi done cmd:ping $$CN -c 3 check:rc==0 @@ -102,6 +100,7 @@ check:output=~$$CN: $$CN cmd:xdsh $$CN "cat /var/log/xcat/xcat.log" cmd:xdsh $$CN "echo "test"> /test.statelite" check:rc!=0 +cmd:if [ -x /usr/bin/goconserver ]; then makegocons -d $$CN; else makeconservercf -d $$CN; fi cmd:output=$(xdsh $$CN ls -al / |grep test.statelite);if [[ $? -eq 0 ]];then xdsh $$CN rm -rf /test.tatelite;fi cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir ]; then rm -rf $rootimgdir;fi check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk index 822c68b58..bc49996a9 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk @@ -17,7 +17,7 @@ check:rc==0 cmd:makedns -n check:rc==0 -cmd:makeconservercf +cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN; fi check:rc==0 cmd:sleep 20 cmd:if [[ "__GETNODEATTR($$CN,arch)__" = "ppc64" ]]; then getmacs -D $$CN; fi @@ -41,7 +41,7 @@ cmd:xdsh $$SN 'cat /etc/exports|grep nodedata; if [ "$?" -ne "0" ]; then echo "/ check:rc==0 cmd:xdsh $$SN 'cd /etc; export exports;cd -' check:rc==0 -cmd:if cat /etc/*release |grep SUSE >/dev/null;then xdsh $$SN 'service nfsserver restart'; elif cat /etc/*release |grep "Red Hat" >/dev/null;then xdsh $$SN 'service nfs restart'; fi +cmd:if cat /etc/*release |grep SUSE >/dev/null;then xdsh $$SN 'service nfsserver restart'; elif cat /etc/*release |grep "Red Hat" >/dev/null;then xdsh $$SN 'if [ -f /usr/lib/systemd/system/nfs-server.service ]; then service nfs-server restart; else service nfs restart;fi'; fi check:rc==0 cmd:chtab node=$$CN statelite.statemnt="$$SN:/nodedata" @@ -69,13 +69,11 @@ cmd:prsync /install $$SN:/ check:rc==0 -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:xdsh $$SN "if [[ -f /var/lib/dhcp/db/dhcpd.leases ]]; then cat /var/lib/dhcp/db/dhcpd.leases; elif [[ -f /var/lib/dhcpd/dhcpd.leases ]];then cat /var/lib/dhcpd/dhcpd.leases;elif [[ -f /var/lib/dhcp/dhcpd.leases ]];then cat /var/lib/dhcp/dhcpd.leases; fi" -cmd:sleep 300 -cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 60 ];then break;fi done cmd:ping $$CN -c 3 check:rc==0 @@ -94,6 +92,7 @@ cmd:xdsh $$CN hostname check:rc==0 check:output=~$$CN: $$CN cmd:xdsh $$CN "cat /var/log/xcat/xcat.log" +cmd:if [ -x /usr/bin/goconserver ]; then makegocons -d $$CN; else makeconservercf -d $$CN; fi cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir.regbak ]; then rm -rf $rootimgdir; mv $rootimgdir.regbak $rootimgdir; fi check:rc==0 end diff --git a/xCAT-test/autotest/testcase/installation/setup_vm b/xCAT-test/autotest/testcase/installation/setup_vm index 176b34546..a9613d522 100644 --- a/xCAT-test/autotest/testcase/installation/setup_vm +++ b/xCAT-test/autotest/testcase/installation/setup_vm @@ -7,8 +7,8 @@ check:rc==0 cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" -a "__GETNODEATTR($$CN,mgt)__" != "openbmc" ]; then echo "CN node is a vm, need to repower it on"; echo "rpower $$CN on"; rpower $$CN on; else echo "CN node $$CN is a non-VM; do not need to repower on it"; fi check:rc==0 -cmd:rpower $$CN stat -check:output=~on +cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" -a "__GETNODEATTR($$CN,mgt)__" != "openbmc" ]; then rpower $$CN stat;else echo "skip";fi +check:output=~on|skip cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" -a "__GETNODEATTR($$CN,mgt)__" != "openbmc" ]; then tabdump -w node==$$CN kvm_nodedata; fi check:rc==0 @@ -20,8 +20,8 @@ check:rc==0 cmd:if [ "__GETNODEATTR($$SN,arch)__" != "ppc64" -a "__GETNODEATTR($$SN,mgt)__" != "ipmi" -a "__GETNODEATTR($$SN,mgt)__" != "openbmc" ];then echo "SN node $$SN is a VM, need to rpower it on"; echo "rpower $$SN on"; rpower $$SN on; fi check:rc==0 -cmd:rpower $$SN stat -check:output=~on +cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" -a "__GETNODEATTR($$CN,mgt)__" != "openbmc" ]; then rpower $$SN stat;else echo "skip"; fi +check:output=~on|skip check:rc==0 cmd:if [ "__GETNODEATTR($$SN,arch)__" != "ppc64" -a "__GETNODEATTR($$SN,mgt)__" != "ipmi" -a "__GETNODEATTR($$SN,mgt)__" != "openbmc" ]; then tabdump -w node==$$SN kvm_nodedata; fi diff --git a/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm_docker b/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm_docker index c8e099502..f7a730b1b 100644 --- a/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm_docker +++ b/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm_docker @@ -21,7 +21,7 @@ cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu14.04" ]];then ver=`cat /etc/*-re check:rc==0 cmd: chdef $$CN -p postbootscripts="setupdockerhost mynet0=$$MYNET0VALUE@$$DOCKERHOSIP:$$NICNAME" check:rc==0 -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-dockerhost +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-dockerhost check:rc==0 check:output=~Provision node\(s\)\: $$CN diff --git a/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump b/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump index d9e8f86c7..6df6abca3 100644 --- a/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump +++ b/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump @@ -37,7 +37,7 @@ check:rc==0 cmd:if [ ! -d /kdumpdir ]; then mkdir -p /kdumpdir && chmod 777 /kdumpdir; fi cmd:if [ ! -f /etc/exports ] ;then touch /etc/exports;else cp /etc/exports /etc/exports.bak;fi cmd:cat /etc/exports|grep kdumpdir; if [ "$?" -ne "0" ]; then echo "/kdumpdir *(rw,no_root_squash,sync,no_subtree_check)" >> /etc/exports; fi -cmd:cd /etc; export exports;cd -;service nfs restart +cmd:cd /etc; export exports;cd -;service nfs-server restart cmd:chdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute dump=nfs://$$MN/kdumpdir check:rc==0 diff --git a/xCAT-test/autotest/testcase/lsdef/cases0 b/xCAT-test/autotest/testcase/lsdef/cases0 index dbd717f4f..7169dfa08 100644 --- a/xCAT-test/autotest/testcase/lsdef/cases0 +++ b/xCAT-test/autotest/testcase/lsdef/cases0 @@ -214,6 +214,7 @@ end start:lsdef_nics description:lsdef --nics label:mn_only,ci_test,db +cmd:lsdef testnode1;if [ $? -eq 0 ]; then lsdef -l testnode1 -z >/tmp/testnode1.standa ; rmdef testnode1;fi cmd:mkdef -t node -o testnode1 groups=all mgt=ipmi nicips.eth0=1.1.1.1 check:rc==0 cmd:lsdef testnode1 --nics @@ -223,6 +224,7 @@ cmd:rmdef testnode1 check:rc==0 cmd:lsdef testnode1 check:output=~Could not find +cmd:if [ -e /tmp/testnode1.standa ]; then cat /tmp/testnode1.standa | mkdef -z; rm -rf /tmp/testnode1.standa; fi end start:lsdef_template diff --git a/xCAT-test/autotest/testcase/lsvm/cases0 b/xCAT-test/autotest/testcase/lsvm/cases0 index 9929a5ea1..b29b2fc7b 100644 --- a/xCAT-test/autotest/testcase/lsvm/cases0 +++ b/xCAT-test/autotest/testcase/lsvm/cases0 @@ -5,16 +5,126 @@ #check:rc!=0 #check:output=~Usage #end -start:lsvm_node -label:others,hctrl_hmc -hcp:hmc,ivm -cmd:lsvm $$CN -check:rc==0 -check:output=~name=$$CN -end start:lsvm_err_node label:others,hctrl_hmc cmd:lsvm testnode check:rc!=0 check:output=~Error end + +start:lsvm +description:lsvm without any flag +label:mn_only,ci_test +cmd:lsvm +check:output=~Usage +end + +start:lsvm_h +description:lsvm help information +label:mn_only,ci_test +cmd:lsvm -h +check:output=~Usage +cmd:lsvm --help +check:output=~Usage +end + +start:lsvm_a +description:lsvm -a/--all could work as design, to display all the information for the vm +label:others,hctrl_kvm +cmd:rpower $$CN on +cmd:a=0;while ! `rpower $$CN stat|grep "Running\|on" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done +check:ouptut=~Running|on +cmd:lsvm $$CN +check:rc==0 +check:output=~$$CN: Id:\s*\w+ +check:output=~$$CN: Host:\s*\w+ +check:output=~$$CN: OS:\s*\w+ +check:output=~$$CN: Memory:\s*\w+ +check:output=~$$CN: CPU:\s*\w+ +check:output=~$$CN: State:\s*\w+ +check:output=~$$CN: Disk\s*\w+ +cmd:lsvm $$CN -a +check:rc==0 +check:output=~$$CN: Id:\s*\w+ +check:output=~$$CN: Host:\s*\w+ +check:output=~$$CN: OS:\s*\w+ +check:output=~$$CN: Memory:\s*\w+ +check:output=~$$CN: CPU:\s*\w+ +check:output=~$$CN: State:\s*\w+ +check:output=~$$CN: Disk\s*\w+ +cmd:lsvm $$CN --all +check:rc==0 +check:output=~$$CN: Id:\s*\w+ +check:output=~$$CN: Host:\s*\w+ +check:output=~$$CN: OS:\s*\w+ +check:output=~$$CN: Memory:\s*\w+ +check:output=~$$CN: CPU:\s*\w+ +check:output=~$$CN: State:\s*\w+ +check:output=~$$CN: Disk\s*\w+ +end + +start:lsvm_noderange +description:lsvm noderagen could work as design, to display the information for all nodes in noderange +label:others,hctrl_kvm +cmd:rpower $$CN on +cmd:a=0;while ! `rpower $$CN stat|grep "Running\|on" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done +cmd:rpower $$CN stat +check:ouptut=~Running|on +cmd:rpower $$SN on +cmd:a=0;while ! `rpower $$SN stat|grep "Running\|on" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done +cmd:rpower $$SN stat +check:ouptut=~Running|on +cmd:lsvm $$CN,$$SN +check:rc==0 +check:output=~$$CN: Id:\s*\w+ +check:output=~$$CN: Host:\s*\w+ +check:output=~$$CN: OS:\s*\w+ +check:output=~$$CN: Memory:\s*\w+ +check:output=~$$CN: CPU:\s*\w+ +check:output=~$$CN: State:\s*\w+ +check:output=~$$CN: Disk\s*\w+ +check:output=~$$SN: Id:\s*\w+ +check:output=~$$SN: Host:\s*\w+ +check:output=~$$SN: OS:\s*\w+ +check:output=~$$SN: Memory:\s*\w+ +check:output=~$$SN: CPU:\s*\w+ +check:output=~$$SN: State:\s*\w+ +check:output=~$$SN: Disk\s*\w+ +end + +start:lsvm_kvmhost +description:lsvm could give out the kvm host information. This case should be run on a mn which has kvm host defined.In this case, $$CN should be a kvm host. +label:others,hctrl_kvm +cmd:lsvm $$CN +check:output=~$$CN +end + +start:lsvm_mixed_vm_defined_and_not +description:lsvm could give out the defined vm information.In this case, $$CN is a defined vm, vmnode is not defined in database. +label:others,hctrl_kvm +cmd:lsvm $$CN,vmnode +check:output=~Error: Invalid nodes and/or groups in noderange: vmnode +check:rc!=0 +end + +start:lsvm_mixed_vm_running_and_off +description:lsvm noderagen could work as design, to display the information for all nodes in noderange +label:others,hctrl_kvm +cmd:rpower $$CN off +cmd:a=0;while ! `rpower $$CN stat|grep "Not Activated\|off" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done +cmd:rpower $$CN stat +check:ouptut=~Not Activated|off +cmd:rpower $$SN on +cmd:a=0;while ! `rpower $$SN stat|grep "Running\|on" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done +cmd:rpower $$SN stat +check:ouptut=~Running|on +cmd:lsvm $$CN,$$SN +check:output=~$$SN: Id:\s*\w+ +check:output=~$$SN: Host:\s*\w+ +check:output=~$$SN: OS:\s*\w+ +check:output=~$$SN: Memory:\s*\w+ +check:output=~$$SN: CPU:\s*\w+ +check:output=~$$SN: State:\s*\w+ +check:output=~$$SN: Disk\s*\w+ +check:output=~$$CN: \s*Could not get any information about specified object +check:rc==0 diff --git a/xCAT-test/autotest/testcase/makeconservercf/cases0 b/xCAT-test/autotest/testcase/makeconservercf/cases0 index be7cc21b4..d1f2e20c1 100644 --- a/xCAT-test/autotest/testcase/makeconservercf/cases0 +++ b/xCAT-test/autotest/testcase/makeconservercf/cases0 @@ -1,33 +1,117 @@ start:makeconservercf_null label:others,ci_test cmd:chdef -t node -o testnodetmp cons=hmc groups=all -cmd:makeconservercf testnodetmp +cmd:service goconserver stop +cmd:#!/bin/bash +lsgoconser=`ls /usr/bin/goconserver` +lsconser=`ls /usr/sbin/conserver` +output=`makeconservercf 2>&1` +if [[ ! "$lsgoconser" ]] && [[ ! "$lsconser" ]]; then + echo "No goconserver and conserver installed" + exit 1 +elif [[ ! "$lsconser" ]]; then + if echo $output | grep "conserver is not supported or not installed."; then + exit 0 + else + exit 1 + fi +else + if [[ "$lsgoconser" ]]; then + msg=`echo $output | grep "makeconservercf is deprecrated as well as conserver, go to makegocons for more information about enabling goconserver."` + if [ ! "$msg" ]; then + exit 1 + fi + fi + service conserver status + exit $? +fi check:rc==0 -cmd:cat /etc/conserver.cf -check:output=~console testnodetmp \{ -check:output=~ /opt/xcat/share/xcat/cons/hmc testnodetmp; -check:output=~\} cmd:rmdef -t node testnodetmp end start:makeconservercf_noderange label:others,ci_test cmd:chdef -t node -o testnodetmp cons=hmc groups=all -cmd:makeconservercf testnodetmp +cmd:service goconserver stop +cmd:#!/bin/bash +lsgoconser=`ls /usr/bin/goconserver` +lsconser=`ls /usr/sbin/conserver` +output=`makeconservercf testnodetmp 2>&1` +if [[ ! "$lsgoconser" ]] && [[ ! "$lsconser" ]]; then + echo "No goconserver and conserver installed" + exit 1 +elif [[ ! "$lsconser" ]]; then + if echo $output | grep "conserver is not supported or not installed."; then + exit 0 + else + exit 1 + fi +else + if [[ "$lsgoconser" ]]; then + msg=`echo $output | grep "makeconservercf is deprecrated as well as conserver, go to makegocons for more information about enabling goconserver."` + if [ ! "$msg" ]; then + exit 1 + fi + fi + service conserver status + if [ $? != 0 ]; then + exit $? + else + if grep "console testnodetmp { +/opt/xcat/share/xcat/cons/hmc testnodetmp; +}" /etc/conserver.cf;then + exit 0 + else + exit 1 + fi + fi +fi check:rc==0 -cmd:cat /etc/conserver.cf -check:output=~console testnodetmp \{ -check:output=~ /opt/xcat/share/xcat/cons/hmc testnodetmp; -check:output=~\} cmd:rmdef -t node testnodetmp end start:makeconservercf_d label:others,ci_test cmd:chdef -t node -o testnodetmp cons=hmc groups=all -cmd:makeconservercf testnodetmp +cmd:service goconserver stop +cmd:#!/bin/bash +lsgoconser=`ls /usr/bin/goconserver` +lsconser=`ls /usr/sbin/conserver` +output=`makeconservercf testnodetmp 2>&1` +if [[ ! "$lsgoconser" ]] && [[ ! "$lsconser" ]]; then + echo "No goconserver and conserver installed" + exit 1 +elif [[ ! "$lsconser" ]]; then + if echo $output | grep "conserver is not supported or not installed."; then + exit 0 + else + exit 1 + fi +else + if [[ "$lsgoconser" ]]; then + msg=`echo $output | grep "makeconservercf is deprecrated as well as conserver, go to makegocons for more information about enabling goconserver."` + if [ ! "$msg" ]; then + exit 1 + fi + fi + service conserver status + exit $? +fi check:rc==0 -cmd:makeconservercf -d testnodetmp +cmd:#!/bin/bash +lsconser=`ls /usr/sbin/conserver` +if [[ ! "$lsconser" ]]; then + exit 0 +else + makeconservercf -d testnodetmp + if [ $? != 0 ]; then + exit $? + else + if cat /etc/conserver.cf | grep testnodetmp; then + exit 1 + fi + fi +fi check:rc==0 cmd:cat /etc/conserver.cf | grep testnodetmp check:output!~testnodetmp diff --git a/xCAT-test/autotest/testcase/makedhcp/cases0 b/xCAT-test/autotest/testcase/makedhcp/cases0 index 818ca9173..89589893d 100644 --- a/xCAT-test/autotest/testcase/makedhcp/cases0 +++ b/xCAT-test/autotest/testcase/makedhcp/cases0 @@ -213,7 +213,7 @@ cmd:if [ -f /var/lib/dhcpd/dhcpd.leases ]; then a="/var/lib/dhcpd/dhcpd.leases"; cmd:makedhcp testnode check:rc==0 cmd:if [ -f /var/lib/dhcpd/dhcpd.leases ]; then a="/var/lib/dhcpd/dhcpd.leases"; elif [ -f /var/lib/dhcp/db/dhcpd.leases ]; then a="/var/lib/dhcp/db/dhcpd.leases"; elif [ -f "/var/lib/dhcp/dhcpd.leases" ]; then a="/var/lib/dhcp/dhcpd.leases";fi; ls -l $a; cat $a -cmd:makedhcp -q testnode +cmd:a=2;while true; do [ $a -eq 64 ] && exit 1;output=$(makedhcp -q testnode);[ $? -ne 0 ] && exit 1;echo $output|grep testnode 2>/dev/null && exit 0;a=$[$a*2]; makedhcp testnode; sleep $a;done check:rc==0 check:output=~testnode: ip-address = 100.100.100.2 cmd:makedhcp -d testnode diff --git a/xCAT-test/autotest/testcase/makehosts/cases0 b/xCAT-test/autotest/testcase/makehosts/cases0 index dab769d08..4f5050142 100644 --- a/xCAT-test/autotest/testcase/makehosts/cases0 +++ b/xCAT-test/autotest/testcase/makehosts/cases0 @@ -141,6 +141,7 @@ start:makehost_n_r label:mn_only,dns,wait_fix descriptions:modify makehosts testcases according to special node name eg:s01 and s01r* . for issue #2717 and #2683 cmd:cp -f /etc/hosts /etc/hosts.xcatbakautotest +cmd:sed -i '/s01/d' /etc/hosts cmd:cat /etc/hosts cmd:lsdef s01;if [ $? -eq 0 ]; then lsdef -l s01 -z >/tmp/s01.standa ;rmdef s01;fi check:rc==0 @@ -149,56 +150,65 @@ check:rc==0 cmd:nodeadd s01 groups=service; chdef s01 ip=70.2.0.254;nodeadd s01r1b01 groups=compute; chdef s01r1b01 ip=80.2.0.254 check:rc==0 cmd:lsdef -l s01,s01r1b01 -cmd:makehosts +cmd:makehosts check:rc==0 -cmd:cat /etc/hosts cmd:#!/bin/bash file="/etc/hosts" -for i in {1..5}; do - if (grep "70.2.0.254 s01" $file >/dev/null 2>&1) && (grep "80.2.0.254 s01r1b01" $file >/dev/null 2>&1); then - exit 0; - else - echo "Do not find s01 and s01r1b01 in $file, sleep $[i*2] seconds and try again" - sleep $[i*2] - fi -done -exit 1 +if (! grep "s01 " $file 2>&1 ) || (! grep "s01r1b01" $file 2>&1 ); then + echo "makehosts failed, try XCATBYPASS=YES makehosts again" + XCATBYPASS=YES makehosts + if (! grep "s01" $file 2>&1); then + echo "XCATBYPASS=YES makehosts failed either" + exit 1 + fi +fi +if (grep "70.2.0.254 s01" $file >/dev/null 2>&1) && (grep "80.2.0.254 s01r1b01" $file >/dev/null 2>&1); then + exit 0 +else + exit 1 +fi check:rc==0 -cmd:cp -f /etc/hosts.xcatbakautotest /etc/hosts -cmd:makehosts s01 +cmd:sed -i '/s01/d' /etc/hosts +cmd:makehosts s01 check:rc==0 -cmd:cat /etc/hosts cmd:#!/bin/bash file="/etc/hosts" -for i in {1..5}; do - if (grep "70.2.0.254 s01" $file >/dev/null 2>&1) && ( ! grep "80.2.0.254 s01r1b01" $file >/dev/null 2>&1); then - exit 0; - else - echo "sleep $[i*2] seconds and try again" - sleep $[i*2] +if (! grep "s01 " $file 2>&1); then + echo "makehosts s01 failed, try XCATBYPASS=YES makehosts s01 again" + XCATBYPASS=YES makehosts s01 + if (! grep "s01 " $file 2>&1); then + echo "XCATBYPASS=YES makehosts s01 failed either" + exit 1 fi -done -exit 1 +fi +if (grep "70.2.0.254 s01" $file >/dev/null 2>&1) && ( ! grep "80.2.0.254 s01r1b01" $file >/dev/null 2>&1); then + exit 0; +else + exit 1 +fi check:rc==0 -cmd:cp -f /etc/hosts.xcatbakautotest /etc/hosts -cmd:makehosts service +cmd:sed -i '/s01/d' /etc/hosts +cmd:makehosts service check:rc==0 -cmd:cat /etc/hosts cmd:#!/bin/bash file="/etc/hosts" -for i in {1..5}; do - if (grep "70.2.0.254 s01" $file >/dev/null 2>&1) && (! grep "80.2.0.254 s01r1b01" $file >/dev/null 2>&1); then - exit 0; - else - echo "sleep $[i*2] seconds and try again" - sleep $[i*2] - fi -done -exit 1 +if (! grep "s01 " $file 2>&1); then + echo "makehosts service failed, try XCATBYPASS=YES makehosts service again" + XCATBYPASS=YES makehosts service + if (! grep "s01 " $file 2>&1); then + echo "XCATBYPASS=YES makehosts service failed either" + exit 1 + fi +fi +if (grep "70.2.0.254 s01" $file >/dev/null 2>&1) && (! grep "80.2.0.254 s01r1b01" $file >/dev/null 2>&1); then + exit 0; +else + exit 1 +fi check:rc==0 cmd:makehosts -d s01 check:rc==0 -cmd:cat /etc/hosts +cmd:grep "s01" /etc/hosts cmd:#!/bin/bash file="/etc/hosts" for i in {1..5}; do @@ -211,13 +221,14 @@ for i in {1..5}; do done exit 1 check:rc==0 -cmd:cp -f /etc/hosts.xcatbakautotest /etc/hosts -cmd:makehosts +cmd:sed -i '/s01/d' /etc/hosts +cmd:domain=$(lsdef -t site -i domain -c |awk -F'=' '{print $2}'); echo "70.2.0.254 s01 s01.$domain" >> /etc/hosts; echo "80.2.0.254 s01r1b01 s01r1b01.$domain" >> /etc/hosts check:rc==0 -cmd:cat /etc/hosts -cmd:makehosts -d service +cmd:grep "s01" /etc/hosts check:rc==0 -cmd:cat /etc/hosts +cmd:makehosts -d service +check:rc==0 +cmd:grep "s01" /etc/hosts cmd:#!/bin/bash file="/etc/hosts" for i in {1..5}; do @@ -230,13 +241,14 @@ for i in {1..5}; do done exit 1 check:rc==0 -cmd:cp -f /etc/hosts.xcatbakautotest /etc/hosts -cmd:makehosts +cmd:sed -i '/s01/d' /etc/hosts +cmd:domain=$(lsdef -t site -i domain -c |awk -F'=' '{print $2}'); echo "70.2.0.254 s01 s01.$domain" >> /etc/hosts; echo "80.2.0.254 s01r1b01 s01r1b01.$domain" >> /etc/hosts +check:rc==0 +cmd:grep "s01" /etc/hosts check:rc==0 -cmd:cat /etc/hosts cmd:makehosts -d s01r1b01 check:rc==0 -cmd:cat /etc/hosts +cmd:grep "s01" /etc/hosts cmd:#!/bin/bash file="/etc/hosts" for i in {1..5}; do diff --git a/xCAT-test/autotest/testcase/makenetworks/cases0 b/xCAT-test/autotest/testcase/makenetworks/cases0 index d7d035e61..7a91e86d4 100644 --- a/xCAT-test/autotest/testcase/makenetworks/cases0 +++ b/xCAT-test/autotest/testcase/makenetworks/cases0 @@ -70,5 +70,11 @@ cmd:rm -f /tmp/testnetworks cmd:rm -f /tmp/inetworktest1 end - - +start:makenetworks_netname_exist +os:Linux +description:test makenetworks works as design when netname exists. +label:others,network +cmd:netname=`lsdef -t network |cut -d" " -f1 |sed -n '1p'`;makenetworks $netname +check:rc==0 +check:output=~(already exists) +end diff --git a/xCAT-test/autotest/testcase/migration/redhat_migration b/xCAT-test/autotest/testcase/migration/redhat_migration index a11f1d807..43d0b7864 100644 --- a/xCAT-test/autotest/testcase/migration/redhat_migration +++ b/xCAT-test/autotest/testcase/migration/redhat_migration @@ -15,10 +15,8 @@ cmd:makedns -n check:rc==0 cmd:service named restart check:rc==0 -cmd:makeconservercf $$CN +cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN; fi check:rc==0 -cmd:cat /etc/conserver.cf | grep $$CN -check:output=~$$CN cmd:sleep 60 cmd:if [ "__GETNODEATTR($$CN,arch)__" = "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ]; then getmacs -D $$CN; fi check:rc==0 @@ -32,7 +30,7 @@ cmd:if cat /etc/*release |grep SUSE >/dev/null;then cat /var/lib/dhcp/db/dhcpd.l check:output=~$$CN cmd:copycds $$ISO check:rc==0 -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:sleep 600 @@ -54,13 +52,15 @@ cmd:xdsh $$CN "cd /oldxcat;wget $$MIGRATION1_DEP" check:rc==0 cmd:xdsh $$CN "cd /oldxcat;wget $$MIGRATION1_CORE" check:rc==0 +cmd:xdsh $$CN "type apt-get && apt-get install -y tar" +cmd:xdsh $$CN "type yum && yum install -y tar" cmd:xdsh $$CN "tar -jxvf /oldxcat/xcat-dep* -C /oldxcat" check:rc==0 cmd:xdsh $$CN "tar -jxvf /oldxcat/xcat-core* -C /oldxcat" check:rc==0 cmd:xdsh $$CN "/oldxcat/xcat-core/mklocalrepo.sh" check:rc==0 -cmd:xdsh $$CN "cd /oldxcat/xcat-dep/rh`echo __GETNODEATTR($$CN,os)__ | cut -c6`/__GETNODEATTR($$CN,arch)__/;./mklocalrepo.sh" +cmd:tmp="__GETNODEATTR($$CN,os)__"; ver=${tmp%%.*}; tmp="rh"${ver:(-1):1}; xdsh $$CN "cd /oldxcat/xcat-dep/$tmp/__GETNODEATTR($$CN,arch)__/;./mklocalrepo.sh" check:rc==0 cmd:xdsh $$CN "yum clean all;yum -y install xCAT" check:rc==0 @@ -87,7 +87,7 @@ cmd:xdsh $$CN "cd /root/xcat-core;./mklocalrepo.sh" check:rc==0 cmd:xdsh $$CN "tar -jxvf /xcat-dep*.tar.bz2" check:rc==0 -cmd:xdsh $$CN "cd /root/xcat-dep/rh`echo __GETNODEATTR($$CN,os)__ | cut -c6`/__GETNODEATTR($$CN,arch)__/;./mklocalrepo.sh" +cmd:tmp="__GETNODEATTR($$CN,os)__"; ver=${tmp%%.*}; tmp="rh"${ver:(-1):1}; xdsh $$CN "cd /root/xcat-dep/$tmp/__GETNODEATTR($$CN,arch)__/;./mklocalrepo.sh" check:rc==0 cmd:xdsh $$CN "yum clean metadata;yum -y update '*xCAT*'" check:rc==0 @@ -100,6 +100,7 @@ cmd:xdsh $$CN "noderm node0001" check:rc==0 cmd:latest_version_info=`lsxcatd -v`;xdsh $$CN "lsxcatd -v" | grep "$latest_version_info" check:rc==0 +cmd:if [ -x /usr/bin/goconserver ]; then makegocons -d $$CN; else makeconservercf -d $$CN; fi cmd:if [[ -f /tmp/servicelabel ]];then chdef $$SN -p groups=service;rm -rf /tmp/servicelabel;fi check:rc==0 cmd:if [[ -f /tmp/poweroffsn ]];then rpower $$SN on > /dev/null;rm -rf /tmp/poweroffsn;fi @@ -123,10 +124,8 @@ cmd:makedns -n check:rc==0 cmd:service named restart check:rc==0 -cmd:makeconservercf $$CN +cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN; fi check:rc==0 -cmd:cat /etc/conserver.cf | grep $$CN -check:output=~$$CN cmd:sleep 60 cmd:if [ "__GETNODEATTR($$CN,arch)__" = "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ]; then getmacs -D $$CN; fi check:rc==0 @@ -140,7 +139,7 @@ cmd:if cat /etc/*release |grep SUSE >/dev/null;then cat /var/lib/dhcp/db/dhcpd.l check:output=~$$CN cmd:copycds $$ISO check:rc==0 -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:sleep 600 @@ -162,13 +161,15 @@ cmd:xdsh $$CN "cd /oldxcat;wget $$MIGRATION2_DEP" check:rc==0 cmd:xdsh $$CN "cd /oldxcat;wget $$MIGRATION2_CORE" check:rc==0 +cmd:xdsh $$CN "type apt-get && apt-get install -y tar" +cmd:xdsh $$CN "type yum && yum install -y tar" cmd:xdsh $$CN "tar -jxvf /oldxcat/xcat-dep* -C /oldxcat" check:rc==0 cmd:xdsh $$CN "tar -jxvf /oldxcat/xcat-core* -C /oldxcat" check:rc==0 cmd:xdsh $$CN "/oldxcat/xcat-core/mklocalrepo.sh" check:rc==0 -cmd:xdsh $$CN "cd /oldxcat/xcat-dep/rh`echo __GETNODEATTR($$CN,os)__ | cut -c6`/__GETNODEATTR($$CN,arch)__/;./mklocalrepo.sh" +cmd:tmp="__GETNODEATTR($$CN,os)__"; ver=${tmp%%.*}; tmp="rh"${ver:(-1):1};xdsh $$CN "cd /oldxcat/xcat-dep/$tmp/__GETNODEATTR($$CN,arch)__/;./mklocalrepo.sh" check:rc==0 cmd:xdsh $$CN "yum clean all;yum -y install xCAT" check:rc==0 @@ -195,7 +196,8 @@ cmd:xdsh $$CN "cd /root/xcat-core;./mklocalrepo.sh" check:rc==0 cmd:xdsh $$CN "tar -jxvf /xcat-dep*.tar.bz2" check:rc==0 -cmd:xdsh $$CN "cd /root/xcat-dep/rh`echo __GETNODEATTR($$CN,os)__ | cut -c6`/__GETNODEATTR($$CN,arch)__/;./mklocalrepo.sh" +#cmd:xdsh $$CN "cd /root/xcat-dep/rh`echo __GETNODEATTR($$CN,os)__ | cut -c6`/__GETNODEATTR($$CN,arch)__/;./mklocalrepo.sh" +cmd:tmp="__GETNODEATTR($$CN,os)__"; ver=${tmp%%.*}; tmp="rh"${ver:(-1):1};xdsh $$CN "cd /root/xcat-dep/$tmp/__GETNODEATTR($$CN,arch)__/;./mklocalrepo.sh" check:rc==0 cmd:xdsh $$CN "yum clean metadata;yum -y update '*xCAT*'" check:rc==0 @@ -208,6 +210,7 @@ cmd:xdsh $$CN "noderm node0001" check:rc==0 cmd:latest_version_info=`lsxcatd -v`;xdsh $$CN "lsxcatd -v" | grep "$latest_version_info" check:rc==0 +cmd:if [ -x /usr/bin/goconserver ]; then makegocons -d $$CN; else makeconservercf -d $$CN; fi cmd:if [[ -f /tmp/servicelabel ]];then chdef $$SN -p groups=service;rm -rf /tmp/servicelabel;fi check:rc==0 cmd:if [[ -f /tmp/poweroffsn ]];then rpower $$SN on > /dev/null;rm -rf /tmp/poweroffsn;fi diff --git a/xCAT-test/autotest/testcase/migration/sles_migration b/xCAT-test/autotest/testcase/migration/sles_migration index 76acbd859..2e429094e 100644 --- a/xCAT-test/autotest/testcase/migration/sles_migration +++ b/xCAT-test/autotest/testcase/migration/sles_migration @@ -31,7 +31,7 @@ cmd:if cat /etc/*release |grep SUSE >/dev/null;then cat /var/lib/dhcp/db/dhcpd.l check:output=~$$CN cmd:copycds $$ISO check:rc==0 -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:sleep 600 @@ -152,7 +152,7 @@ cmd:if cat /etc/*release |grep SUSE >/dev/null;then cat /var/lib/dhcp/db/dhcpd.l check:output=~$$CN cmd:copycds $$ISO check:rc==0 -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:sleep 600 diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le index 81970abc3..5bd7ce898 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le @@ -17,7 +17,7 @@ cmd:makeconservercf $$CN check:rc==0 cmd:cat /etc/conserver.cf | grep $$CN check:output=~$$CN -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:sleep 600 diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm index c980c0702..9171b01e6 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm @@ -16,7 +16,7 @@ cmd:makeconservercf $$CN check:rc==0 cmd:cat /etc/conserver.cf | grep $$CN check:output=~$$CN -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:sleep 600 diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le index 7fe2080ec..301d31f22 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le @@ -17,7 +17,7 @@ cmd:makeconservercf $$CN check:rc==0 cmd:cat /etc/conserver.cf | grep $$CN check:output=~$$CN -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:sleep 300 diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm index ab47fd759..bd98c5e63 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm @@ -16,7 +16,7 @@ cmd:makeconservercf $$CN check:rc==0 cmd:cat /etc/conserver.cf | grep $$CN check:output=~$$CN -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:sleep 600 diff --git a/xCAT-test/autotest/testcase/mkdef/cases0 b/xCAT-test/autotest/testcase/mkdef/cases0 index 3b28be750..b360587d6 100644 --- a/xCAT-test/autotest/testcase/mkdef/cases0 +++ b/xCAT-test/autotest/testcase/mkdef/cases0 @@ -159,6 +159,52 @@ check:output=~gateway=1.2.3.1 cmd:rmdef -t network testnetwork end +start:mkdef_netname_exist +os:Linux +description:test mkdef works as design when netname exists. +label:mn_only,ci_test,db +cmd:netname=`lsdef -t network |cut -d" " -f1 |sed -n '1p'`;mkdef -t network -o $netname +check:rc==1 +end + +start:mkdef_netname_notexist_without_net_mask +os:Linux +description:test mkdef works as design when net and mask is not defined. +label:mn_only,ci_test,db +cmd:mkdef -t network -o testnetworkwithoutnetandmask +check:rc!=0 +check:output=~Error +cmd:mkdef -t network -o testnetworkwithoutnetandmask mtu=1500 +check:rc!=0 +check:output=~Net or mask value should not be empty +cmd:mkdef -t network -o testnetworkwithoutnetandmask net=10.0.0.0 mtu=1500 +check:rc!=0 +check:output=~Net or mask value should not be empty +cmd:mkdef -t network -o testnetworkwithoutnetandmask mask=255.0.0.0 mtu=1500 +check:rc!=0 +check:output=~Net or mask value should not be empty +cmd:mkdef -t network -o testnetworkwithoutnetandmask net=100.0.0.1 mask=255.0.0.0 mtu=1500 +check:rc==0 +check:output=~1 object definitions have been created or modified +cmd:lsdef -t network -z testnetworkwithoutnetandmask |tee /tmp/testnetworkwithoutnetandmask.stanza +check:rc==0 +cmd:cat /tmp/testnetworkwithoutnetandmask.stanza|mkdef -z +check:rc!=0 +check:output=~(already exists) +cmd:rmdef -t network testnetworkwithoutnetandmask +check:rc==0 +end + +start:mkdef_networks_if_net_mask_exists +os:Linux +description:test makenetworks works as design when net and mask exists. The network could not be created since net and mask are +the same. +label:mn_only,ci_test,db +cmd:netname=`lsdef -t network |cut -d" " -f1 |sed -n '1p'`;net=`lsdef -t network -o $netname |grep -i net |awk -F = '{print $2}'`;mask=`lsdef -t network -o $netname |grep -i mask |awk -F = '{print $2}'`;mkdef -t network -o testnetworkwithnetandmask net=$net mask=$mask +check:rc!=0 +check:output=~(already exists) +end + start:mkdef_t_o_error description:mkdef -t wrongtype label:mn_only,ci_test,db diff --git a/xCAT-test/autotest/testcase/nodeset/cases0 b/xCAT-test/autotest/testcase/nodeset/cases0 index 6080691da..de7aa775e 100644 --- a/xCAT-test/autotest/testcase/nodeset/cases0 +++ b/xCAT-test/autotest/testcase/nodeset/cases0 @@ -235,8 +235,8 @@ end start:nodeset_grub2 description: Verify when grub2 is used for OS loader, whether the configuration files under /tftpboot can be generated corrently label:others -cmd:rmdef testnode1 -cmd:rm -f /tftpboot/boot/grub2/{testnode1,grub.cfg-{01-e6-d4-d2-3a-ad-06,0[aA]0101[cC]8}} +cmd:lsdef testnode1 > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef testnode1 -z >/tmp/testnode1.stanza ;rmdef testnode1;fi +cmd:rm -f /tftpboot/boot/grub2/{testnode1,grub.cfg-{01-e6-d4-d2-3a-ad-06,0[aA]0101[cC]8}} cmd:mkdef -t node -o testnode1 arch=ppc64 cons=hmc groups=lpar ip=10.1.1.200 mac=e6:d4:d2:3a:ad:06 mgt=hmc profile=compute os=rhels7.99 check:rc==0 cmd:cp -f /etc/hosts /etc/hosts.xcattestbak @@ -267,7 +267,7 @@ check:rc!=0 #check:rc!=0 cmd:chdef -t node -o testnode1 ip= check:rc==0 -cmd:cp -f /etc/hosts.xcattestbak /etc/hosts +cmd:sed -i /testnode1/d /etc/hosts cmd:getent hosts testnode1 | grep testnode1 check:rc!=0 cmd:nodeset testnode1 osimage=rhels7.99-ppc64-install-compute @@ -275,13 +275,15 @@ check:rc!=0 cmd:noderm testnode1 cmd:rmdef -t osimage -o "rhels7.99-ppc64-install-compute" cmd:rm -rf /install/rhels7.99 +cmd:cp -f /etc/hosts.xcattestbak /etc/hosts +cmd:if [[ -e /tmp/testnode1.stanza ]]; then cat /tmp/testnode1.stanza |mkdef -z -f;rm -rf /tmp/testnode1.stanza;fi end start:nodeset_petitboot description: Verify when petitboot is used for OS loader, whether the configuration files under /tftpboot can be generated corrently label:others -cmd:rmdef testnode1 -cmd:rm -f /tftpboot/petitboot/testnode1 +cmd:lsdef testnode1 > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef testnode1 -z >/tmp/testnode1.stanza ;rmdef testnode1;fi +cmd:rm -f /tftpboot/petitboot/testnode1 cmd:mkdef -t node -o testnode1 arch=ppc64le cons=bmc groups=ipmi ip=10.1.1.200 mac=e6:d4:d2:3a:ad:06 mgt=ipmi profile=compute os=rhels7.99 check:rc==0 cmd:cp -f /etc/hosts /etc/hosts.xcattestbak @@ -309,7 +311,7 @@ check:rc!=0 #check:rc!=0 cmd:chdef -t node -o testnode1 ip= check:rc==0 -cmd:cp -f /etc/hosts.xcattestbak /etc/hosts +cmd:sed -i /testnode1/d /etc/hosts cmd:getent hosts testnode1 | grep testnode1 check:rc!=0 cmd:nodeset testnode1 osimage=rhels7.99-ppc64le-install-compute @@ -317,6 +319,8 @@ check:rc!=0 cmd:noderm testnode1 cmd:rmdef -t osimage -o "rhels7.99-ppc64le-install-compute" cmd:rm -rf /install/rhels7.99 +cmd:cp -f /etc/hosts.xcattestbak /etc/hosts +cmd:if [[ -e /tmp/testnode1.stanza ]]; then cat /tmp/testnode1.stanza |mkdef -z -f;rm -rf /tmp/testnode1.stanza;fi end start:nodeset_yaboot @@ -374,7 +378,7 @@ end start:nodeset_disjointdhcps_petitboot description: Verify the disjointdhcps feature when petitboot is used for OS loader. label:others -cmd:rmdef testnode1 +cmd:lsdef testnode1 > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef testnode1 -z >/tmp/testnode1.stanza ;rmdef testnode1;fi cmd:rm -f /tftpboot/petitboot/testnode1 cmd:mkdef -t node -o testnode1 arch=ppc64le cons=bmc groups=ipmi ip=10.1.1.200 mac=e6:d4:d2:3a:ad:06 mgt=ipmi profile=compute os=rhels7.99 check:rc==0 @@ -459,7 +463,7 @@ cmd:makedns -d testnode1 check:rc==0 cmd:chdef -t node -o testnode1 ip= check:rc==0 -cmd:cp -f /etc/hosts.xcattestbak /etc/hosts +cmd:sed -i /testnode1/d /etc/hosts cmd:getent hosts testnode1 | grep testnode1 check:rc!=0 cmd:nodeset testnode1 osimage=rhels7.99-ppc64le-install-compute @@ -468,6 +472,8 @@ cmd:noderm testnode1 cmd:rmdef -t osimage -o "rhels7.99-ppc64le-install-compute" cmd:rm -rf /install/rhels7.99 cmd:xdsh $$SN 'rm -rf /install/rhels7.99' +cmd:cp -f /etc/hosts.xcattestbak /etc/hosts +cmd:if [[ -e /tmp/testnode1.stanza ]]; then cat /tmp/testnode1.stanza |mkdef -z -f;rm -rf /tmp/testnode1.stanza;fi end start:nodeset_switch_osimage diff --git a/xCAT-test/autotest/testcase/nodeset/cases2 b/xCAT-test/autotest/testcase/nodeset/cases2 new file mode 100644 index 000000000..a0473d976 --- /dev/null +++ b/xCAT-test/autotest/testcase/nodeset/cases2 @@ -0,0 +1,33 @@ +start:nodeset_prescripts +description:This case is to run test for prescripts actions. This test case should be tested on an provisioned compute node. +os:Linux +label:others +cmd:dir="/install/prescripts/";if [ ! -e "${dir}" ];then mkdir -p $dir; fi +cmd:echo "echo all" >> /install/prescripts/test_prescripts_all.sh;chmod a+x /install/prescripts/test_prescripts_all.sh +check:rc==0 +cmd:echo "echo boot" >> /install/prescripts/test_prescripts_boot.sh;chmod a+x /install/prescripts/test_prescripts_boot.sh +check:rc==0 +cmd:echo "echo osimage" >> /install/prescripts/test_prescripts_osimage.sh;chmod a+x /install/prescripts/test_prescripts_osimage.sh +check:rc==0 +cmd:pre=`lsdef -l $$CN |grep prescripts-begin|awk -F= '{print $2}'`;echo $pre >> /tmp/prescriptssave;chdef $$CN prescripts-begin="test_prescripts_all.sh|boot:test_prescripts_boot.sh|osimage:test_prescripts_osimage.sh" +check:rc==0 +cmd:nodeset $$CN install +check:output=~Running begin script test_prescripts_all.sh for nodes $$CN +check:output!=~test_prescripts_boot.sh +check:output!=~test_prescripts_osimage.sh +cmd:nodeset $$CN boot +check:rc==0 +check:output=~Running begin script test_prescripts_all.sh for nodes $$CN +check:output=~Running begin script test_prescripts_boot.sh for nodes $$CN +check:output!=~test_prescripts_osimage.sh +cmd:nodeset $$CN osimage +check:rc==0 +check:output=~Running begin script test_prescripts_all.sh for nodes $$CN +check:output=~Running begin script test_prescripts_osimage.sh for nodes $$CN +check:output!=~test_prescripts_boot.sh +cmd:rm -rf /install/prescripts/test_prescripts_all.sh /install/prescripts/test_prescripts_boot.sh /install/prescripts/test_prescripts_osimage.sh +cmd:pre=`cat /tmp/prescriptssave`;chdef $$CN prescripts-begin=$pre +check:rc==0 +cmd:rm -rf /tmp/prescriptssave +end + diff --git a/xCAT-test/autotest/testcase/packimg/cases0 b/xCAT-test/autotest/testcase/packimg/cases0 index a8d51ba00..fcad6b946 100644 --- a/xCAT-test/autotest/testcase/packimg/cases0 +++ b/xCAT-test/autotest/testcase/packimg/cases0 @@ -72,9 +72,7 @@ check:output=~archive method:cpio check:output=~compress method:gzip cmd:ls -l /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.gz check:rc==0 -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -check:rc==0 -cmd:if [[ "__GETNODEATTR($$CN,arch)__" = "ppc64" ]]; then rnetboot $$CN;else rpower $$CN boot; fi +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 150 ];then break;fi done cmd:ping $$CN -c 3 @@ -118,9 +116,7 @@ check:output=~archive method:cpio check:output=~compress method:pigz cmd:ls -l /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.gz check:rc==0 -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -check:rc==0 -cmd:if [[ "__GETNODEATTR($$CN,arch)__" = "ppc64" ]]; then rnetboot $$CN;else rpower $$CN boot; fi +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 150 ];then break;fi done cmd:ping $$CN -c 3 @@ -160,9 +156,7 @@ check:output=~archive method:cpio check:output=~compress method:xz cmd:ls -l /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.xz check:rc==0 -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -check:rc==0 -cmd:if [[ "__GETNODEATTR($$CN,arch)__" = "ppc64" ]]; then rnetboot $$CN;else rpower $$CN boot; fi +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 150 ];then break;fi done cmd:ping $$CN -c 3 @@ -206,7 +200,7 @@ check:output=~archive method:tar check:output=~compress method:pigz cmd:ls -l /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.tar.gz check:rc==0 -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 150 ];then break;fi done @@ -257,7 +251,7 @@ check:output=~archive method:tar check:output=~compress method:gzip cmd:ls -l /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.tar.gz check:rc==0 -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 150 ];then break;fi done @@ -308,7 +302,7 @@ check:output=~archive method:tar check:output=~compress method:xz cmd:ls -l /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.tar.xz check:rc==0 -cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 150 ];then break;fi done @@ -376,3 +370,29 @@ cmd:rm -rf /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/ cmd:mv -f /rootimg.bak /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg end +start:packimage_uuid +os:Linux +description:this case is to verfy bug 3542,ensure that CSM required info is not removed from /opt/xcat/xcatinfo. +label:others,packaging +cmd:lsdef -z $$CN >> /tmp/node.stanza +cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg /rootimg.bak;fi +cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.gz;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.gz /rootimg.cpio.gz.bak;fi +cmd:copycds $$ISO +cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +check:rc==0 +cmd:packimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +check:rc==0 +cmd:cp /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg/opt/xcat/xcatinfo /tmp/uuid +cmd:packimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +check:rc==0 +cmd:uuid=`cat /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg/opt/xcat/xcatinfo |grep UUID|awk -F= '{print $2}'`;grep $uuid /tmp/uuid +check:rc!=0 +cmd:ls -l /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.gz +check:rc==0 +cmd:rm -rf /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.gz +cmd:mv -f /rootimg.cpio.gz.bak /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.gz +cmd:rm -rf /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg +cmd:mv -f /rootimg.bak /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg +cmd:if [ -e /tmp/node.stanza ]; then rmdef $$CN; cat /tmp/node.stanza | mkdef -z; rm -rf /tmp/node.stanza; fi +end + diff --git a/xCAT-test/autotest/testcase/rflash/rflash_openbmc.0 b/xCAT-test/autotest/testcase/rflash/rflash_openbmc.0 index e53d25715..f2b667bfd 100644 --- a/xCAT-test/autotest/testcase/rflash/rflash_openbmc.0 +++ b/xCAT-test/autotest/testcase/rflash/rflash_openbmc.0 @@ -506,7 +506,7 @@ label:mn_only,hctrl_openbmc cmd:rflash -h check:output =~Usage: check:output =~OpenPOWER OpenBMC specific: -check:output =~ -d.+no-host-reboot +check:output =~ -d check:output =~ image_id.+--delete check:rc == 0 end @@ -524,3 +524,28 @@ check:rc != 0 check:output =~~$$CN\s*:\s*(\[.*?\]: )?Error: Deleting currently active BMC firmware is not supported end +start:rflash_d_relative_path +description:this case is to check if -d support relative directory path. This case is for issue 4511. +os:Linux +hcp:openbmc +label:cn_bmc_ready,hctrl_openbmc +cmd:lsdef testnode;if [ $? -eq 0 ]; then lsdef -l testnode -z >/tmp/testnode.standa ; rmdef testnode;fi +cmd:mkdef -t node -o testnode groups=all arch=ppc64le bmc=testnode-bmc bmcvlantag=11 cons=openbmc mgt=openbmc +check:rc == 0 +cmd:dir="/tmp/rflashdir";if [ -e "${dir}" ];then mv ${dir} ${dir}".bak"; fi +cmd:mkdir -p /tmp/rflashdir;touch /tmp/rflashdir/witherspoon.pnor.squashfs.tar +cmd:cd /tmp;rflash testnode ./rflashdir -d +check:rc != 0 +check:output =~Error:\s*\[.*?\]:\s*No BMC tar file found in ./rflashdir +check:output =~Error:\s*\[.*?\]:\s*No Host tar file found in ./rflashdir +check:output =~testnode\s*:\s*Error:\s*Unable to resolved ip address for bmc:\s*testnode-bmc +cmd:dir="/tmp/rflashnotexist/";if [ -e "${dir}" ];then mv ${dir} ${dir}".bak"; fi +cmd:cd /tmp;rflash testnode ./rflashnotexist -d +check:rc != 0 +check:output =~testnode\s*:\s*Error:\s*Invalid option specified with -d:\s*./rflashnotexist +cmd:dir="/tmp/rflashnotexist"; if [ -d ${dir}".bak" ];then mv ${dir}".bak" $dir; fi +cmd:dir="/tmp/rflashdir"; if [ -d ${dir}".bak" ];then mv ${dir}".bak" $dir; fi +cmd:rmdef -t node -o testnode +check:rc == 0 +cmd:if [ -e /tmp/testnode.standa ]; then cat /tmp/testnode.standa | mkdef -z; rm -rf /tmp/testnode.standa; fi +end diff --git a/xCAT-test/autotest/testcase/rmdef/cases0 b/xCAT-test/autotest/testcase/rmdef/cases0 index 84c928cfc..e5bea9ce4 100644 --- a/xCAT-test/autotest/testcase/rmdef/cases0 +++ b/xCAT-test/autotest/testcase/rmdef/cases0 @@ -88,6 +88,8 @@ end start:rmdef_dynamic_group description:rmdef to remove dynamic node group label:mn_only,ci_test,db +cmd:lsdef testnode1;if [ $? -eq 0 ]; then lsdef -l testnode1 -z >/tmp/testnode1.standa ; rmdef testnode1;fi +cmd:lsdef testnode2;if [ $? -eq 0 ]; then lsdef -l testnode2 -z >/tmp/testnode2.standa ; rmdef testnode2;fi cmd:mkdef -t node -o testnode1-testnode2 mgt=hmc cons=hmc groups=all,systemp check:rc==0 cmd:mkdef -t group -o dyngrp -d -w mgt==hmc -w cons==hmc -w groups==all,systemp @@ -105,6 +107,8 @@ cmd:rmdef -t group -o dyngrp check:rc==0 cmd:lsdef -t group -o dyngrp check:output=~Could not find an object named 'dyngrp' of type 'group'. +cmd:if [ -e /tmp/testnode1.standa ]; then cat /tmp/testnode1.standa | mkdef -z; rm -rf /tmp/testnode1.standa; fi +cmd:if [ -e /tmp/testnode2.standa ]; then cat /tmp/testnode2.standa | mkdef -z; rm -rf /tmp/testnode2.standa; fi end #start:rmdef_f_all diff --git a/xCAT-test/autotest/testcase/rpower/cases0 b/xCAT-test/autotest/testcase/rpower/cases0 index cc3c0affd..8f0c0c041 100644 --- a/xCAT-test/autotest/testcase/rpower/cases0 +++ b/xCAT-test/autotest/testcase/rpower/cases0 @@ -197,3 +197,23 @@ check:output=~Error: (\[.*?\]: )?[Uu]nsupported command[:]* rpower ddd check:rc==1 end +start:rpower_off_on +description:This case is to test off and on option could work for a diskful node. This case is do task 82, for bug 4132, the node status cannot be updated on normal system reboot #4138. +Attribute: $$CN-The operation object of rpower command +label:others,hctrl_general +cmd:rpower $$CN stat +check:output=~Running|on +cmd:lsdef -l $$CN -i status +check:output=~booted +cmd:rpower $$CN off +check:rc==0 +cmd:a=0;while ! `rpower $$CN stat|grep "Not Activated\|off" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done +cmd:rpower $$CN on +check:rc==0 +cmd:a=0;while ! `rpower $$CN stat|grep "Running\|on" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done +cmd:rpower $$CN stat +check:output=~Running|on +cmd:a=0;while ! `lsdef -l $$CN -i status|grep "booted" >/dev/null`; do sleep 5;((a++));if [ $a -gt 50 ];then break;fi done +cmd:lsdef -l $$CN -i status|grep "booted" +check:rc==0 +end diff --git a/xCAT-test/autotest/testcase/updatenode/cases0 b/xCAT-test/autotest/testcase/updatenode/cases0 index fef099f08..59281087e 100644 --- a/xCAT-test/autotest/testcase/updatenode/cases0 +++ b/xCAT-test/autotest/testcase/updatenode/cases0 @@ -11,6 +11,14 @@ check:rc==0 check:output=~Version end +start:updatenode_without_options +description:this case is to verify defect 5142; updatenode without options causes command to crash. +label:mn_only,ci_test,updatenode +cmd:updatenode +check:rc!=0 +check:output=~Usage +end + start:updatenode_diskful_syncfiles label:others,updatenode cmd:mkdir -p /install/custom/install/__GETNODEATTR($$CN,os)__/ @@ -158,23 +166,41 @@ end start:updatenode_syncfile_EXECUTE label:others,updatenode -cmd:echo "echo hello > /tmp/test" > /tmp/file.post +cmd:mkdir -p /tmp/updatenode_syncfile_EXECUTE/ check:rc==0 -cmd:chmod a+x /tmp/file.post -cmd:echo "/tmp/file.post -> /tmp/file.post" > /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist -cmd:echo "EXECUTE:" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist -cmd:echo "/tmp/file.post" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist -cmd:chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute synclists=/install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist +cmd:touch /tmp/updatenode_syncfile_EXECUTE/file +check:rc==0 +cmd:echo "echo hello > /tmp/test" > /tmp/updatenode_syncfile_EXECUTE/file.post +check:rc==0 +cmd:chmod a+x /tmp/updatenode_syncfile_EXECUTE/file.post +cmd:echo "/tmp/updatenode_syncfile_EXECUTE/file -> /tmp/file" > /tmp/updatenode_syncfile_EXECUTE/synclist +cmd:echo "/tmp/updatenode_syncfile_EXECUTE/file.post -> /tmp/file.post" >> /tmp/updatenode_syncfile_EXECUTE/synclist +cmd:echo "EXECUTE:" >> /tmp/updatenode_syncfile_EXECUTE/synclist +cmd:echo "/tmp/updatenode_syncfile_EXECUTE/file.post" >> /tmp/updatenode_syncfile_EXECUTE/synclist +cmd:chdef -t osimage -o __GETNODEATTR($$CN,provmethod)__ synclists=/tmp/updatenode_syncfile_EXECUTE/synclist check:rc==0 cmd:updatenode $$CN -F check:rc==0 cmd:xdsh $$CN "cat /tmp/test" check:rc==0 check:output=~hello -cmd:chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute synclists= +cmd:xdsh $$CN "rm -rf /tmp/test" +cmd:updatenode $$CN -F check:rc==0 -cmd:rm -rf /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist +cmd:xdsh $$CN "cat /tmp/test" +check:rc!=0 +check:output=~No such file or directory +cmd:xdsh $$CN "rm -rf /tmp/test" +cmd:touch /tmp/updatenode_syncfile_EXECUTE/file.post +cmd:updatenode $$CN -F check:rc==0 +cmd:xdsh $$CN "cat /tmp/test" +check:rc!=0 +check:output=~No such file or directory +cmd:xdsh $$CN "rm -rf /tmp/test" +cmd:chdef -t osimage -o __GETNODEATTR($$CN,provmethod)__ synclists= +check:rc==0 +cmd:rm -rf /tmp/updatenode_syncfile_EXECUTE/ end start:updatenode_syncfile_EXECUTEALWAYS @@ -517,3 +543,129 @@ cmd:chtab key=xcatdebugmode site.value=0 check:rc==0 end +start:updatenode_syncfile_EXECUTE_EXECUTEALWAYS_noderange +label:others,updatenode +description:this teast case is to verify pr #5834. This test case should be executed on mn with hierarchy environment, with 2 comput nodes.In this case, $$CN and $$C2 are the 2 compute nodes. +cmd:xdsh $$CN,$$C2 rm /tmp/file.post1 /tmp/file.post2 +cmd:xdsh $$CN,$$C2 rm /tmp/test1 /tmp/test2 +cmd:echo "echo hello1 >> /tmp/test1" > /tmp/file.post1 +check:rc==0 +cmd:echo "echo hello2 >> /tmp/test2" > /tmp/file.post2 +check:rc==0 +cmd:chmod a+x /tmp/file.post1 /tmp/file.post2 +cmd:mkdir -p /install/custom/install/__GETNODEATTR($$CN,os)__ +cmd:echo "/tmp/file.post1 -> ($$CN) /tmp/file.post1" > /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist +cmd:echo "/tmp/file.post2 -> ($$C2) /tmp/file.post2" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist +cmd:echo "EXECUTE:" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist +cmd:echo "/tmp/file.post1" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist +cmd:echo "EXECUTEALWAYS:" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist +cmd:echo "/tmp/file.post2" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist +cmd:chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute synclists=/install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist +check:rc==0 +cmd:updatenode $$CN -F +check:output=~File synchronization has completed +check:rc==0 +cmd:xdsh $$CN "cat /tmp/test1" +check:rc==0 +check:output=~hello1 +cmd:xdsh $$CN "rm -rf /tmp/test1" +check:rc==0 +cmd:updatenode $$CN -F +check:output=~File synchronization has completed +check:rc==0 +cmd:xdsh $$CN "cat /tmp/test1" +check:rc!=0 +cmd:updatenode $$C2 -F +check:output=~File synchronization has completed +check:rc==0 +cmd:xdsh $$C2 ls /tmp/file.post2 +check:rc==0 +cmd:xdsh $$C2 "cat /tmp/test2" +check:rc==0 +check:output=~hello2 +cmd:xdsh $$C2 "rm -rf /tmp/test2" +check:rc==0 +cmd:updatenode $$C2 -F +check:output=~File synchronization has completed +check:rc==0 +cmd:xdsh $$C2 ls /tmp/file.post2 +check:rc==0 +cmd:xdsh $$C2 "cat /tmp/test2" +check:rc==0 +check:output=~hello2 +cmd:xdsh $$C2 rm -rf /tmp/file.post2 /tmp/test2 +cmd:rm -rf /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist +cmd:echo "/tmp/file.post1 -> ($$CN) /tmp/file.post1" > /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist +cmd:echo "/tmp/file.post1 -> ($$C2) /tmp/file.post1" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist +cmd:echo "EXECUTE:" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist +cmd:echo "/tmp/file.post1" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist +cmd:echo "EXECUTEALWAYS:" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist +cmd:echo "/tmp/file.post2" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist +cmd:chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute synclists=/install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist +check:rc==0 +cmd:updatenode $$C2 -F +check:output=~File synchronization has completed +check:rc==0 +cmd:xdsh $$C2 ls /tmp/file.post2 +check:rc!=0 +cmd:xdsh $$C2 "cat /tmp/test2" +check:rc!=0 +check:output!=~hello2 +cmd:chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute synclists= +check:rc==0 +cmd:rm -rf /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist +check:rc==0 +end + + +start:updatenode_syncfile_EXECUTEALWAYS_src_dst_diff +label:others,updatenode +description:this teast case is to verify pr #5888. +cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -z >> /tmp/myimage.stanza +cmd:xdsh $$CN rm /tmp/h /tmp/script.sh /root/script2.sh /tmp/script2.sh /tmp/script3.sh +cmd:xdsh $$CN rm /tmp/test /tmp/test2 /root/test3 /root/test1 +cmd:echo "echo hello >> /tmp/test" > /tmp/script.sh +check:rc==0 +cmd:echo "echo hello2 >> /tmp/test2" > /tmp/script2.sh +check:rc==0 +cmd:echo "echo hello3 >> /tmp/test3" > /root/script3.sh +check:rc==0 +cmd:echo "echo hello1 >> /tmp/test1" > /root/script1.sh +check:rc==0 +cmd:chmod a+x /tmp/script.sh /tmp/script2.sh /root/script3.sh /root/script1.sh +cmd:mkdir -p /install/custom/install/__GETNODEATTR($$CN,os)__ +cmd:echo "/etc/hosts -> ($$CN) /tmp/h" > /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.srcdstdiff.synclist +cmd:echo "/tmp/script.sh -> ($$CN) /tmp/script.sh" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.srcdstdiff.synclist +cmd:echo "/root/script1.sh -> ($$CN) /root/script2.sh" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.srcdstdiff.synclist +cmd:echo "/tmp/script2.sh -> ($$CN) /tmp/script2.sh" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.srcdstdiff.synclist +cmd:echo "/root/script3.sh -> ($$CN) /tmp/script3.sh" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.srcdstdiff.synclist +cmd:echo "EXECUTEALWAYS:" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.srcdstdiff.synclist +cmd:echo "/tmp/script.sh" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.srcdstdiff.synclist +cmd:echo "/tmp/script2.sh" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.srcdstdiff.synclist +cmd:echo "/root/script3.sh" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.srcdstdiff.synclist +cmd:echo "/root/script1.sh" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.srcdstdiff.synclist +cmd:chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute synclists=/install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.srcdstdiff.synclist +check:rc==0 +cmd:updatenode $$CN -F +check:output=~File synchronization has completed for nodes:\s*"$$CN"\s* +check:rc==0 +cmd:xdsh $$CN ls /tmp/h +check:rc==0 +cmd:xdsh $$CN ls /tmp/test +check:rc==0 +cmd:xdsh $$CN ls /tmp/test2 +check:rc==0 +cmd:xdsh $$CN ls /tmp/test3 +check:rc==0 +cmd:xdsh $$CN ls /tmp/test1 +check:rc==0 +cmd:if [ -e /tmp/myimage.stanza ]; then rmdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute; cat /tmp/myimage.stanza | mkdef -z; rm -rf /tmp/myimage.stanza; fi +check:rc==0 +cmd:rm -rf /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.srcdstdiff.synclist +check:rc==0 +end + + + + + diff --git a/xCAT-test/autotest/testcase/xcat_inventory/cases.backend b/xCAT-test/autotest/testcase/xcat_inventory/cases.backend new file mode 100644 index 000000000..029878e6f --- /dev/null +++ b/xCAT-test/autotest/testcase/xcat_inventory/cases.backend @@ -0,0 +1,93 @@ +start:backend +description: verify xcat-inventory backend operations +label:others,inventory_ci + +cmd: rm -rf /tmp/backend_test/ +cmd:rm -rf ~/.xcatinv/inventory.cfg.bak.backend_init +check: rc==0 +cmd: mkdir -p ~/.xcatinv/ +cmd: [ -f ~/.xcatinv/inventory.cfg ] && mv ~/.xcatinv/inventory.cfg ~/.xcatinv/inventory.cfg.bak.backend_init +cmd: cp /opt/xcat/share/xcat/tools/autotest/testcase/xcat_inventory/templates/inventory.cfg ~/.xcatinv/inventory.cfg +cmd: xcat-inventory init +check: rc==0 +check: output=~configuring backend dir +check: output=~xcat-inventory backend initialized +cmd: xcat-inventory init +check: rc==0 +check: output=~Backend has already been initialized, do nothing +cmd: cd /tmp/backend_test/git/repo && git config --local --get user.name +check: output=~ci +cmd: cd /tmp/backend_test/git/repo && git config --local --get user.email +check: output=~xcat@xcat.org +cmd: cd /tmp/backend_test/git/repo && git config --local --get diff.tool +check: output=~invdiff +cmd: cd /tmp/backend_test/git/repo && git config --local --get difftool.invdiff.cmd +check: output=~xcat-inventory diff --filename +cmd: xcat-inventory workspace-list +check: rc==0 +check: output=~master +cmd: XCATBYPASS=1 dumpxCATdb -p /tmp/backend_test/backup/db +check: rc==0 +cmd: XCATBYPASS=1 rmdef -a -f +check: rc==0 +cmd: xcat-inventory import -d /opt/xcat/share/xcat/tools/autotest/testcase/xcat_inventory/templates/testcluster_backend +check: rc==0 +cmd:xcat-inventory commit -m "Rev1" Rev1 +check: rc==0 +check: output=~creating revision Rev1 in workspace +cmd:xcat-inventory revlist +check:rc==0 +check: output=~Rev1 + +cmd:xcat-inventory revlist Rev1 +check:rc==0 +check: output=~cluster.yaml +check: output=~definition.yaml +check: output=~Tagger: +cmd:chdef -t site -o clustersite xcatdebugmode=2 + +check: rc==0 +cmd:rmdef -t node -o nodetorm +check: rc==0 +cmd:mkdef -t osimage -o osimage3 --template osimage1 +check: rc==0 +cmd: xcat-inventory diff +check: rc==0 +check: output=~\+ xcatdebugmode\: \'2\' +check: output=~\+ osimage3\: +check: output=~\- nodetorm\: + +cmd: xcat-inventory commit Rev2 +check: rc==0 + +cmd: xcat-inventory checkout Rev1 +check: rc==0 +check: output=~checked out to revision Rev1 + +cmd: xcat-inventory whereami +check: rc==0 +check: output=~you are in revision \"Rev1\" of workspace \"master\" + +cmd: xcat-inventory workspace-new ws +check: rc==0 +cmd: +check: output=~workspace ws created +cmd: xcat-inventory workspace-list +check: rc==0 +check: output=~ws +cmd: xcat-inventory workspace-checkout ws +check: rc==0 +cmd: xcat-inventory workspace-delete ws +check: rc==0 +check: output=~deleted workspace ws +cmd: xcat-inventory workspace-list +check: rc==0 +check: output!=~ws + +cmd: XCATBYPASS=1 restorexCATdb -p /tmp/backend_test/backup/db +check: rc==0 +cmd: [ -f "~/.xcatinv/inventory.cfg.bak.backend_init" ] && rm -rf "~/.xcatinv/inventory.cfg" && mv "~/.xcatinv/inventory.cfg.bak.backend_init" "~/.xcatinv/inventory.cfg" +cmd: rm -rf /tmp/backend_test/ +end + + diff --git a/xCAT-test/autotest/testcase/xcat_inventory/cases.diff b/xCAT-test/autotest/testcase/xcat_inventory/cases.diff index c49805d76..be75bb066 100644 --- a/xCAT-test/autotest/testcase/xcat_inventory/cases.diff +++ b/xCAT-test/autotest/testcase/xcat_inventory/cases.diff @@ -13,7 +13,7 @@ start:xcat_inventory_diff_without_option description:This case is used to test xcat-inventory diff without option, should be error label:others,inventory_ci cmd:xcat-inventory diff -check:output=~Error: No valid source type! +check:output=~Backend not initialized, please initialize the backend with check:rc!=0 end @@ -45,7 +45,7 @@ start:xcat_inventory_diff_filename description:This case is used to test xcat-inventory diff filename, should be error label:others,inventory_ci cmd:xcat-inventory diff --filename test_filename -check:output=~Error: No valid source type! +check:output=~Backend not initialized, please initialize the backend with check:rc!=0 end diff --git a/xCAT-test/autotest/testcase/xcat_inventory/cases.environment b/xCAT-test/autotest/testcase/xcat_inventory/cases.environment index e3d85e50a..cd4652763 100644 --- a/xCAT-test/autotest/testcase/xcat_inventory/cases.environment +++ b/xCAT-test/autotest/testcase/xcat_inventory/cases.environment @@ -1,7 +1,7 @@ start:import_osimage_with_environments_in_yaml description:this case is to verify if osimage import could support environment variables. os:Linux -label:others,inventory_ci,invoke_provision +label:others,invoke_provision cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN check:rc==0 diff --git a/xCAT-test/autotest/testcase/xcat_inventory/cases.include b/xCAT-test/autotest/testcase/xcat_inventory/cases.include index 4a3bdacc2..1cf22cb10 100644 --- a/xCAT-test/autotest/testcase/xcat_inventory/cases.include +++ b/xCAT-test/autotest/testcase/xcat_inventory/cases.include @@ -1,6 +1,6 @@ start:export_import_osimage_with_INCLUDE_in_file description:This case is used to test xcat-inventory export and import one linux osimage definition which has INCLUDE in the attribute's specified files. The attributes are pkglist, otherpkglist,exlist,synclists,template,postinstall and partitionfile. -label:others,xcat_inventory +label:others,inventory_ci cmd:dir="/tmp/imagedata/";if [ -e "${dir}" ];then mv ${dir} ${dir}".bak"; fi; mkdir -p $dir check:rc==0 cmd:dir="/tmp/imagedata/export";if [ -e "${dir}" ];then mv ${dir} ${dir}".bak"; fi; mkdir -p $dir diff --git a/xCAT-test/autotest/testcase/xcat_inventory/cases.node b/xCAT-test/autotest/testcase/xcat_inventory/cases.node index 5d95a3bf7..27c1bf40c 100644 --- a/xCAT-test/autotest/testcase/xcat_inventory/cases.node +++ b/xCAT-test/autotest/testcase/xcat_inventory/cases.node @@ -784,7 +784,7 @@ check:rc==0 end start:xcat_inventory_try_to_export_all_type_is_node_default_format -label:others,xcat_inventory +label:others,inventory_ci description:This case is used to test xcat-inventory export all definition which type is node by default format. I.e, do not specify the format of export. cmd:mkdir -p /tmp/xcat_inventory_try_to_export_all_type_is_node_default_format check:rc==0 @@ -811,7 +811,7 @@ cmd:dn=$(cat /tmp/xcat_inventory_try_to_export_all_type_is_node_default_format/n check:rc==0 cmd:a=0;for i in `awk -F':' '{print $1}' /tmp/xcat_inventory_try_to_export_all_type_is_node_default_format/group_in_xcat_db`; do grep -E " $i:" /tmp/xcat_inventory_try_to_export_all_type_is_node_default_format/export_all_node; if [[ $? -eq 0 ]]; then ((a++));fi;done;dg=$(cat /tmp/xcat_inventory_try_to_export_all_type_is_node_default_format/group_in_xcat_db|wc -l);if [[ $a -eq $dg ]]; then exit 0; else exit 1;fi check:rc==0 -cmd:a=0;for i in `awk -F' ' '{print $1}' /tmp/xcat_inventory_try_to_export_all_type_is_node_default_format/node_in_xcat_db`;do grep -E ""$i:" /tmp/xcat_inventory_try_to_export_all_type_is_node_default_format/export_all_node; if [[ $? -eq 0 ]]; then ((a++));fi;done;dn=$(cat /tmp/xcat_inventory_try_to_export_all_type_is_node_default_format/node_in_xcat_db |wc -l); if [[ $dn -eq $a ]]; then exit 0; else exit 1;fi +cmd:a=0;for i in `awk -F' ' '{print $1}' /tmp/xcat_inventory_try_to_export_all_type_is_node_default_format/node_in_xcat_db`;do grep -E " $i:" /tmp/xcat_inventory_try_to_export_all_type_is_node_default_format/export_all_node; if [[ $? -eq 0 ]]; then ((a++));fi;done;dn=$(cat /tmp/xcat_inventory_try_to_export_all_type_is_node_default_format/node_in_xcat_db |wc -l); if [[ $dn -eq $a ]]; then exit 0; else exit 1;fi check:rc==0 cmd:rmdef bogusnode[1-3] check:rc==0 @@ -870,7 +870,7 @@ end start:xcat_inventory_try_to_export_all_type_is_node_json_format -label:others,xcat_inventory +label:others,inventory_ci description:This case is used to test xcat-inventory export all definition which type is node by json format. cmd:mkdir -p /tmp/xcat_inventory_try_to_export_all_type_is_node_json_format check:rc==0 @@ -888,9 +888,9 @@ cmd:lsdef -t group -i grouptype -c|grep "grouptype=static" |tee /tmp/xcat_inven check:rc==0 cmd:xcat-inventory export --format=json -t node |tee /tmp/xcat_inventory_try_to_export_all_type_is_node_json_format/export_all_node check:rc==0 -cmd: grep "xcatdefaults:" /tmp/xcat_inventory_try_to_export_all_type_is_node_json_format/export_all_node > /dev/null 2>&1; if [[ $? -eq 0 ]]; then exit 0; else exit 1;fi +cmd: grep "xcatdefaults" /tmp/xcat_inventory_try_to_export_all_type_is_node_json_format/export_all_node > /dev/null 2>&1; if [[ $? -eq 0 ]]; then exit 0; else exit 1;fi check:rc==0 -cmd: grep "service:" /tmp/xcat_inventory_try_to_export_all_type_is_node_json_format/export_all_node > /dev/null 2>&1; if [[ $? -eq 0 ]]; then exit 0; else exit 1;fi +cmd: grep "service" /tmp/xcat_inventory_try_to_export_all_type_is_node_json_format/export_all_node > /dev/null 2>&1; if [[ $? -eq 0 ]]; then exit 0; else exit 1;fi check:rc==0 cmd:dn=$(cat /tmp/xcat_inventory_try_to_export_all_type_is_node_json_format/node_in_xcat_db|wc -l);dg=$(cat /tmp/xcat_inventory_try_to_export_all_type_is_node_json_format/group_in_xcat_db |wc -l);((da=$dn+$dg+2));ia=$(grep " \"obj_type\": " /tmp/xcat_inventory_try_to_export_all_type_is_node_json_format/export_all_node|wc -l); if [[ $da -eq $ia ]];then exit 0; else exit 1;fi check:rc==0 @@ -2020,7 +2020,7 @@ check:rc!=0 cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat_inventory/validatehelper "node" "bogusnode" "obj_type" "node" "import_validation_node_obj_type" check:rc==0 cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat_inventory/validatehelper "node" "bogusnode" "obj_type" "group" "import_validation_node_obj_type" -check:rc==0 +check:rc!=0 cmd:if [[ -e /tmp/import_validation_node_obj_type_bak/bogusnode.stanza ]]; then cat /tmp/import_validation_node_obj_type_bak/bogusnode.stanza | mkdef -z;fi check:rc==0 cmd:if [[ -e /tmp/import_validation_node_obj_type_bak/bogusgroup.stanza ]]; then cat /tmp/import_validation_node_obj_type_bak/bogusgroup.stanza |mkdef -z -f;fi @@ -2051,7 +2051,7 @@ check:rc==0 end start:import_validation_node_device_type -label:others,xcat_inventory +label:others,inventory_ci description:This case is used to test node validation function of xcat-inventory import yaml and json file. To test "device_type" attribute cmd:mkdir -p /tmp/import_validation_node_device_type_bak check:rc==0 @@ -2064,13 +2064,13 @@ check:rc!=0 cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat_inventory/validatehelper "node" "bogusnode" "device_type" "aaa" "import_validation_node_device_type" check:rc!=0 cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat_inventory/validatehelper "node" "bogusnode" "device_type" "switch" "import_validation_node_device_type" -check:rc==0 +check:rc!=0 cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat_inventory/validatehelper "node" "bogusnode" "device_type" "pdu" "import_validation_node_device_type" -check:rc==0 +check:rc!=0 cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat_inventory/validatehelper "node" "bogusnode" "device_type" "rack" "import_validation_node_device_type" -check:rc==0 +check:rc!=0 cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat_inventory/validatehelper "node" "bogusnode" "device_type" "hmc" "import_validation_node_device_type" -check:rc==0 +check:rc!=0 cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat_inventory/validatehelper "node" "bogusnode" "device_type" "server" "import_validation_node_device_type" check:rc==0 cmd:if [[ -e /tmp/import_validation_node_device_type_bak/bogusnode.stanza ]]; then cat /tmp/import_validation_node_device_type_bak/bogusnode.stanza | mkdef -z;fi @@ -2310,26 +2310,26 @@ check:rc==0 end -start:import_validation_node_network_info_primarynic_switchport -label:others,xcat_inventory -descrswitchporttion:This case is used to test node validation function of xcat-inventory import yaml and json file. To test "network_info.primarynic.switchport" attribute -cmd:mkdir -p /tmp/import_validation_node_network_info_primarynic_switchport_bak +start:import_validation_node_network_info_connections_switchport +label:others,inventory_ci +descrswitchporttion:This case is used to test node validation function of xcat-inventory import yaml and json file. To test "network_info.connections.switchport" attribute +cmd:mkdir -p /tmp/import_validation_node_network_info_connections_switchport_bak check:rc==0 -cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/import_validation_node_network_info_primarynic_switchport_bak/bogusnode.stanza ;rmdef bogusnode;fi +cmd:lsdef bogusnode > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef bogusnode -z >/tmp/import_validation_node_network_info_connections_switchport_bak/bogusnode.stanza ;rmdef bogusnode;fi check:rc==0 -cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/import_validation_node_network_info_primarynic_switchport_bak/bogusgroup.stanza; rmdef -t group bogusgroup;fi +cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t group bogusgroup -z > /tmp/import_validation_node_network_info_connections_switchport_bak/bogusgroup.stanza; rmdef -t group bogusgroup;fi check:rc==0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat_inventory/validatehelper "node" "bogusnode" "network_info.primarynic.switchport" "" "/tmp/import_validation_node_network_info_primarynic_switchport" +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat_inventory/validatehelper "node" "bogusnode" "network_info.connections.switchport" "" "/tmp/import_validation_node_network_info_connections_switchport" check:rc==0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat_inventory/validatehelper "node" "bogusnode" "network_info.primarynic.switchport" "70" "/tmp/import_validation_node_network_info_primarynic_switchport" +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat_inventory/validatehelper "node" "bogusnode" "network_info.connections.switchport" "70" "/tmp/import_validation_node_network_info_connections_switchport" check:rc==0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat_inventory/validatehelper "node" "bogusnode" "network_info.primarynic.switchport" "a90" "/tmp/import_validation_node_network_info_primarynic_switchport" -check:rc!=0 -cmd:if [[ -e /tmp/import_validation_node_network_info_primarynic_switchport_bak/bogusnode.stanza ]]; then cat /tmp/import_validation_node_network_info_primarynic_switchport_bak/bogusnode.stanza | mkdef -z;fi +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat_inventory/validatehelper "node" "bogusnode" "network_info.connections.switchport" "a90" "/tmp/import_validation_node_network_info_connections_switchport" check:rc==0 -cmd:if [[ -e /tmp/import_validation_node_network_info_primarynic_switchport_bak/bogusgroup.stanza ]]; then cat /tmp/import_validation_node_network_info_primarynic_switchport_bak/bogusgroup.stanza |mkdef -z -f;fi +cmd:if [[ -e /tmp/import_validation_node_network_info_connections_switchport_bak/bogusnode.stanza ]]; then cat /tmp/import_validation_node_network_info_connections_switchport_bak/bogusnode.stanza | mkdef -z;fi check:rc==0 -cmd:rm -rf /tmp/import_validation_node_network_info_primarynic_switchport_bak +cmd:if [[ -e /tmp/import_validation_node_network_info_connections_switchport_bak/bogusgroup.stanza ]]; then cat /tmp/import_validation_node_network_info_connections_switchport_bak/bogusgroup.stanza |mkdef -z -f;fi +check:rc==0 +cmd:rm -rf /tmp/import_validation_node_network_info_connections_switchport_bak check:rc==0 end @@ -2414,7 +2414,7 @@ end start:import_validation_node_role -label:others,xcat_inventory +label:others,inventory_ci descrroletion:This case is used to test node validation function of xcat-inventory import yaml and json file. To test "role" attribute cmd:mkdir -p /tmp/import_validation_node_role_bak check:rc==0 @@ -2424,8 +2424,8 @@ cmd:lsdef -t group bogusgroup > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef -t check:rc==0 cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat_inventory/validatehelper "node" "bogusnode" "role" "compute" "/tmp/import_validation_node_role" check:rc==0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat_inventory/validatehelper "node" "bogusnode" "role" "service" "/tmp/import_validation_node_role" -check:rc==0 +#cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat_inventory/validatehelper "node" "bogusnode" "role" "service" "/tmp/import_validation_node_role" +#check:rc!=0 cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat_inventory/validatehelper "node" "bogusnode" "role" "" "/tmp/import_validation_node_role" check:rc!=0 cmd:/opt/xcat/share/xcat/tools/autotest/testcase/xcat_inventory/validatehelper "node" "bogusnode" "role" "Compute" "/tmp/import_validation_node_role" diff --git a/xCAT-test/autotest/testcase/xcat_inventory/cases.osimage b/xCAT-test/autotest/testcase/xcat_inventory/cases.osimage index 03965dafa..cd6fb34ff 100644 --- a/xCAT-test/autotest/testcase/xcat_inventory/cases.osimage +++ b/xCAT-test/autotest/testcase/xcat_inventory/cases.osimage @@ -995,7 +995,7 @@ cmd:file="/tmp/partitionfile"; rm -rf $file; if [ -d ${file}".bak" ];then mv ${f end start:export_import_multiple_osimages_by_dir -label:others,xcat_inventory +label:others,inventory_ci description:This case is used to test xcat-inventory export and import several linux osimages definition by dir. cmd:if [ -e /tmp/otherpkglist ]; then cp -f /tmp/otherpkglist /tmp/otherpkglist.bak; fi cmd:echo "test" >> /tmp/otherpkglist @@ -1040,6 +1040,8 @@ cmd:dir="/opt/inventory/site/osimage";if [ -e "${dir}" ];then mv ${dir} ${dir}". cmd:xcat-inventory export -t osimage -o test_myimage1,test_myimage2 --format json -d /opt/inventory/site/osimage check:rc==0 check:output=~The osimage objects has been exported to directory /opt/inventory/site/osimage +cmd: ls -R /opt/inventory/site/osimage +check: output =~ site cmd:otherpkglist=`lsdef -t osimage -o test_myimage1 |grep otherpkglist|awk -F= '{print $2}'`;diff -y $otherpkglist /opt/inventory/site/osimage/test_myimage1$otherpkglist check:rc==0 cmd:synclists=`lsdef -t osimage -o test_myimage1 |grep synclists|awk -F= '{print $2}'`;diff -y $synclists /opt/inventory/site/osimage/test_myimage1$synclists @@ -1071,7 +1073,9 @@ check:rc==0 cmd: rmdef -t osimage -o test_myimage1,test_myimage2 check:rc==0 cmd:rm -rf /tmp/otherpkglist /tmp/synclists /tmp/postinstall /tmp/exlist /tmp/partitionfile /tmp/pkglist /tmp/template -cmd:xcat-inventory import -t osimage -o test_myimage1,test_myimage2 -d /opt/inventory/site +cmd: ls -R /opt/inventory/site +check: output =~ site +cmd:xcat-inventory import -t osimage -o test_myimage1,test_myimage2 -d /opt/inventory/site/osimage check:rc==0 check:output=~The object test_myimage1 has been imported check:output=~The object test_myimage2 has been imported @@ -1127,15 +1131,15 @@ cmd:file="/opt/xcat/share/xcat/install/rh/template"; rm -rf $file; if [ -d ${fil end start:export_import_all_osimages_by_dir -label:others,xcat_inventory +label:others,inventory_ci description:This case is used to test xcat-inventory export and import all linux osimage definition by files. cmd:lsdef -t osimage -z | tee /tmp/osimage.list check:rc==0 #backup all osimage cmd:if [ -e /tmp/osimages ]; then cp -f /tmp/osimages /tmp/osimages.bak ; else mkdir -p /tmp/osimages; fi -cmd:imgdir='/tmp/osimages';for img in $(lsdef -t osimage -s|awk -F' ' '{print $1}'); do lsdef -t osimage -o $img -z > $imgdir/${img}.stanza;done +cmd:imgdir='/tmp/osimages';for img in $(lsdef -t osimage -s|grep '(osimage)'|awk -F' ' '{print $1}'); do lsdef -t osimage -o $img -z > $imgdir/${img}.stanza;done check:rc==0 -cmd:for img in $(lsdef -t osimage -s|awk -F' ' '{print $1}');do rmdef -t osimage -o $img;done +cmd:for img in $(lsdef -t osimage -s|grep '(osimage)'|awk -F' ' '{print $1}');do rmdef -t osimage -o $img;done check:rc==0 cmd:if [ -e /tmp/otherpkglist ]; then cp -f /tmp/otherpkglist /tmp/otherpkglist.bak; fi cmd:echo "test" >> /tmp/otherpkglist @@ -1264,12 +1268,12 @@ cmd:if [ -e /tmp/osimages.bak ]; then mv -f /tmp/osimages.bak /tmp/osimages; fi end start:export_import_osimages_by_dir_with_c -label:others,xcat_inventory +label:others,inventory_ci description:This case is used to test xcat-inventory export and import linux osimage definition witch -c option. cmd:dir="/tmp/export";if [ -e "${dir}" ];then mv ${dir} ${dir}".bak"; fi; mkdir -p $dir -cmd:imgdir='/tmp/export';for img in $(lsdef -t osimage -s|awk -F' ' '{print $1}'); do lsdef -t osimage -o $img -z > $imgdir/${img}.stanza;done +cmd:imgdir='/tmp/export';for img in $(lsdef -t osimage -s|grep '(osimage)'|awk -F' ' '{print $1}'); do lsdef -t osimage -o $img -z > $imgdir/${img}.stanza;done check:rc==0 -cmd:for img in $(lsdef -t osimage -s|awk -F' ' '{print $1}');do rmdef -t osimage -o $img;done +cmd:for img in $(lsdef -t osimage -s|grep '(osimage)'|awk -F' ' '{print $1}');do rmdef -t osimage -o $img;done check:rc==0 cmd:chdef -t osimage -o test_myimage1,test_myimage2,test_myimage3 imagetype=linux provmethod=install check:rc==0 diff --git a/xCAT-test/autotest/testcase/xcat_inventory/cases.osimage.import_from_osimage_dir b/xCAT-test/autotest/testcase/xcat_inventory/cases.osimage.import_from_osimage_dir index 78a57f0b3..896842ef8 100644 --- a/xCAT-test/autotest/testcase/xcat_inventory/cases.osimage.import_from_osimage_dir +++ b/xCAT-test/autotest/testcase/xcat_inventory/cases.osimage.import_from_osimage_dir @@ -1,6 +1,6 @@ start:export_import_an_osimage_directory description: import an osimage diretory with `xcat-inventroy import -d ` -label:others,xcat_inventory +label:others,inventory_ci #backup any existing test_myimage cmd:mkdir -p /tmp/export_import_an_osimage_directory/backup check:rc==0 diff --git a/xCAT-test/autotest/testcase/xcat_inventory/cases.site b/xCAT-test/autotest/testcase/xcat_inventory/cases.site index 4042ccfaf..d70cb2bac 100644 --- a/xCAT-test/autotest/testcase/xcat_inventory/cases.site +++ b/xCAT-test/autotest/testcase/xcat_inventory/cases.site @@ -93,7 +93,7 @@ end start:xcat_inventory_try_to_export_all_type_is_site_default_format -label:others,xcat_inventory +label:others,inventory_ci description:This case is used to test xcat-inventory export all definition which type is site to default file. I.e. json file cmd:mkdir -p /tmp/xcat_inventory_try_to_export_all_type_is_site_default_format check:rc==0 @@ -101,100 +101,99 @@ cmd: lsdef -t site -o clustersite -z >/tmp/xcat_inventory_try_to_export_all_type check:rc==0 cmd:mnip=$(lsdef -t site -o clustersite -i master -c|awk -F'=' '{print $2}');chdef -t site -o clustersite useSSHonAIX=0 useNFSv4onAIX=0 FQDNfirst=1 SNsyncfiledir='/var/xcat/syncfiles' auditnosyslog=0 auditskipcmds=ALL blademaxp=64 cleanupxcatpost=no consoleondemand=no databaseloc='/var/lib' db2installloc='/mntdb2' dbtracelevel=0 defserialflow=0 defserialport=0 defserialspeed=9600 dhcpinterfaces=eth0 dhcplease=43200 dhcpsetup=n disjointdhcps=1 dnshandler=ddns dnsinterfaces='xcatmn|eth1,eth2;service|bond0' dnsupdaters=dnsupdaters domain='pok.stglabs.ibm.com' enableASMI=no excludenodes=excludenodes externaldns=externaldns extntpservers=extntpservers forwarders=$mnip fsptimeout=0 genmacprefix='00:11:aa' genpasswords=genpasswords hierarchicalattrs=hierarchicalattrs httpport=80 hwctrldispatch=y installdir='/install/' installloc='hostname:/path' ipmidispatch=y ipmimaxp=64 ipmiretries=3 ipmisdrcache=no ipmitimeout=2 iscsidir='/iscsidir' managedaddressmode=dhcp master=$mnip maxssh=8 mnroutenames=mnroutenames nameservers=$mnip nmapoptions='--min-rtt-timeout' nodestatus=n nodesyncfiledir='/var/xcat/node/syncfiles' ntpservers=$mnip persistkvmguests=y powerinterval=0 ppcmaxp=64 ppcretry=3 ppctimeout=0 precreatemypostscripts=1 pruneservices=1 runbootscripts=yes setinstallnic=1 sharedinstall=no sharedtftp=1 skiptables=nics skipvalidatelog=1 snmpc=snmpc sshbetweennodes=ALLGROUPS svloglocal=1 syspowerinterval=10 syspowermaxnodes=10 tftpdir='/tftprot/' tftpflags='-v' timezone='America/New_York' useNmapfromMN=no useflowcontrol=no usexhrm=no vcenterautojoin=no vmwarereconfigonpower=no vsftp=n xcatconfdir='/etc/xcat' xcatdebugmode=1 xcatdport=3001 xcatiport=3002 xcatlport=3003 xcatmaxbatchconnections=64 xcatmaxconnections=60 xcatsslciphers='3DES' xcatsslversion=TLSv1 check:rc==0 -cmd:#!/bin/bash -echo " - schema_version: '2.0' - site: - clustersite: - FQDNfirst: '1' - SNsyncfiledir: /var/xcat/syncfiles - auditnosyslog: '0' - auditskipcmds: ALL - blademaxp: '64' - cleanupxcatpost: 'no' - consoleondemand: 'no' - databaseloc: /var/lib - db2installloc: /mntdb2 - dbtracelevel: '0' - defserialflow: '0' - defserialport: '0' - defserialspeed: '9600' - dhcpinterfaces: eth0 - dhcplease: '43200' - dhcpsetup: n - disjointdhcps: '1' - dnshandler: ddns - dnsinterfaces: xcatmn|eth1,eth2;service|bond0 - dnsupdaters: dnsupdaters - domain: pok.stglabs.ibm.com - enableASMI: 'no' - excludenodes: excludenodes - externaldns: externaldns - extntpservers: extntpservers - forwarders: 10.3.1.13 - fsptimeout: '0' - genmacprefix: 00:11:aa - genpasswords: genpasswords - hierarchicalattrs: hierarchicalattrs - httpport: '80' - hwctrldispatch: y - installdir: /install/ - installloc: hostname:/path - ipmidispatch: y - ipmimaxp: '64' - ipmiretries: '3' - ipmisdrcache: 'no' - ipmitimeout: '2' - iscsidir: /iscsidir - managedaddressmode: dhcp - master: 10.3.1.13 - maxssh: '8' - mnroutenames: mnroutenames - nameservers: 10.3.1.13 - nmapoptions: --min-rtt-timeout - nodestatus: n - nodesyncfiledir: /var/xcat/node/syncfiles - ntpservers: 10.3.1.13 - persistkvmguests: y - powerinterval: '0' - ppcmaxp: '64' - ppcretry: '3' - ppctimeout: '0' - precreatemypostscripts: '1' - pruneservices: '1' - runbootscripts: 'yes' - setinstallnic: '1' - sharedinstall: 'no' - sharedtftp: '1' - skiptables: nics - skipvalidatelog: '1' - snmpc: snmpc - sshbetweennodes: ALLGROUPS - svloglocal: '1' - syspowerinterval: '10' - syspowermaxnodes: '10' - tftpdir: /tftprot/ - tftpflags: -v - timezone: America/New_York - useNFSv4onAIX: '0' - useNmapfromMN: 'no' - useSSHonAIX: '0' - useflowcontrol: 'no' - usexhrm: 'no' - vcenterautojoin: 'no' - vmwarereconfigonpower: 'no' - vsftp: n - xcatconfdir: /etc/xcat - xcatdebugmode: '1' - xcatdport: '3001' - xcatiport: '3002' - xcatlport: '3003' - xcatmaxbatchconnections: '64' - xcatmaxconnections: '60' - xcatsslciphers: 3DES - xcatsslversion: TLSv1 - " > /tmp/xcat_inventory_try_to_export_all_type_is_site_default_format/site.org -cmd:mnip=$(lsdef -t site -o clustersite -i master -c|awk -F'=' '{print $2}');sed -i "s/10.3.5.8/$mnip/g" /tmp/xcat_inventory_try_to_export_all_type_is_site_default_format/site.org +cmd:echo " +schema_version: '2.0' +site: + clustersite: + FQDNfirst: '1' + SNsyncfiledir: /var/xcat/syncfiles + auditnosyslog: '0' + auditskipcmds: ALL + blademaxp: '64' + cleanupxcatpost: 'no' + consoleondemand: 'no' + databaseloc: /var/lib + db2installloc: /mntdb2 + dbtracelevel: '0' + defserialflow: '0' + defserialport: '0' + defserialspeed: '9600' + dhcpinterfaces: eth0 + dhcplease: '43200' + dhcpsetup: n + disjointdhcps: '1' + dnshandler: ddns + dnsinterfaces: xcatmn|eth1,eth2;service|bond0 + dnsupdaters: dnsupdaters + domain: pok.stglabs.ibm.com + enableASMI: 'no' + excludenodes: excludenodes + externaldns: externaldns + extntpservers: extntpservers + forwarders: 10.3.1.13 + fsptimeout: '0' + genmacprefix: 00:11:aa + genpasswords: genpasswords + hierarchicalattrs: hierarchicalattrs + httpport: '80' + hwctrldispatch: y + installdir: /install/ + installloc: hostname:/path + ipmidispatch: y + ipmimaxp: '64' + ipmiretries: '3' + ipmisdrcache: 'no' + ipmitimeout: '2' + iscsidir: /iscsidir + managedaddressmode: dhcp + master: 10.3.1.13 + maxssh: '8' + mnroutenames: mnroutenames + nameservers: 10.3.1.13 + nmapoptions: --min-rtt-timeout + nodestatus: n + nodesyncfiledir: /var/xcat/node/syncfiles + ntpservers: 10.3.1.13 + persistkvmguests: y + powerinterval: '0' + ppcmaxp: '64' + ppcretry: '3' + ppctimeout: '0' + precreatemypostscripts: '1' + pruneservices: '1' + runbootscripts: 'yes' + setinstallnic: '1' + sharedinstall: 'no' + sharedtftp: '1' + skiptables: nics + skipvalidatelog: '1' + snmpc: snmpc + sshbetweennodes: ALLGROUPS + svloglocal: '1' + syspowerinterval: '10' + syspowermaxnodes: '10' + tftpdir: /tftprot/ + tftpflags: -v + timezone: America/New_York + useNFSv4onAIX: '0' + useNmapfromMN: 'no' + useSSHonAIX: '0' + useflowcontrol: 'no' + usexhrm: 'no' + vcenterautojoin: 'no' + vmwarereconfigonpower: 'no' + vsftp: n + xcatconfdir: /etc/xcat + xcatdebugmode: '1' + xcatdport: '3001' + xcatiport: '3002' + xcatlport: '3003' + xcatmaxbatchconnections: '64' + xcatmaxconnections: '60' + xcatsslciphers: 3DES + xcatsslversion: TLSv1 +" > /tmp/xcat_inventory_try_to_export_all_type_is_site_default_format/site.org +cmd:mnip=$(lsdef -t site -o clustersite -i master -c|awk -F'=' '{print $2}');sed -i "s/10.3.1.13/$mnip/g" /tmp/xcat_inventory_try_to_export_all_type_is_site_default_format/site.org check:rc==0 cmd:xcat-inventory export -t site |tee /tmp/xcat_inventory_try_to_export_all_type_is_site_default_format/site.export check:rc==0 diff --git a/xCAT-test/autotest/testcase/xcat_inventory/templates/cluster_invdir/osimage/test_myimage/definition.json b/xCAT-test/autotest/testcase/xcat_inventory/templates/cluster_invdir/osimage/test_myimage/definition.json index 6f4a69076..124cb7e82 100644 --- a/xCAT-test/autotest/testcase/xcat_inventory/templates/cluster_invdir/osimage/test_myimage/definition.json +++ b/xCAT-test/autotest/testcase/xcat_inventory/templates/cluster_invdir/osimage/test_myimage/definition.json @@ -18,4 +18,3 @@ }, "schema_version": "1.0" } -#Version 2.14.1 (git commit ac941fd2501e8a581bfcc4c79b9301f6ec37ab93, built Mon May 21 06:15:46 EDT 2018) diff --git a/xCAT-test/autotest/testcase/xcat_inventory/templates/cluster_invdir/osimage/test_myimage2/definition.json b/xCAT-test/autotest/testcase/xcat_inventory/templates/cluster_invdir/osimage/test_myimage2/definition.json index 9e983695c..f57231432 100644 --- a/xCAT-test/autotest/testcase/xcat_inventory/templates/cluster_invdir/osimage/test_myimage2/definition.json +++ b/xCAT-test/autotest/testcase/xcat_inventory/templates/cluster_invdir/osimage/test_myimage2/definition.json @@ -18,4 +18,3 @@ }, "schema_version": "1.0" } -#Version 2.14.1 (git commit ac941fd2501e8a581bfcc4c79b9301f6ec37ab93, built Mon May 21 06:15:46 EDT 2018) diff --git a/xCAT-test/autotest/testcase/xcat_inventory/templates/environment/test.environments.osimage.update.json b/xCAT-test/autotest/testcase/xcat_inventory/templates/environment/test.environments.osimage.update.json index 92b5fa341..12fb845cb 100644 --- a/xCAT-test/autotest/testcase/xcat_inventory/templates/environment/test.environments.osimage.update.json +++ b/xCAT-test/autotest/testcase/xcat_inventory/templates/environment/test.environments.osimage.update.json @@ -50,4 +50,3 @@ }, "schema_version": "1.0" } -#Version 2.14.4 (git commit 722709b61e63feb7f6d3ee787afa8113eefbe27e, built Wed Sep 26 06:17:57 EDT 2018) diff --git a/xCAT-test/autotest/testcase/xcat_inventory/templates/inventory.cfg b/xCAT-test/autotest/testcase/xcat_inventory/templates/inventory.cfg new file mode 100644 index 000000000..08030efd0 --- /dev/null +++ b/xCAT-test/autotest/testcase/xcat_inventory/templates/inventory.cfg @@ -0,0 +1,8 @@ +[backend] +type = 'git' +user = ci +workspace="master" + +[InfraRepo] +local_repo='/tmp/backend_test/git/repo' +working_dir=. diff --git a/xCAT-test/autotest/testcase/xcat_inventory/templates/network.json b/xCAT-test/autotest/testcase/xcat_inventory/templates/network.json index 263b936b6..43fcd4f8e 100644 --- a/xCAT-test/autotest/testcase/xcat_inventory/templates/network.json +++ b/xCAT-test/autotest/testcase/xcat_inventory/templates/network.json @@ -12,5 +12,5 @@ } } }, - "schema_version": "1.0" + "schema_version": "2.0" } diff --git a/xCAT-test/autotest/testcase/xcat_inventory/templates/network.yaml b/xCAT-test/autotest/testcase/xcat_inventory/templates/network.yaml index 88e4114d4..e95c8b872 100644 --- a/xCAT-test/autotest/testcase/xcat_inventory/templates/network.yaml +++ b/xCAT-test/autotest/testcase/xcat_inventory/templates/network.yaml @@ -7,5 +7,4 @@ network: pool: dynamicrange: 123.0.0.100-123.0.0.200 staticrange: 123.0.0.201-123.0.0.222 -schema_version: '1.0' - +schema_version: '2.0' diff --git a/xCAT-test/autotest/testcase/xcat_inventory/templates/node.json b/xCAT-test/autotest/testcase/xcat_inventory/templates/node.json index f0a8df835..145198cd7 100644 --- a/xCAT-test/autotest/testcase/xcat_inventory/templates/node.json +++ b/xCAT-test/autotest/testcase/xcat_inventory/templates/node.json @@ -22,8 +22,8 @@ "noderesnimserver": "nimserver", "noderesprimarynic": "primarynic", "noderesproxydhcp": "supportproxydhcp", - "servicenodeftpserver": "setupftp", - "servicenodenimserver": "setupnim", +# "servicenodeftpserver": "setupftp", +# "servicenodenimserver": "setupnim", "storagecontroller": "storagcontroller", "storageosvolume": "osvolume", "storagetype": "storagetype", @@ -114,6 +114,12 @@ } }, "network_info": { + "connections": { + "interface": "switchinterface", + "switch": "switch", + "switchport": "50", + "vlan": "switchvlan" + }, "nics": { "bond0": { "nicdevices": [ @@ -200,11 +206,11 @@ "hostnameprefixe": [ "eth0-" ], - "ips": [ - "1.1.1.1" - ], "hostnamesuffixes": [ "-eth0" + ], + "ips": [ + "1.1.1.1" ] }, "eth1": { @@ -270,17 +276,14 @@ "ip": "10.10.10.10", "mac": [ "42:d6:0a:03:05:08" - ], - "switch": "switch", - "switchinterface": "switchinterface", - "switchport": "50", - "switchvlan": "switchvlan" + ] }, "routenames": "routenames" }, "obj_info": { "description": "usercomment", - "groups": "bogusgroup" + "groups": "bogusgroup", + "grouptype": "static" }, "obj_type": "node", "position_info": { @@ -313,7 +316,9 @@ "xcatmaster": "xcatmaster" }, "security_info": { - "productkey": "productkey", + "productkey": { + "key": "productkey" + }, "zonename": "zonename" } }, @@ -428,6 +433,12 @@ } }, "network_info": { + "connections": { + "interface": "switchinterface", + "switch": "switch", + "switchport": "50", + "vlan": "switchvlan" + }, "nics": { "bond0": { "nicdevices": [ @@ -581,11 +592,7 @@ "ip": "10.10.10.10", "mac": [ "42:d6:0a:03:05:08" - ], - "switch": "switch", - "switchinterface": "switchinterface", - "switchport": "50", - "switchvlan": "switchvlan" + ] }, "routenames": "routenames" }, @@ -624,7 +631,9 @@ "xcatmaster": "xcatmaster" }, "security_info": { - "productkey": "productkey", + "productkey": { + "key": "productkey" + }, "remotecontrol": { "password": "password", "username": "username" @@ -751,6 +760,12 @@ } }, "network_info": { + "connections": { + "interface": "switchinterface", + "switch": "switch", + "switchport": "50", + "vlan": "switchvlan" + }, "linkports": "linkports", "nics": { "bond0": { @@ -905,11 +920,7 @@ "ip": "10.10.10.10", "mac": [ "42:d6:0a:03:05:08" - ], - "switch": "switch", - "switchinterface": "switchinterface", - "switchport": "50", - "switchvlan": "switchvlan" + ] }, "routenames": "routenames" }, @@ -948,7 +959,9 @@ "xcatmaster": "xcatmaster" }, "security_info": { - "productkey": "productkey", + "productkey": { + "key": "productkey" + }, "remotecontrol": { "password": "password", "remoteprotocol": "ssh", @@ -966,5 +979,5 @@ } } }, - "schema_version": "1.0" + "schema_version": "2.0" } diff --git a/xCAT-test/autotest/testcase/xcat_inventory/templates/node.yaml b/xCAT-test/autotest/testcase/xcat_inventory/templates/node.yaml index 172759d41..4c8b4382c 100644 --- a/xCAT-test/autotest/testcase/xcat_inventory/templates/node.yaml +++ b/xCAT-test/autotest/testcase/xcat_inventory/templates/node.yaml @@ -21,8 +21,8 @@ node: noderesnimserver: nimserver noderesprimarynic: primarynic noderesproxydhcp: supportproxydhcp - servicenodeftpserver: setupftp - servicenodenimserver: setupnim +# servicenodeftpserver: setupftp +# servicenodenimserver: setupnim storagecontroller: storagcontroller storageosvolume: osvolume storagetype: storagetype @@ -101,6 +101,11 @@ node: pdu: pdu engine_type: power network_info: + connections: + interface: switchinterface + switch: switch + switchport: '50' + vlan: switchvlan nics: bond0: nicdevices: @@ -202,14 +207,11 @@ node: ip: 10.10.10.10 mac: - 42:d6:0a:03:05:08 - switch: switch - switchinterface: switchinterface - switchport: '50' - switchvlan: switchvlan routenames: routenames obj_info: description: usercomment groups: bogusgroup + grouptype: static obj_type: node position_info: chassis: chassis @@ -239,7 +241,8 @@ node: tftpserver: tftpserver xcatmaster: xcatmaster security_info: - productkey: productkey + productkey: + key: productkey zonename: zonename boguspdu: deprecated: @@ -340,6 +343,11 @@ node: pdu: pdu engine_type: power network_info: + connections: + interface: switchinterface + switch: switch + switchport: '50' + vlan: switchvlan nics: bond0: nicdevices: @@ -439,14 +447,11 @@ node: ip: 10.10.10.10 mac: - 42:d6:0a:03:05:08 - switch: switch - switchinterface: switchinterface - switchport: '50' - switchvlan: switchvlan routenames: routenames obj_info: description: usercomment groups: bogusgroup + grouptype: static obj_type: node position_info: chassis: chassis @@ -476,7 +481,8 @@ node: tftpserver: tftpserver xcatmaster: xcatmaster security_info: - productkey: productkey + productkey: + key: productkey remotecontrol: password: password username: username @@ -587,6 +593,11 @@ node: pdu: pdu engine_type: power network_info: + connections: + interface: switchinterface + switch: switch + switchport: '50' + vlan: switchvlan linkports: linkports nics: bond0: @@ -687,14 +698,11 @@ node: ip: 10.10.10.10 mac: - 42:d6:0a:03:05:08 - switch: switch - switchinterface: switchinterface - switchport: '50' - switchvlan: switchvlan routenames: routenames obj_info: description: usercomment groups: bogusgroup + grouptype: static obj_type: node position_info: chassis: chassis @@ -724,7 +732,8 @@ node: tftpserver: tftpserver xcatmaster: xcatmaster security_info: - productkey: productkey + productkey: + key: productkey remotecontrol: password: password remoteprotocol: ssh @@ -737,5 +746,4 @@ node: username: snmpusername version: SNMPv1 zonename: zonename -schema_version: '1.0' - +schema_version: '2.0' diff --git a/xCAT-test/autotest/testcase/xcat_inventory/templates/osimage.json b/xCAT-test/autotest/testcase/xcat_inventory/templates/osimage.json index d35a00144..5f4a4ded2 100644 --- a/xCAT-test/autotest/testcase/xcat_inventory/templates/osimage.json +++ b/xCAT-test/autotest/testcase/xcat_inventory/templates/osimage.json @@ -6,22 +6,34 @@ "distribution": "sles12.2", "osdistro": "sles12.2-ppc64le" }, - "filestosync": "/install/custom/netboot/sles/compute.synclist", + "filestosync": [ + "/install/custom/netboot/sles/compute.synclist" + ], "genimgoptions": { - "exlist": "/opt/xcat/share/xcat/netboot/sles/compute.sles12.ppc64le.exlist", - "postinstall": "/opt/xcat/share/xcat/netboot/sles/compute.sles12.ppc64le.postinstall", - "rootimgdir": "/install/netboot/sles12.2/ppc64le/compute", - "rootfstype": "nfs" + "exlist": [ + "/opt/xcat/share/xcat/netboot/sles/compute.sles12.ppc64le.exlist" + ], + "postinstall": [ + "/opt/xcat/share/xcat/netboot/sles/compute.sles12.ppc64le.postinstall" + ], + "rootfstype": "nfs", + "rootimgdir": "/install/netboot/sles12.2/ppc64le/compute" }, "imagetype": "linux", "package_selection": { - "otherpkgdir": "/install/post/otherpkgs/sles12.2/ppc64le", - "pkgdir": "/install/sles12.2/ppc64le", - "pkglist": "/opt/xcat/share/xcat/netboot/sles/compute.sles12.ppc64le.pkglist" + "otherpkgdir": [ + "/install/post/otherpkgs/sles12.2/ppc64le" + ], + "pkgdir": [ + "/install/sles12.2/ppc64le" + ], + "pkglist": [ + "/opt/xcat/share/xcat/netboot/sles/compute.sles12.ppc64le.pkglist" + ] }, "provision_mode": "statelite", "role": "compute" } }, - "schema_version": "1.0" + "schema_version": "2.0" } diff --git a/xCAT-test/autotest/testcase/xcat_inventory/templates/osimage.yaml b/xCAT-test/autotest/testcase/xcat_inventory/templates/osimage.yaml index f837d42fb..a7287aede 100644 --- a/xCAT-test/autotest/testcase/xcat_inventory/templates/osimage.yaml +++ b/xCAT-test/autotest/testcase/xcat_inventory/templates/osimage.yaml @@ -4,18 +4,25 @@ osimage: arch: ppc64le distribution: sles12.2 osdistro: sles12.2-ppc64le - filestosync: /install/custom/netboot/sles/compute.synclist + filestosync: + - /install/custom/netboot/sles/compute.synclist genimgoptions: - exlist: /opt/xcat/share/xcat/netboot/sles/compute.sles12.ppc64le.exlist - postinstall: /opt/xcat/share/xcat/netboot/sles/compute.sles12.ppc64le.postinstall - rootimgdir: /install/netboot/sles12.2/ppc64le/compute + exlist: + - /opt/xcat/share/xcat/netboot/sles/compute.sles12.ppc64le.exlist + postinstall: + - /opt/xcat/share/xcat/netboot/sles/compute.sles12.ppc64le.postinstall rootfstype: nfs + rootimgdir: /install/netboot/sles12.2/ppc64le/compute imagetype: linux package_selection: - otherpkgdir: /install/post/otherpkgs/sles12.2/ppc64le - pkgdir: /install/sles12.2/ppc64le - pkglist: /opt/xcat/share/xcat/netboot/sles/compute.sles12.ppc64le.pkglist + otherpkgdir: + - /install/post/otherpkgs/sles12.2/ppc64le + pkgdir: + - /install/sles12.2/ppc64le + pkglist: + - /opt/xcat/share/xcat/netboot/sles/compute.sles12.ppc64le.pkglist provision_mode: statelite role: compute -schema_version: '1.0' +schema_version: '2.0' +#Version 2.14.5 (git commit e9d8db94e349c383a6686ecfd853536abe7a8c2b, built Wed Nov 21 06:17:14 EST 2018) diff --git a/xCAT-test/autotest/testcase/xcat_inventory/templates/passwd.json b/xCAT-test/autotest/testcase/xcat_inventory/templates/passwd.json index ca7f4bb78..73dcb1f71 100644 --- a/xCAT-test/autotest/testcase/xcat_inventory/templates/passwd.json +++ b/xCAT-test/autotest/testcase/xcat_inventory/templates/passwd.json @@ -6,5 +6,5 @@ "username": "root" } }, - "schema_version": "1.0" + "schema_version": "2.0" } diff --git a/xCAT-test/autotest/testcase/xcat_inventory/templates/passwd.yaml b/xCAT-test/autotest/testcase/xcat_inventory/templates/passwd.yaml index 1225761cb..fca26c76e 100644 --- a/xCAT-test/autotest/testcase/xcat_inventory/templates/passwd.yaml +++ b/xCAT-test/autotest/testcase/xcat_inventory/templates/passwd.yaml @@ -3,5 +3,4 @@ passwd: cryptmethod: md5 password: cluster username: root -schema_version: '1.0' - +schema_version: '2.0' diff --git a/xCAT-test/autotest/testcase/xcat_inventory/templates/route.json b/xCAT-test/autotest/testcase/xcat_inventory/templates/route.json index aa2b9febe..c66955e38 100644 --- a/xCAT-test/autotest/testcase/xcat_inventory/templates/route.json +++ b/xCAT-test/autotest/testcase/xcat_inventory/templates/route.json @@ -8,5 +8,5 @@ "usercomment": "hello world" } }, - "schema_version": "1.0" + "schema_version": "2.0" } diff --git a/xCAT-test/autotest/testcase/xcat_inventory/templates/route.yaml b/xCAT-test/autotest/testcase/xcat_inventory/templates/route.yaml index 5afda5a8d..a75a99bca 100644 --- a/xCAT-test/autotest/testcase/xcat_inventory/templates/route.yaml +++ b/xCAT-test/autotest/testcase/xcat_inventory/templates/route.yaml @@ -5,5 +5,4 @@ route: mask: 255.0.0.0 net: 100.0.0.0 usercomment: hello world -schema_version: '1.0' - +schema_version: '2.0' diff --git a/xCAT-test/autotest/testcase/xcat_inventory/templates/site.json b/xCAT-test/autotest/testcase/xcat_inventory/templates/site.json index 6f86279a4..473983a25 100644 --- a/xCAT-test/autotest/testcase/xcat_inventory/templates/site.json +++ b/xCAT-test/autotest/testcase/xcat_inventory/templates/site.json @@ -1,13 +1,13 @@ { - "schema_version": "1.0", + "schema_version": "2.0", "site": { "clustersite": { "dbtracelevel": "1", "dhcplease": "10240", "disjointdhcps": "0", "httpport": "80", - "sharedinstall": "no", "managedaddressmode": "dhcp", + "sharedinstall": "no", "sshbetweennodes": "ALLGROUPS", "xcatdebugmode": "0", "xcatdport": "3001", diff --git a/xCAT-test/autotest/testcase/xcat_inventory/templates/site.yaml b/xCAT-test/autotest/testcase/xcat_inventory/templates/site.yaml index 6a1e219a5..e58fc942e 100644 --- a/xCAT-test/autotest/testcase/xcat_inventory/templates/site.yaml +++ b/xCAT-test/autotest/testcase/xcat_inventory/templates/site.yaml @@ -1,15 +1,14 @@ -schema_version: '1.0' +schema_version: '2.0' site: clustersite: dbtracelevel: '1' dhcplease: '10240' disjointdhcps: '0' httpport: '80' + managedaddressmode: dhcp sharedinstall: 'no' - managedaddressmode: 'dhcp' - sshbetweennodes: 'ALLGROUPS' + sshbetweennodes: ALLGROUPS xcatdebugmode: '0' xcatdport: '3001' xcatiport: '3002' xcatlport: '3003' - diff --git a/xCAT-test/autotest/testcase/xcat_inventory/templates/testcluster_backend/cluster.yaml b/xCAT-test/autotest/testcase/xcat_inventory/templates/testcluster_backend/cluster.yaml new file mode 100644 index 000000000..12bc75a13 --- /dev/null +++ b/xCAT-test/autotest/testcase/xcat_inventory/templates/testcluster_backend/cluster.yaml @@ -0,0 +1,132 @@ +osdistro: + ubuntu17.10-ppc64el: + arch: ppc64el + basename: ubuntu + dirpaths: /install/ubuntu17.10/ppc64el + majorversion: '17' + minorversion: '10' + type: Linux +network: + prov: + basic_attr: + gateway: 10.6.7.1 + mask: 255.0.0.0 + net: 10.6.7.0 +node: + nodetorm: + device_type: server + obj_info: + groups: all + obj_type: node + role: compute + node2: + device_type: server + obj_info: + groups: all + obj_type: node + role: compute + xcatdefaults: + device_type: server + engines: + netboot_engine: + engine_info: + postbootscripts: otherpkgs + postscripts: syslog,remoteshell,syncfiles + obj_type: group + role: compute +passwd: + ipmi: + password: admin + username: ADMIN + omapi: + password: MnJKd01IWGtzYUNoY3FWZ29mRkdFcFhkbnBRNlBtYmg= + username: xcat_key + switch: + password: admin + username: root + system: + password: cluster + username: root +policy: + '1': + name: root + rule: allow + '1.2': + name: xcatmn + rule: trusted + '2': + commands: getbmcconfig + rule: allow + '2.1': + commands: remoteimmsetup + rule: allow + '2.3': + commands: lsxcatd + rule: allow + '3': + commands: nextdestiny + rule: allow + '4': + commands: getdestiny + rule: allow + '4.4': + commands: getpostscript + rule: allow + '4.5': + commands: getcredentials + rule: allow + '4.6': + commands: syncfiles + rule: allow + '4.7': + commands: litefile + rule: allow + '4.8': + commands: litetree + rule: allow + '4.9': + commands: getadapter + rule: allow +route: {} +schema_version: '2.0' +site: + clustersite: + SNsyncfiledir: /var/xcat/syncfiles + auditnosyslog: '0' + auditskipcmds: ALL + blademaxp: '64' + cleanupxcatpost: 'no' + consoleondemand: 'no' + databaseloc: /var/lib + db2installloc: /mntdb2 + dhcplease: '43200' + dnshandler: ddns + enableASMI: 'no' + forwarders: 10.6.29.1,10.0.0.101 + fsptimeout: '0' + installdir: /install + ipmimaxp: '64' + ipmiretries: '3' + ipmitimeout: '2' + master: 10.6.7.1 + maxssh: '8' + nameservers: 10.6.7.1 + nodesyncfiledir: /var/xcat/node/syncfiles + powerinterval: '0' + ppcmaxp: '64' + ppcretry: '3' + ppctimeout: '0' + sharedtftp: '1' + sshbetweennodes: ALLGROUPS + syspowerinterval: '0' + tftpdir: /tftpboot + timezone: Universal + useNmapfromMN: 'no' + vsftp: n + xcatconfdir: /etc/xcat + xcatdport: '3001' + xcatiport: '3002' + xcatsslversion: TLSv1 +zone: {} + +#Version 2.14.5 (git commit fc0fb3fca198aa298a114f6124749275e7d81f8c, built Thu Dec 6 22:20:43 EST 2018) diff --git a/xCAT-test/autotest/testcase/xcat_inventory/templates/testcluster_backend/credential/credential/definition.yaml b/xCAT-test/autotest/testcase/xcat_inventory/templates/testcluster_backend/credential/credential/definition.yaml new file mode 100644 index 000000000..897ec8a2e --- /dev/null +++ b/xCAT-test/autotest/testcase/xcat_inventory/templates/testcluster_backend/credential/credential/definition.yaml @@ -0,0 +1,11 @@ +credential: + credential: + CA: + certificate: /etc/xcat/ca/ca-cert.pem + private_key: /etc/xcat/ca/private/ca-key.pem + client: + root: /root/.xcat/client-cred.pem + server: /etc/xcat/cert/server-cred.pem +schema_version: '2.0' + +#Version 2.14.5 (git commit fc0fb3fca198aa298a114f6124749275e7d81f8c, built Thu Dec 6 22:20:43 EST 2018) \ No newline at end of file diff --git a/xCAT-test/autotest/testcase/xcat_inventory/templates/testcluster_backend/osimage/osimage1/definition.yaml b/xCAT-test/autotest/testcase/xcat_inventory/templates/testcluster_backend/osimage/osimage1/definition.yaml new file mode 100644 index 000000000..7bb948f46 --- /dev/null +++ b/xCAT-test/autotest/testcase/xcat_inventory/templates/testcluster_backend/osimage/osimage1/definition.yaml @@ -0,0 +1,9 @@ +osimage: + osimage1: + basic_attributes: + distribution: rh8 + imagetype: linux + provision_mode: netboot +schema_version: '2.0' + +#Version 2.14.5 (git commit fc0fb3fca198aa298a114f6124749275e7d81f8c, built Thu Dec 6 22:20:43 EST 2018) \ No newline at end of file diff --git a/xCAT-test/autotest/testcase/xcat_inventory/templates/testcluster_backend/osimage/osimage2/definition.yaml b/xCAT-test/autotest/testcase/xcat_inventory/templates/testcluster_backend/osimage/osimage2/definition.yaml new file mode 100644 index 000000000..10d0b09a1 --- /dev/null +++ b/xCAT-test/autotest/testcase/xcat_inventory/templates/testcluster_backend/osimage/osimage2/definition.yaml @@ -0,0 +1,9 @@ +osimage: + osimage2: + basic_attributes: + distribution: sles15 + imagetype: linux + provision_mode: netboot +schema_version: '2.0' + +#Version 2.14.5 (git commit fc0fb3fca198aa298a114f6124749275e7d81f8c, built Thu Dec 6 22:20:43 EST 2018) \ No newline at end of file diff --git a/xCAT-test/autotest/testcase/xcatconfig/case0 b/xCAT-test/autotest/testcase/xcatconfig/case0 index f66c6cb8b..038d238fc 100644 --- a/xCAT-test/autotest/testcase/xcatconfig/case0 +++ b/xCAT-test/autotest/testcase/xcatconfig/case0 @@ -94,7 +94,6 @@ cmd:rm -rf /tmp/xcatconfig.test check:rc==0 end - start:xcatconfig_c description:To regenerate cretials label:mn_only @@ -117,7 +116,13 @@ check:rc!=0 #step4:restore test environment cmd:rm -rf /tmp/xcatconfig.test check:rc==0 -cmd:mv -f /etc/xcat/cabak /etc/xcat/ca ;mv -f /etc/xcat/certbak /etc/xcat/cert +cmd:rm -rf /etc/xcat/cabak /etc/xcat/certbak +check:rc==0 +cmd:if service goconserver status > /dev/null 2>&1; then service goconserver restart; fi +cmd:if service conserver status > /dev/null 2>&1; then service conserver restart ; fi +cmd:if lsdef service > /dev/null 2>&1; then updatenode service -P servicenode;fi +check:rc==0 +cmd:if lsdef service > /dev/null 2>&1; then rpower $$CN stat;fi check:rc==0 end @@ -332,8 +337,8 @@ start:xcatconfig_u_check_xcatsslversion_rhels_sles description:after xcatconfig -u the site.xcatsslversion will not be changed os:rhels,sles label:mn_only -cmd:lsdef -t site -i xcatsslversion -c | grep '=TLSv1$' -check:rc==0 +cmd:mkdir -p /tmp/xcatconfig_u_check_xcatsslversion_rhels_sles +cmd:lsdef -t site clustersite -z >/tmp/xcatconfig_u_check_xcatsslversion_rhels_sles/clustersite.stanza cmd:chtab key=xcatsslversion site.value=TLSv12 check:rc==0 cmd:lsdef -t site -i xcatsslversion -c | grep '=TLSv12$' @@ -342,8 +347,8 @@ cmd:xcatconfig -u check:rc==0 cmd:lsdef -t site -i xcatsslversion -c | grep '=TLSv12$' check:rc==0 -cmd:chtab key=xcatsslversion site.value=TLSv1 -check:rc==0 +cmd: cat /tmp/xcatconfig_u_check_xcatsslversion_rhels_sles/clustersite.stanza |mkdef -zf +cmd: rm -rf /tmp/xcatconfig_u_check_xcatsslversion_rhels_sles end @@ -351,8 +356,8 @@ start:xcatconfig_u_check_xcatsslversion_ubuntu description:after xcatconfig -u the site.xcatsslversion will not be changed os:ubuntu label:mn_only -cmd:lsdef -t site -i xcatsslversion -c | grep '=TLSv1$' -check:rc==0 +cmd:mkdir -p /tmp/xcatconfig_u_check_xcatsslversion_ubuntu +cmd:lsdef -t site clustersite -z >/tmp/xcatconfig_u_check_xcatsslversion_ubuntu/clustersite.stanza cmd:chtab key=xcatsslversion site.value=TLSv1_2 check:rc==0 cmd:lsdef -t site -i xcatsslversion -c | grep '=TLSv1_2$' @@ -361,6 +366,6 @@ cmd:xcatconfig -u check:rc==0 cmd:lsdef -t site -i xcatsslversion -c | grep '=TLSv1_2$' check:rc==0 -cmd:chtab key=xcatsslversion site.value=TLSv1 -check:rc==0 +cmd: cat /tmp/xcatconfig_u_check_xcatsslversion_ubuntu/clustersite.stanza |mkdef -zf +cmd: rm -rf /tmp/xcatconfig_u_check_xcatsslversion_ubuntu end diff --git a/xCAT-test/autotest/testcase/xcatd/case0 b/xCAT-test/autotest/testcase/xcatd/case0 index 3720bc169..a9f234c00 100644 --- a/xCAT-test/autotest/testcase/xcatd/case0 +++ b/xCAT-test/autotest/testcase/xcatd/case0 @@ -10,7 +10,7 @@ check:output=~Active: active \(running\)|xcatd service is running cmd:ps axjf |grep -v grep |grep "xcatd:" | tee /tmp/xcatd_start/original_xcatd_processes_status check:rc==0 cmd:cat /tmp/xcatd_start/original_xcatd_processes_status |wc -l -check:output=~6 +#check:output=~6 cmd:service xcatd stop check:rc==0 cmd:sleep 3 @@ -104,9 +104,11 @@ check:rc==0 cmd:service xcatd stop check:rc==0 cmd:sleep 3 +cmd:ps aux|tee /tmp/run_command_with_XCATBYPASS.log +cmd:awk '{print $11}' /tmp/run_command_with_XCATBYPASS.log|grep -E ^xcatd +check:rc!=0 +cmd:rm -rf /tmp/run_command_with_XCATBYPASS.log cmd:service xcatd status -check:output=~xcatd service|xcatd.service -check:output=~xcatd service is not running|inactive \(dead\) cmd:tabdump site check:rc!=0 cmd:XCATBYPASS=YES tabdump site @@ -160,4 +162,20 @@ cmd:chtab name=root policy.commands= policy.rule=allow check:rc==0 end - +start:reload_xcatd_with_XCATBYPASS +description:with XCATBYPASS=YES, there is no error when restart xcatd deamon. This case is add test case for issue 2727 : run xCAT in "XCATBYPASS" mode and simply reload xCAT to check if there is any errors. +label:mn_only,ci_test,xcatd +cmd:service xcatd status +check:rc==0 +check:output=~xcatd service|xcatd.service +check:output=~xcatd service is running|active \(running\) +cmd:XCATBYPASS=YES lsxcatd -a +check:rc==0 +check:output!=~Error|ERROR +cmd:XCATBYPASS=YES service xcatd status +check:rc==0 +check:output!=~Error|ERROR +cmd:XCATBYPASS=YES service xcatd restart +check:rc==0 +check:output!=~Error|ERROR +end diff --git a/xCAT-test/autotest/testcase/xdcp/cases1 b/xCAT-test/autotest/testcase/xdcp/cases1 index d2b9f9bf1..1aa738a7f 100644 --- a/xCAT-test/autotest/testcase/xdcp/cases1 +++ b/xCAT-test/autotest/testcase/xdcp/cases1 @@ -1,13 +1,19 @@ start:xdcp_nonroot_user label:cn_os_ready,parallel_cmds -cmd:useradd -m xyzzy +cmd:lsdef -t site -z clustersite > /tmp/site.stanza +cmd:chdef -t site SNsyncfiledir=/tmp +cmd:servicenode=`lsdef $$CN |grep servicenode |awk -F= '{print $2}'`; if [ -n "$servicenode" ]; then xdsh $servicenode "useradd -m xyzzy";useradd -m xyzzy;else useradd -m xyzzy;fi check:rc==0 -cmd:bash -c "( cd ~root && tar cf - .xcat .ssh ) | ( cd ~xyzzy && tar xf - )" +cmd:servicenode=`lsdef $$CN |grep servicenode |awk -F= '{print $2}'`; if [ -n "$servicenode" ]; then xdsh $servicenode "type apt-get && apt-get install -y tar";fi +cmd:servicenode=`lsdef $$CN |grep servicenode |awk -F= '{print $2}'`; if [ -n "$servicenode" ]; then xdsh $servicenode "type yum && yum install -y tar"; fi +cmd:servicenode=`lsdef $$CN |grep servicenode |awk -F= '{print $2}'`; if [ -n "$servicenode" ]; then xdsh $servicenode "bash -c \"( cd ~root && tar cf - .xcat .ssh ) | ( cd ~xyzzy && tar xf - )\"";bash -c "( cd ~root && tar cf - .xcat .ssh ) | ( cd ~xyzzy && tar xf - )";else bash -c "( cd ~root && tar cf - .xcat .ssh ) | ( cd ~xyzzy && tar xf - )";fi check:rc==0 -cmd:chown -R xyzzy ~xyzzy/.xcat ~xyzzy/.ssh +cmd:servicenode=`lsdef $$CN |grep servicenode |awk -F= '{print $2}'`; if [ -n "$servicenode" ]; then xdsh $servicenode "chown -R xyzzy ~xyzzy/.xcat ~xyzzy/.ssh";chown -R xyzzy ~xyzzy/.xcat ~xyzzy/.ssh;else chown -R xyzzy ~xyzzy/.xcat ~xyzzy/.ssh;fi check:rc==0 cmd:xdsh $$CN "useradd -m xyzzy" check:rc==0 +cmd:xdsh $$CN "type apt-get && apt-get install -y tar" +cmd:xdsh $$CN "type yum && yum install -y tar" cmd:xdsh $$CN "( cd ~ && tar cf - .ssh ) | ( cd ~xyzzy && tar xf - )" check:rc==0 cmd:xdsh $$CN "chown -R xyzzy ~xyzzy/.ssh" @@ -18,6 +24,7 @@ cmd:xdsh $$CN "stat -c '%U' /tmp/sysctl.conf" check:output=~xyzzy cmd:xdsh $$CN "userdel xyzzy" check:rc==0 -cmd:userdel xyzzy +cmd:servicenode=`lsdef $$CN |grep servicenode |awk -F= '{print $2}'`; if [ -n "$servicenode" ]; then xdsh $servicenode "userdel xyzzy";userdel xyzzy;else userdel xyzzy;fi check:rc==0 +cmd:if [ -e /tmp/site.standa ]; then cat /tmp/site.standa | mkdef -z -f; rm -rf /tmp/site.standa; fi end diff --git a/xCAT-test/autotest/testcase/xdsh/cases0 b/xCAT-test/autotest/testcase/xdsh/cases0 index bab5e3f52..3166cbc8d 100644 --- a/xCAT-test/autotest/testcase/xdsh/cases0 +++ b/xCAT-test/autotest/testcase/xdsh/cases0 @@ -13,7 +13,7 @@ end start:xdsh_regular_command label:cn_os_ready,parallel_cmds -cmd:XCATBYPASS=1 xdsh $$CN "ps -ef" +cmd:xdsh $$CN "ps -ef" check:rc==0 check:output=~$$CN:\s+UID\s+PID\s+PPID\s+C\s+STIME\s+TTY\s+TIME\s+CMD end diff --git a/xCAT-test/autotest/testcase/xdsh/cases1 b/xCAT-test/autotest/testcase/xdsh/cases1 index f097cc54f..5da4adaa9 100644 --- a/xCAT-test/autotest/testcase/xdsh/cases1 +++ b/xCAT-test/autotest/testcase/xdsh/cases1 @@ -3,10 +3,10 @@ description: Test the exit code when command xdsh failed label:cn_os_ready,parallel_cmds cmd:xdsh $$CN date check:rc==0 -cmd:mv /root/.ssh/id_rsa /root/.ssh/id_rsa.backup +cmd:servicenode=`lsdef $$CN |grep servicenode |awk -F= '{print $2}'`; if [ -n "$servicenode" ]; then xdsh $$SN mv /root/.ssh/id_rsa /root/.ssh/id_rsa.backup;else mv /root/.ssh/id_rsa /root/.ssh/id_rsa.backup;fi check:rc==0 cmd:xdsh $$CN date check:rc!=0 -cmd:mv /root/.ssh/id_rsa.backup /root/.ssh/id_rsa +cmd:servicenode=`lsdef $$CN |grep servicenode |awk -F= '{print $2}'`; if [ -n "$servicenode" ]; then xdsh $$SN mv /root/.ssh/id_rsa.backup /root/.ssh/id_rsa;else mv /root/.ssh/id_rsa.backup /root/.ssh/id_rsa;fi check:rc==0 end diff --git a/xCAT-test/pods/man1/xcatperftest.1.pod b/xCAT-test/pods/man1/xcatperftest.1.pod index 19bea2307..774fc5bb0 100644 --- a/xCAT-test/pods/man1/xcatperftest.1.pod +++ b/xCAT-test/pods/man1/xcatperftest.1.pod @@ -6,28 +6,30 @@ B - Run xCAT command performance baseline testing on fake nodes. B [B<-?|-h>] +[B=y] B [I] + [B=y] [B=y] B [I] =head1 DESCRIPTION -The xcatperftest command runs commandes defined in a command list file and get their execution response time baseline for performance purpose. -The xcatperftest command is part of the xCAT package xCAT-test, and you can run it standalone or leverage it to build up your automation test cases. +The B command runs commands defined in a command list file and get their execution response time baseline for performance purpose. +The B command is part of the xCAT package B, and you can run it standalone or leverage it to build up your automation test cases. -Any commands could be defined in the command list file, however, it is recommended that the one-time initial configuration are well prepared prior to run xcatperftest command. -For example, the network object, osdistor and osimage image objects. +Any command could be defined in the command list file, however, it is recommended that the one-time initial configuration is well prepared prior to running B command. +For example, the network object, osdistro and osimage image objects. -Follow the below steps to run xcatperftest command: +Follow the steps below to run B command: -1, Install xCAT-test on a xCAT management nodes. +1. Install B on a xCAT management node. -2, Prepare a command list in which the commands are what you want to messure. +2. Prepare a command list with the commands you want to measure. -3, Prepare the initial configuration based on the command list to make sure all commands could be executed in techinal. +3. Prepare the initial configuration based on the command list to make sure all commands could be executed in techinal. -4, Run xcatperftest with the total fake nodes number and the above command list file. +4. Run B with the total fake nodes number and the above command list file. -Node: It is suggested to run the command in background as it normally takes long time to finish all the performanc testing with large amount of fake nodes. +Node: It is suggested to run the command in background as it normally takes long time to finish all the performance testing with large amount of fake nodes. =head1 OPTIONS @@ -37,7 +39,7 @@ Node: It is suggested to run the command in background as it normally takes long Display usage message. -=item +=item I Specifies the command list file with full-path. xCAT supports an example command file: /opt/xcat/share/xcat/tools/autotest/perfcmds.lst @@ -56,7 +58,7 @@ Total number of fake nodes will be defined during the testing. =head1 COMMAND LIST FILE -The command list file is in flat text format, the testing framework will parse the file line by line, here is an example of the commannd list file: +The command list file is in flat text format, the testing framework will parse the file line by line, here is an example of the command list file: #SERIES# 1,50,100,250,500,1000,2500,5000 mkdef -z -f < #STANZ# @@ -75,19 +77,19 @@ The command list file is in flat text format, the testing framework will parse t B: Each line defines one command, and the commands dependency should be handled by the line order. -If you define a node range series line (started with #SERIES#) in this file, xcatperftest will run the command for each node range defined in series line. +If you define a node range series line (started with B<#SERIES#>) in this file, xcatperftest will run the command for each node range defined in series line. B<#SERIES#> To define a node range series, and the series should be an comma split incremental number sequence. B<#STANZ#> It will be replaced with real stanz file path when this command line runs. -B<#NODES#> It will be replaced with real node range defined in #SERIES# line when this command line runs. If no series line, the node group will be used. +B<#NODES#> It will be replaced with real node range defined in B<#SERIES#> line when this command line runs. If no series line, the node group will be used. B<#PERFGRP#> It will be replaced with node group when this command line runs. =head1 ENVIRONMENT VARIABLE -The xcatperftest command supports be customized by some environment variables. +The B command supports customization by some environment variables. B @@ -110,15 +112,15 @@ It must be a string like 'A.B' and no need to be defined in 'networks' table. B -Optional, The node template name used for generating fake nodes. By default, it will be auto-detected according to the current arch. +Optional, the node template name used for generating fake nodes. By default, it will be auto-detected according to the current arch. B -Optional, Indicate no real commands will be executed if the environment variable is set. +Optional, indicate no real commands will be executed if the environment variable is set. B -Optional, Indicate no new fake nodes will be created if the environment variable is set. +Optional, indicate no new fake nodes will be created if the environment variable is set. =head1 EXAMPLES @@ -142,6 +144,12 @@ To run the performance testing for the commands defined in /opt/xcat/share/xcat/ PERF_NOCREATE=y xcatperftest 5000 /opt/xcat/share/xcat/tools/autotest/perfcmds.lst +=item 4. + +To run the performance testing for the commands defined in /tmp/cmd.lst in existing xCAT environment: + + xcatperftest run /tmp/cmd.lst + =back =head1 FILES diff --git a/xCAT-test/xcattest b/xCAT-test/xcattest index 2c8894661..500f33b08 100755 --- a/xCAT-test/xcattest +++ b/xCAT-test/xcattest @@ -2132,7 +2132,8 @@ sub calculate_case_belong_to_which_cmd { my $file_path = shift; my $command = undef; - if ($file_path =~ "\/autotest\/testcase") { + $file_path =~ s|[\/]{2,}|\/|g; + if ($file_path =~ /\/autotest\/testcase/) { my @path_str = split("/", $file_path); #print Dumper \@path_str; my $index = 0; diff --git a/xCAT/postscripts/configeth b/xCAT/postscripts/configeth index 0dfe77213..c1147aa47 100755 --- a/xCAT/postscripts/configeth +++ b/xCAT/postscripts/configeth @@ -23,6 +23,18 @@ if [ -z "$UPDATENODE" ] || [ $UPDATENODE -ne 1 ] ; then reboot_nic_bool=0 fi fi +######################################################################## +# networkmanager_active=0: use network.service +# networkmanager_active=1: use NetworkManager +######################################################################## +networkmanager_active=0 +checkservicestatus NetworkManager > /dev/null +if [ $? -eq 0 ]; then + networkmanager_active=1 +fi +str_conf_file="" +str_conf_file_xcatbak="" +tmp_con_name="" function configipv4(){ str_if_name=$1 str_v4ip=$2 @@ -115,24 +127,35 @@ function configipv4(){ echo " vlan-raw-device ${parent_device}" >> $str_conf_file fi else + str_prefix=$(v4mask2prefix $str_v4mask) # Write the info to the ifcfg file for redhat + con_name="xcat-"${str_if_name} str_conf_file="" - if [ $num_v4num -eq 0 ];then - str_conf_file="/etc/sysconfig/network-scripts/ifcfg-${str_if_name}" - echo "DEVICE=${str_if_name}" > $str_conf_file - else - str_conf_file="/etc/sysconfig/network-scripts/ifcfg-${str_if_name}:${num_v4num}" - echo "DEVICE=${str_if_name}:${num_v4num}" > $str_conf_file + if [ $num_v4num -ne 0 ]; then + str_if_name=${str_if_name}:${num_v4num} + fi + str_conf_file="/etc/sysconfig/network-scripts/ifcfg-${str_if_name}" + if [ $networkmanager_active -eq 1 ]; then + is_nmcli_connection_exist $con_name + if [ $? -eq 0 ]; then + tmp_con_name=$con_name"-tmp" + nmcli con modify $con_name connection.id $tmp_con_name + fi + nmcli con add type ethernet con-name $con_name ifname ${str_if_name} ipv4.method manual ipv4.addresses ${str_v4ip}/${str_prefix} connection.autoconnect-priority 9 + else + echo "DEVICE=${str_if_name}" > $str_conf_file + echo "BOOTPROTO=none" >> $str_conf_file + echo "NM_CONTROLLED=no" >> $str_conf_file + echo "IPADDR=${str_v4ip}" >> $str_conf_file + echo "NETMASK=${str_v4mask}" >> $str_conf_file + echo "ONBOOT=yes" >> $str_conf_file fi - - - echo "BOOTPROTO=static" >> $str_conf_file - echo "NM_CONTROLLED=no" >> $str_conf_file - echo "IPADDR=${str_v4ip}" >> $str_conf_file - echo "NETMASK=${str_v4mask}" >> $str_conf_file - echo "ONBOOT=yes" >> $str_conf_file if [ "$str_nic_mtu" != "$str_default_token" ]; then - echo "MTU=${str_nic_mtu}" >> $str_conf_file + if [ $networkmanager_active -eq 1 ]; then + nmcli con modify $con_name mtu $str_nic_mtu + else + echo "MTU=${str_nic_mtu}" >> $str_conf_file + fi fi if [[ ${str_if_name} == [a-zA-Z0-9]*.[0-9]* ]]; then @@ -416,7 +439,7 @@ if [ "$1" = "-r" ];then if [ "$str_os_type" = "debian" ];then ifdown --force $str_nic_name else - ifdown $str_nic_name + ip link set dev $str_nic_name down fi fi @@ -519,7 +542,6 @@ elif [ "$1" = "-s" ];then log_info "configeth on $NODE: config install nic, can not find information from dhcp lease file, return." exit 1 fi - str_inst_net=$(v4calcnet $str_inst_ip $str_inst_mask) num_index=1 while [ $num_index -le $NETWORKS_LINES ];do @@ -604,15 +626,31 @@ elif [ "$1" = "-s" ];then hostname $NODE echo $NODE > /etc/HOSTNAME else + #write ifcfg-* file for redhat + con_name="xcat-install-"${str_inst_nic} + str_inst_prefix=$(v4mask2prefix ${str_inst_mask}) str_conf_file="/etc/sysconfig/network-scripts/ifcfg-${str_inst_nic}" - echo "DEVICE=${str_inst_nic}" > $str_conf_file - echo "IPADDR=${str_inst_ip}" >> $str_conf_file - echo "NETMASK=${str_inst_mask}" >> $str_conf_file - echo "BOOTPROTO=static" >> $str_conf_file - echo "ONBOOT=yes" >> $str_conf_file - echo "HWADDR=${str_inst_mac}" >> $str_conf_file + if [ $networkmanager_active -eq 1 ]; then + is_nmcli_connection_exist "$con_name" + if [ $? -eq 0 ]; then + tmp_con_name=${str_inst_nic}"-tmp" + nmcli con modify $con_name connection.id $tmp_con_name + fi + nmcli con add type ethernet con-name $con_name ifname ${str_inst_nic} ipv4.method manual ipv4.addresses ${str_inst_ip}/${str_inst_prefix} connection.autoconnect-priority 9 + else + echo "DEVICE=${str_inst_nic}" > $str_conf_file + echo "IPADDR=${str_inst_ip}" >> $str_conf_file + echo "NETMASK=${str_inst_mask}" >> $str_conf_file + echo "BOOTPROTO=none" >> $str_conf_file + echo "ONBOOT=yes" >> $str_conf_file + echo "HWADDR=${str_inst_mac}" >> $str_conf_file + fi if [ -n "${str_inst_mtu}" ];then - echo "MTU=${str_inst_mtu}" >> $str_conf_file + if [ $networkmanager_active -eq 1 ]; then + nmcli con modify $con_name mtu ${str_inst_mtu} + else + echo "MTU=${str_inst_mtu}" >> $str_conf_file + fi fi if [ -n "$str_inst_gateway" ];then grep -i "GATEWAY" /etc/sysconfig/network @@ -647,19 +685,30 @@ elif [ "$1" = "-s" ];then fi fi - if [ "$UPDATENODE" = "1" ] || grep "REBOOT=TRUE" /opt/xcat/xcatinfo >/dev/null 2>&1; then + if [ "$UPDATENODE" = "1" ] || [ "$NODESETSTATE" = "netboot" ] || [ "$NODESETSTATE" = "statelite" ] || grep "REBOOT=TRUE" /opt/xcat/xcatinfo >/dev/null 2>&1; then if [ "$str_os_type" = "debian" ];then ifdown --force $str_inst_nic else - ifdown $str_inst_nic + ip link set dev $str_inst_nic down + fi + if [ $networkmanager_active -eq 1 ]; then + nmcli con up $con_name + wait_for_ifstate $str_inst_nic UP 10 5 + else + ifup $str_inst_nic fi - ifup $str_inst_nic fi if [ $? -ne 0 ]; then - log_error "ifup $str_inst_nic failed." + log_error "bring $str_inst_nic up failed." error_code=1 fi - + if [ $networkmanager_active -eq 1 ] && [ -n "$tmp_con_name" ]; then + if [ $error_code -eq 1 ]; then + nmcli con modify $tmp_con_name connection.id $con_name + else + nmcli con delete $tmp_con_name + fi + fi exit $error_code fi @@ -893,7 +942,6 @@ else bool_modify_flag=0 str_nic_status='down' str_his_file=${str_cfg_dir}xcat_history_important - str_history=`ip addr show dev $str_nic_name | grep inet | grep -iv dynamic | grep -iv link | grep $str_nic_name | awk '{print $2}'` old_ifs=$IFS IFS=$'\n' @@ -979,7 +1027,7 @@ else ifdown --force $str_nic_name > /dev/null else if [ $reboot_nic_bool -eq 1 ]; then - ifdown $str_nic_name > /dev/null + ip link set dev $str_nic_name down > /dev/null 2>/dev/null fi fi fi @@ -1059,14 +1107,25 @@ else else if [ $reboot_nic_bool -eq 1 ]; then echo "bring up ip" - ifup $str_nic_name + if [ $networkmanager_active -eq 1 ]; then + nmcli con up $con_name + wait_for_ifstate $str_nic_name UP 10 10 + else + ifup $str_nic_name + fi if [ $? -ne 0 ]; then - log_error "ifup $str_nic_name failed." + log_error "bring $str_nic_name up failed." error_code=1 fi fi fi fi fi - +if [ $networkmanager_active -eq 1 ] && [ -n "$tmp_con_name" ]; then + if [ $error_code -eq 1 ]; then + nmcli con modify $tmp_con_name connection.id $con_name + else + nmcli con delete $tmp_con_name + fi +fi exit $error_code diff --git a/xCAT/postscripts/confignetwork b/xCAT/postscripts/confignetwork index 7a6186bf4..40f4d4ace 100755 --- a/xCAT/postscripts/confignetwork +++ b/xCAT/postscripts/confignetwork @@ -63,13 +63,16 @@ function get_nic_cfg_file_content { elif [ $is_debian -eq 1 ]; then cfg_file="$nwdir/${cfg_dev}" fi - - if [ -f $cfg_file ]; then - echo "['${cfg_file}']" >&2 - cat ${cfg_file}| $sed -e 's/^/ >> /g' | log_lines info + if [ "$networkmanager_active" = "1" ]; then + $ip address show dev ${cfg_dev}| $sed -e 's/^/[Ethernet] >> /g' | log_lines info else - log_error "Can not find $cfg_file." - errorcode=1 + if [ -f $cfg_file ]; then + echo "['${cfg_file}']" >&2 + cat ${cfg_file}| $sed -e 's/^/ >> /g' | log_lines info + else + log_error "Can not find $cfg_file." + errorcode=1 + fi fi } @@ -523,7 +526,11 @@ function configure_nicdevice { echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" nic_pair=`echo "$nics_pair" |sed -n "${num}p"` echo "configure nic and its device : $nic_pair" - + ipaddrs=$(find_nic_ips $nic_dev) + # if a device is middle device, it may have no IP, for example, configure eth0->vlan.1->br0, vlan1.1 is middle device + # is_mid_device is to label if ${nic_dev} is middle device + # if $is_mid_device has value, the ${nic_dev} is middle device, or else, it is not middle device + is_mid_device=$(echo "$nics_pair"|awk /${nic_dev}$/'{ print $1}') #ignore bmc interfaces. They're allowed in the nics table to generate DNS/hostname records, but they #can't be configured here (it's done in bmcsetup if [ x"$nic_dev_type" = "xbmc" ]; then @@ -532,7 +539,6 @@ function configure_nicdevice { #configure standalone ethernet nic elif [ x"$nic_dev_type" = "xethernet" ]; then xcatnet=`query_nicnetworks_net $nic_dev` - ipaddrs=`find_nic_ips $nic_dev` if [ -n "$ipaddrs" ]; then log_info "configure $nic_dev" log_info "call: configeth $nic_dev $ipaddrs $xcatnet" @@ -555,11 +561,19 @@ function configure_nicdevice { #linux bridge type is bridge #openvswitch bridge type is bridge_ovs elif [ x"$nic_dev_type" = "xbridge_ovs" -o x"$nic_dev_type" = "xbridge" ]; then - check_brctl $nic_dev_type + if [ "$networkmanager_active" = "0" ]; then + check_brctl $nic_dev_type + if [ $? -ne 0 ]; then + errorcode=1 + else + create_bridge_interface ifname=$nic_dev _brtype=$nic_dev_type _port=$base_nic_dev _pretype=$base_nic_type + fi + elif [ "$networkmanager_active" = "1" ]; then + create_bridge_interface_nmcli ifname=$nic_dev _brtype=$nic_dev_type _port=$base_nic_dev _pretype=$base_nic_type _ipaddr=$ipaddrs + fi if [ $? -ne 0 ]; then - errorcode=1 - else - create_bridge_interface ifname=$nic_dev _brtype=$nic_dev_type _port=$base_nic_dev _pretype=$base_nic_type + log_error "create bridge interface $nic_dev failed" + errorcode=1; fi #configure vlan elif [ x"$nic_dev_type" = "xvlan" ]; then @@ -570,11 +584,27 @@ function configure_nicdevice { vlanid=`echo "$nic_dev" | $sed -e 's/^\(.*\)vla\?n\?\([0-9]\+\)$/\2/'` vlanname=`echo "$nic_dev" | $sed -e 's/^\(.*\)vla\?n\?\([0-9]\+\)$/\1/'` fi - create_vlan_interface ifname=$vlanname vlanid=$vlanid - + ipaddrs=$(find_nic_ips $nic_dev) + if [ "$networkmanager_active" = "0" ]; then + create_vlan_interface ifname=$vlanname vlanid=$vlanid + elif [ "$networkmanager_active" = "1" ]; then + create_vlan_interface_nmcli ifname=$vlanname vlanid=$vlanid ipaddrs=$ipaddrs next_nic=$is_mid_device + fi + if [ $? -ne 0 ]; then + log_error "configure VLAN failed." + errorcode=1 + fi #configure bond elif [ x"$nic_dev_type" = "xbond" ]; then - create_bond_interface ifname=$nic_dev slave_ports=$base_nic_for_bond slave_type=$base_nic_type + if [ "$networkmanager_active" = "0" ]; then + create_bond_interface ifname=$nic_dev slave_ports=$base_nic_for_bond slave_type=$base_nic_type + elif [ "$networkmanager_active" = "1" ]; then + create_bond_interface_nmcli bondname=$nic_dev slave_ports=$base_nic_for_bond slave_type=$base_nic_type _ipaddr=$ipaddrs next_nic=$is_mid_device + fi + if [ $? -ne 0 ]; then + log_error "configure bond $nic_dev failed." + errorcode=1 + fi elif [ x"$nic_dev_type" = "xinfiniband" ] || [ x"$nic_dev_type" = "xOmnipath" ]; then log_info "Call configib for IB nics: $nic_dev, ports: $num_iba_ports" log_info "NIC_IBNICS=$nic_dev NIC_IBAPORTS=$num_iba_ports configib" @@ -593,26 +623,6 @@ function configure_nicdevice { return $errorcode } -############################################################################ -# -# disable NetworkManager and start network -# -########################################################################### -function enable_network_service { - - checkservicestatus NetworkManager > /dev/null - if [ $? -eq 0 ]; then - log_info "NetworkManager is active. start to stop it ..." - stopservice NetworkManager | log_lines info - disableservice NetworkManager - enableservice network - startservice network - else - log_info "NetworkManager is inactive." - fi - -} - ############################################################################ # # Main process @@ -644,6 +654,29 @@ if [ $boot_install_nic -eq 1 ];then fi fi +#check if using NetworkManager or network service +networkmanager_active=2 +check_NetworkManager_or_network_service +is_active=$? +if [ $is_active -eq 0 ]; then + networkmanager_active=0 +elif [ $is_active -eq 1 ]; then + networkmanager_active=1 +else + exit 1 +fi + +#back up all network interface configure files +nwdirbak=$nwdir".xcatbak" +ls $nwdirbak > /dev/null 2>/dev/null +if [ $? -ne 0 ]; then + log_info "back up $nwdir to $nwdirbak" + cp -rf $nwdir $nwdirbak > /dev/null 2>/dev/null + if [ $? -ne 0 ]; then + log_warn "back up $nwdir to $nwdirbak failed." + fi +fi + #replace | with "@", for example, eth1|eth2 ----> eth1@eth2 nicdevice=`echo "$NICDEVICES" | sed 's/|/@/g'` @@ -695,8 +728,6 @@ if [ -n "$valid_sorted_nicdevice_list" ]; then log_info "All valid nics and device list:" echo "$valid_sorted_nicdevice_list" |log_lines info fi -#enable network service -enable_network_service #config nics and ifcfg files configure_nicdevice "$valid_sorted_nicdevice_list" diff --git a/xCAT/postscripts/enablekdump b/xCAT/postscripts/enablekdump index 295447b77..3a61bcfc0 100755 --- a/xCAT/postscripts/enablekdump +++ b/xCAT/postscripts/enablekdump @@ -101,7 +101,7 @@ if [ ! -z "$DUMP" ]; then MOUNTPATH="" if (pmatch $OSVER "*6\.*"); then MOUNTPATH="/tmp" - elif (pmatch $OSVER "*7\.*"); then + elif (pmatch $OSVER "*[78]\.*"); then MOUNTPATH="/mnt" else MOUNTPATH="/var/tmp" @@ -215,7 +215,7 @@ EOF mv ${oldremount}.bak $oldremount fi else - if (pmatch $OSVER "rhel7*") || (pmatch $OSVER "rhels7*");then + if (pmatch $OSVER "rhel[78]*") || (pmatch $OSVER "rhels[78]*");then nfsvers=$(/usr/sbin/rpcinfo -p $KDIP|grep -w nfs|awk /tcp/'{print $2}'|sort) nfsver=0 if [ -n "$nfsvers" ]; then @@ -246,8 +246,10 @@ EOF echo "nfs $KDIP:$KDPATH" > /etc/kdump.conf echo "default shell" >> /etc/kdump.conf - #strip "xcat" out of the initramfs for kdump - echo "dracut_args --omit \"xcat\"" >> /etc/kdump.conf + if (pmatch $OSVER "rhel7*") || (pmatch $OSVER "rhels7*");then + #strip "xcat" out of the initramfs for kdump + echo "dracut_args --omit \"xcat\"" >> /etc/kdump.conf + fi #strip the unnecessary kernel options from /proc/cmdline #the modified "cmdline" will be used as the kernel options #for kdump initramfs; otherwise, the "service kdump restart" will fail diff --git a/xCAT/postscripts/enablesnmp b/xCAT/postscripts/enablesnmp index c4b51df49..127876272 100755 --- a/xCAT/postscripts/enablesnmp +++ b/xCAT/postscripts/enablesnmp @@ -18,10 +18,7 @@ fi #get snmp attribute #NOTE: the length of SNMP Password has to be min=8 -xCATSettingsSTART="xCAT settings START" -xCATSettingsEND="xCAT settings END" -xCATSettingsOID="xCAT customized" -xCATSettingsInfo="Entries between the START and END lines will be replaced each time by running enablesnmp" +xCATSettingsOID="xCAT setting" snmpversion=$SNMPVERSION snmpuser=$SNMPUSER snmppwd=$SNMPPASSWD @@ -36,21 +33,8 @@ if [ $? -eq 0 ]; then cp ${snmp_conf}.cumulus $snmp_conf fi -grep "$xCATSettingsSTART" $snmp_conf 2>&1 1> /dev/null -if [ $? -eq 0 ]; then - #remove the previous snmp rule generated by xCAT - sed -i "/$xCATSettingsSTART/,/$xCATSettingsEND/ d" $snmp_conf -else - sed -i "/^\s*agentAddress/s/^/#/" $snmp_conf - sed -i '/agentAddress udp\:161\,udp6\:\[\:\:1\]\:161/s/^#//' $snmp_conf - sed -i "/view\s*systemonly\s*included\s*.1.3.6.1.2.1.17/s/^#//" $snmp_conf - sed -i "/pass_persist\s*.1.3.6.1.2.1.17\s*\/usr\/share\/snmp\/bridge_pp.py/s/^#//" $snmp_conf -fi - - -# Mark the start of xCAT section -echo "# $xCATSettingsSTART" >> $snmp_conf -echo "# $xCATSettingsInfo" >> $snmp_conf +# config snmpd to all the listening address +net add snmp-server listening-address all if [[ "$snmpversion" =~ "3" ]]; then #set up snmp version 3 @@ -58,21 +42,17 @@ if [[ "$snmpversion" =~ "3" ]]; then len=${#snmppwd} if [ $len -lt 8 ]; then echo "SNMP v3 specification requires password to have a minimum of 8 characters" - echo "# $xCATSettingsEND" >> $snmp_conf exit -1 fi - snmpauth=`echo $snmpauth | tr '[a-z]' '[A-Z]'` + snmpauth=`echo $snmpauth | awk '{print tolower($0)}'` if [ -n "$snmppriv" ]; then - snmppriv=`echo $snmppriv | tr '[a-z]' '[A-Z]'` - echo "createUser $snmpuser $snmpauth $snmppwd $snmppriv $snmppwd" >> $snmp_conf - echo "rwuser $snmpuser" >> $snmp_conf + snmppriv=`echo $snmppriv | awk '{print tolower($0)}'` + net add snmp-server username $snmpuser auth-$snmpauth $snmppwd encrypt-$snmppriv $snmppwd else - echo "createUser $snmpuser $snmpauth $snmppwd" >> $snmp_conf - echo "rouser $snmpuser" >> $snmp_conf + net add snmp-server username $snmpuser auth-$snmpauth $snmppwd fi else echo "Please define user/password/auth for SNMP v3 specification" - echo "# $xCATSettingsEND" >> $snmp_conf exit -1 fi elif [ -n "$snmppwd" ]; then @@ -81,10 +61,8 @@ elif [ -n "$snmpc" ]; then community=$snmpc fi -echo "rocommunity $community default" >> $snmp_conf -echo "rocommunity $community default -V systemonly" >> $snmp_conf - -echo "# $xCATSettingsEND" >> $snmp_conf +net add snmp-server readonly-community $community access any +net commit #create snmpd restart conf file mkdir -p /etc/systemd/system/snmpd.service.d diff --git a/xCAT/postscripts/nicutils.sh b/xCAT/postscripts/nicutils.sh index 74e6131ce..22f499f92 100755 --- a/xCAT/postscripts/nicutils.sh +++ b/xCAT/postscripts/nicutils.sh @@ -743,6 +743,36 @@ function check_brctl() { fi } +############################################################################### +# +# check and set device managed +# input: network device interface +# output: 0 managed +# 1 umanaged +# +############################################################################### +function check_and_set_device_managed() { + devname=$1 + rc=1 + $nmcli device show $devname >/dev/null 2>/dev/null + if [ $? -ne 0 ]; then + log_error "Device $devname not found" + else + $nmcli -g GENERAL.STATE device show $devname|grep unmanaged >/dev/null 2>/dev/null + if [ $? -eq 0 ]; then + log_info "$nmcli device set $devname managed yes" + $nmcli device set $devname managed yes + if [ $? -eq 0 ]; then + rc=0 + else + log_error "nmcli fail to set device $devname managed" + fi + else + rc=0 + fi + fi + return $rc +} ############################################################################### # @@ -1161,9 +1191,9 @@ function create_vlan_interface { while [ ! -f /proc/net/vlan/$ifname.$vlanid ]; do if [ $i -eq 0 ]; then - # alternative cmd to "vconfig add $ifname $vlanid" - $ip link add link $ifname name $ifname.$vlanid type vlan id $(( 10#$vlanid )) - log_info "$ip link add link $ifname name $ifname.$vlanid type vlan id $(( 10#$vlanid ))" + cmd="$ip link add link $ifname name $ifname.$vlanid type vlan id $(( 10#$vlanid ))" + $cmd + log_info "$cmd" fi $sleep 0.5 ((i+=1)) @@ -1174,7 +1204,6 @@ function create_vlan_interface { return 1 fi - # setup interface [ -n "$_mtu" ] && $ip link set $ifname.$vlanid mtu $_mtu $ip link set $ifname.$vlanid up log_info "$ip link set $ifname.$vlanid up" @@ -1548,3 +1577,679 @@ function decode_arguments { return $rc } +############################################################################### +# +# check NetworkManager +# output: 2 error +# 1 using NetworkManager +# 0 using network +# +############################################################################## +function check_NetworkManager_or_network_service() { + #check NetworkManager is active + checkservicestatus NetworkManager > /dev/null 2>/dev/null + if [ $? -eq 0 ]; then + log_info "NetworkManager is active" + #check nmcli is installed + type $nmcli >/dev/null 2>/dev/null + if [ $? -ne 0 ]; then + log_error "There is no nmcli" + else + stopservice network | log_lines info + disableservice network | log_lines info + stopservice networking | log_lines info + disableservice networking | log_lines info + return 1 + fi + fi + checkservicestatus network > /dev/null 2>/dev/null || checkservicestatus wicked > /dev/null 2>/dev/null + if [ $? -eq 0 ]; then + stopservice NetworkManager | log_lines info + disableservice NetworkManager | log_lines info + log_info "network service is active" + return 0 + fi + checkservicestatus networking > /dev/null 2>/dev/null + if [ $? -eq 0 ]; then + stopservice NetworkManager | log_lines info + disableservice NetworkManager | log_lines info + log_info "networking service is active" + return 0 + fi + log_error "NetworkManager, network.service and networking service are not active" + return 2 +} + +############################################################################### +# +# check nmcli connection name existed or not +# input: network connetion +# return: 0 connection exists +# 1 connection does not exist +# +############################################################################## +function is_nmcli_connection_exist { + + str_con_name=$1 + # the device str_if_name active connectin + nmcli -g NAME connection show |grep -w $str_con_name >/dev/null 2>/dev/null + if [ $? -eq 0 ]; then + return 0 + else + return 1 + fi + +} + +############################################################################### +# +# get first addr from nicips if it is valid ipv4 addr +# input: nics.nicips for one nic +# return 0, output: ipv4 addr +# return 1, output error: "IP: $IP not available" or "$IP: IP format error" +# +############################################################################### +function get_first_addr_ipv4 { + + str_ips=$1 + res=1 + if [ -n "$str_ips" ]; then + IP=$(echo "$str_ips"|awk -F"|" '{print $1}') + if [[ $IP =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then + FIELD1=$(echo $IP|cut -d. -f1) + FIELD2=$(echo $IP|cut -d. -f2) + FIELD3=$(echo $IP|cut -d. -f3) + FIELD4=$(echo $IP|cut -d. -f4) + if [ $FIELD1 -gt 0 -a $FIELD1 -lt 255 -a $FIELD2 -le 255 -a $FIELD3 -le 255 -a $FIELD4 -le 255 -a $FIELD4 -gt 0 ]; then + echo "$IP" + res=0 + else + log_error "IP: $IP invalid" + fi + else + log_error "$IP: IP format error" + fi + fi + return $res +} + +############################################################################### +# +# create vlan using nmcli +# +# input : ifname= vlanid= ipaddrs= next_nic= +# return : 0 success +# +############################################################################### +function create_vlan_interface_nmcli { + log_info "create_vlan_interface_nmcli $@" + local ifname="" + local vlanid="" + local ipaddrs="" + local _ipaddrs="" + local _xcatnet="" + local _netmask="" + local _mtu="" + local next_nic="" + # in case it's on top of bond, we need to migrate ip from its + # member vlan ports. + # parser input arguments + while [ -n "$1" ]; + do + key=`echo "$1" | $cut -s -d= -f1` + if [ "$key" = "ifname" ] || \ + [ "$key" = "ipaddrs" ] || \ + [ "$key" = "next_nic" ] || \ + [ "$key" = "vlanid" ]; then + eval "$1" + fi + shift + done + + if [ -z "$vlanid" ]; then + log_error "No \"vlanid\" specificd for vlan interface. Abort!" + return 1 + fi + if [ -z "$next_nic" ]; then + _xcatnet=$(query_nicnetworks_net $ifname.$vlanid) + log_info "Pickup xcatnet, \"$_xcatnet\", from NICNETWORKS for interface \"$ifname\"." + + _mtu_num=$(get_network_attr $xcatnet mtu) + if [ -n "$_mtu_num" ]; then + _mtu="mtu $_mtu_num" + fi + + if [ ! -z "$ipaddrs" ]; then + _netmask_long=$(get_network_attr $_xcatnet mask) + if [ $? -ne 0 ]; then + log_error "No valid netmask get for $ifname.$vlanid" + return 1 + else + ipaddr=$(get_first_addr_ipv4 $ipaddrs) + if [ $? -ne 0 ]; then + log_error "No valid IP address get for $ifname.$vlanid, please check $ipaddrs" + return 1 + fi + _netmask=$(v4mask2prefix $_netmask_long) + _ipaddrs="method none ip4 $ipaddr/$_netmask" + fi + fi + fi + check_and_set_device_managed $ifname + if [ $? -ne 0 ]; then + log_error "The parent interface $ifname is unmanaged, so skip $ifname.$vlanid" + return 1 + fi + log_info "check parent interface $ifname whether it is managed by NetworkManager" + #load the 8021q module if not loaded. + load_kmod module=8021q retry=10 interval=0.5 + con_name="xcat-vlan-$ifname.$vlanid" + tmp_con_name="" + is_nmcli_connection_exist $con_name + if [ $? -eq 0 ]; then + tmp_con_name=$con_name"-tmp" + $nmcli con modify $con_name connection.id $tmp_con_name + fi + + $nmcli con add type vlan con-name $con_name dev $ifname id $(( 10#$vlanid )) $_ipaddrs $_mtu connection.autoconnect-priority 9 + log_info "create NetworkManager connection for $ifname.$vlanid" + if [ -z "$next_nic" ]; then + $nmcli con up $con_name + is_connection_activate_intime $con_name + is_active=$? + if [ "$is_active" -eq 0 ]; then + log_error "The vlan configuration for $ifname.$vlanid can not be booted up" + $nmcli con delete $con_name + if [ ! -z "$tmp_con_name" ]; then + $nmcli con modify $tmp_con_name connection.id $con_name + fi + return 1 + fi + fi + if [ -n "$tmp_con_name" ]; then + $nmcli con delete $tmp_con_name + fi + $ip address show dev $ifname.$vlanid | $sed -e 's/^/[vlan] >> /g' | log_lines info + return 0 +} + +############################################################################### +# +# is_connection_activate_intime +# +# input : connection_name +# time_out (optional, 40 seconds by default) +# return : 1 active +# 0 failed +# +############################################################################### + +function is_connection_activate_intime { + con_name=$1 + time_out=40 + if [ ! -z "$2" ]; then + time_out=$2 + fi + i=0 + while [ $i -lt "$time_out" ]; do + con_state=$($nmcli con show $con_name | grep -i state| awk '{print $2}'); + if [ ! -z "$con_state" -a "$con_state" = "activated" ]; then + break + fi + sleep 1 + i=$((i+1)) + done + if [ $i -ge "$time_out" ]; then + return 0 + else + return 1 + fi +} + +############################################################################### +# +# create bridge +# +# input : ifname= _ipaddr= _port= _pretype= _brtype= +# success: return 0 +# +############################################################################### +function create_bridge_interface_nmcli { + log_info "create_bridge_interface_nmcli $@" + local ifname="" #current bridge + local _brtype="" + local _pretype="" + local _port="" #pre nic + local _mtu="" + local xcatnet="" + local _ipaddr="" + rc=0 + # parser input arguments + while [ -n "$1" ]; + do + key=`echo "$1" | $cut -s -d= -f1` + if [ "$key" = "ifname" ] || \ + [ "$key" = "_brtype" ] || \ + [ "$key" = "_pretype" ] || \ + [ "$key" = "_port" ] || \ + [ "$key" = "_ipaddr" ]; then + eval "$1" + fi + shift + done + # query "nicnetworks" table about its target "xcatnet" + xcatnet=$(query_nicnetworks_net $ifname) + log_info "Pickup xcatnet, \"$xcatnet\", from NICNETWORKS for interface \"$ifname\"." + + # Query mtu value from "networks" table + _mtu_num=$(get_network_attr $xcatnet mtu) + if [ -n "$_mtu_num" ]; then + _mtu="mtu $_mtu_num" + fi + + # Query mask value from "networks" table + _netmask=$(get_network_attr $xcatnet mask) + if [ $? -ne 0 ]; then + log_error "No valid netmask get for $ifname" + return 1 + fi + # Calculate prefix based on mask + str_prefix=$(v4mask2prefix $_netmask) + + # Get first valid ip from nics.nicips + ipv4_addr=$(get_first_addr_ipv4 $_ipaddr) + if [ $? -ne 0 ]; then + log_error "No valid IP address get for $ifname, please check $ipaddrs" + return 1 + fi + # Check and set slave device status + # If slave device failed to managed, return 1 + check_and_set_device_managed $_port + if [ $? -ne 0 ]; then + return 1 + fi + # Create bridge connection + xcat_con_name="xcat-bridge-"$ifname + tmp_con_name=$xcat_con_name"-tmp" + if [ x"$_brtype" = "xbridge" ]; then + is_nmcli_connection_exist $xcat_con_name + if [ $? -eq 0 ] ; then + is_connection_activate_intime $xcat_con_name 1 + if [ $? -eq 1 ]; then + log_info "$xcat_con_name exists, down it first" + $nmcli con down $xcat_con_name + $ip link set dev $ifname down + fi + log_info "$xcat_con_name exists, rename old $xcat_con_name to $tmp_con_name" + $nmcli con modify $xcat_con_name connection.id $tmp_con_name autoconnect no + if [ $? -ne 0 ] ; then + log_error "$nmcli rename $xcat_con_name failed" + return 1 + fi + fi + log_info "create bridge connection $xcat_con_name" + cmd="$nmcli con add type bridge con-name $xcat_con_name ifname $ifname $_mtu connection.autoconnect-priority 9" + log_info $cmd + $cmd + if [ $? -ne 0 ]; then + log_error "nmcli failed to add bridge $ifname" + is_nmcli_connection_exist $tmp_con_name + if [ $? -eq 0 ] ; then + $nmcli con modify $tmp_con_name connection.id $xcat_con_name + fi + return 1 + fi + else + log_error "$_brtype is not supported." + return 1 + fi + + # Create slaves connection + xcat_slave_con="xcat-br-slave-"$_port + tmp_slave_con_name=$xcat_slave_con"-tmp" + if [ x"$_pretype" = "xethernet" -o x"$_pretype" = "xvlan" -o x"$_pretype" = "xbond" ]; then + is_nmcli_connection_exist $xcat_slave_con + if [ $? -eq 0 ] ; then + is_connection_activate_intime $xcat_slave_con 1 + if [ $? -eq 1 ]; then + $nmcli con down $xcat_slave_con + $ip link set dev $_port down + fi + log_info "$xcat_slave_con exists, rename old connetion $xcat_slave_con to $tmp_slave_con_name" + $nmcli con modify $xcat_slave_con connection.id $tmp_slave_con_name autoconnect no + if [ $? -ne 0 ] ; then + log_error "$nmcli rename $xcat_slave_con failed" + return 1 + fi + fi + con_use_same_dev=$(nmcli dev show $_port|grep GENERAL.CONNECTION|awk -F: '{print $2}'|sed 's/^[ \t]*//g') + if [ "$con_use_same_dev" != "--" -a -n "$con_use_same_dev" ]; then + cmd="$nmcli con mod "$con_use_same_dev" master $ifname $_mtu connection.autoconnect-priority 9" + xcat_slave_con=$con_use_same_dev + else + cmd="$nmcli con add type $_pretype con-name $xcat_slave_con ifname $_port master $ifname $_mtu connection.autoconnect-priority 9" + fi + log_info "create $_pretype slaves connetcion $xcat_slave_con for bridge" + log_info "$cmd" + $cmd + if [ $? -ne 0 ]; then + log_error "nmcli failed to add bridge slave $_port" + is_nmcli_connection_exist $tmp_slave_con_name + if [ $? -eq 0 ] ; then + $nmcli con modify $tmp_slave_con_name connection.id $xcat_slave_con + fi + return 1 + fi + else + log_error "create $_pretype slaves for bridge is not supported" + return 1 + fi + + # Add ip to bridge + if [ -n "$ipv4_addr" ]; then + log_info "add ip $ipv4_addr/$str_prefix to bridge" + $nmcli con mod $xcat_con_name ipv4.method manual ipv4.addresses $ipv4_addr/$str_prefix; + fi + + # bring up interface formally + log_info "$nmcli con up $xcat_con_name" + $nmcli con up $xcat_con_name + rc=$? + log_info "$nmcli con up $xcat_slave_con" + $nmcli con up $xcat_slave_con + # If bridge interface is active, delete tmp old connection + # If bridge interface is not active, delete new bridge and slave connection, and restore old connection + is_connection_activate_intime $xcat_con_name + is_active=$? + if [ "$is_active" -eq 0 ]; then + log_error "$nmcli con up $xcat_con_name failed with return code equals to $is_active" + $nmcli con delete $xcat_con_name + is_nmcli_connection_exist $tmp_con_name + if [ $? -eq 0 ]; then + nmcli con modify $tmp_con_name connection.id $xcat_con_name + fi + $nmcli con delete $xcat_slave_con + is_nmcli_connection_exist $tmp_slave_con_name + if [ $? -eq 0 ]; then + nmcli con modify $tmp_slave_con_name connection.id $xcat_slave_con + fi + else + is_nmcli_connection_exist $tmp_con_name + if [ $? -eq 0 ]; then + $nmcli con delete $tmp_con_name + fi + is_nmcli_connection_exist $tmp_slave_con_name + if [ $? -eq 0 ]; then + $nmcli con delete $tmp_slave_con_name + fi + wait_for_ifstate $ifname UP 20 40 + rc=$? + $ip address show dev $ifname| $sed -e 's/^/[bridge] >> /g' | log_lines info + fi + + return $rc +} + +############################################################################################################################# +# +# create bond or bond->vlan interface +# +# input : bondname= _ipaddr= slave_ports= slave_type= next_nic= +# return : 0 successful +# other unsuccessful +# +############################################################################################################################ +function create_bond_interface_nmcli { + log_info "create_bond_interface_nmcli $@" + local bondname="" + local xcatnet="" + local _ipaddr="" + local _netmask="" + local _bonding_opts="" + local _mtu="" + local slave_ports="" #bond slaves + local slave_type="" + local rc=0 + local next_nic="" + # parser input arguments + while [ -n "$1" ]; + do + key=$(echo "$1" | $cut -s -d= -f1) + if [ "$key" = "bondname" ] || \ + [ "$key" = "_ipaddr" ] || \ + [ "$key" = "slave_ports" ] || \ + [ "$key" = "next_nic" ] || \ + [ "$key" = "slave_type" ]; then + eval "$1" + fi + shift + done + if [ "$slave_type" = "ethernet" ]; then + slave_type="Ethernet" + # - "802.3ad" mode requires a switch that is 802.3ad compliant. + _bonding_opts="mode=802.3ad,miimon=100" + elif [ "$slave_type" = "infiniband" ]; then + slave_type="Infiniband" + _bonding_opts="mode=1,miimon=100,fail_over_mac=1" + else + _bonding_opts="mode=active-backup" + fi + if [ -z "$next_nic" ]; then + # query "nicnetworks" table about its target "xcatnet" + xcatnet=$(query_nicnetworks_net $bondname) + log_info "Pickup xcatnet, \"$xcatnet\", from NICNETWORKS for interface \"$bondname\"." + + # Query mtu value from "networks" table + _mtu_num=$(get_network_attr $xcatnet mtu) + if [ -n "$_mtu_num" ]; then + _mtu="mtu $_mtu_num" + fi + + # Query mask value from "networks" table + _netmask=$(get_network_attr $xcatnet mask) + if [ $? -ne 0 ]; then + log_error "No valid netmask get for $bondname" + return 1 + fi + + # Calculate prefix based on mask + str_prefix=$(v4mask2prefix $_netmask) + + # Get first valid ip from nics.nicips + ipv4_addr=$(get_first_addr_ipv4 $_ipaddr) + if [ $? -ne 0 ]; then + log_warn "No valid IP address get for $bondname, please check $ipaddrs" + return 1 + fi + + fi + # check if all slave dev managed or not by nmcli + xcat_slave_ports=$(echo "$slave_ports" | $sed -e 's/,/ /g') + for ifslave in $xcat_slave_ports + do + check_and_set_device_managed $ifslave + if [ $? -ne 0 ]; then + return 1 + fi + + done + + # check if bond connection exist or not + xcat_con_name="xcat-bond-"$bondname + tmp_con_name="" + is_nmcli_connection_exist $xcat_con_name + if [ $? -eq 0 ]; then + is_connection_activate_intime $xcat_con_name 1 + if [ $? -eq 1 ]; then + $nmcli con down $xcat_con_name + $ip link set dev $bondname down + wait_for_ifstate $bondname DOWN 40 1 + fi + tmp_con_name="$xcat_con_name-tmp" + log_info "$xcat_con_name exists, rename old $xcat_con_name to $tmp_con_name" + $nmcli con modify $xcat_con_name connection.id $tmp_con_name autoconnect no + if [ $? -ne 0 ] ; then + log_error "$nmcli rename $xcat_con_name failed" + return 1 + fi + fi + + # create raw bond device + log_info "create bond connection $xcat_con_name" + cmd="" + if [ -n "$next_nic" ]; then + cmd="$nmcli con add type bond con-name $xcat_con_name ifname $bondname bond.options $_bonding_opts autoconnect yes connection.autoconnect-priority 9" + else + cmd="$nmcli con add type bond con-name $xcat_con_name ifname $bondname bond.options $_bonding_opts method none ipv4.method manual ipv4.addresses $ipv4_addr/$str_prefix $_mtu connection.autoconnect-priority 9" + fi + log_info $cmd + $cmd + if [ $? -ne 0 ]; then + log_error "nmcli failed to add bond connection $xcat_con_name" + if [ -n "$tmp_con_name" ] ; then + $nmcli con modify $tmp_con_name connection.id $xcat_con_name + fi + return 1 + fi + + # Create slaves connection + xcat_slave_con_names="" + tmp_slave_con_names="" + for ifslave in $xcat_slave_ports + do + tmp_slave_con_name="" + xcat_slave_con="xcat-bond-slave-"$ifslave + is_nmcli_connection_exist $xcat_slave_con + if [ $? -eq 0 ] ; then + is_connection_activate_intime $xcat_slave_con 1 + if [ $? -eq 1 ]; then + $nmcli con down $xcat_slave_con + ip link set dev $ifslave down + wait_for_ifstate $ifslave DOWN 40 1 + fi + tmp_slave_con_name=$xcat_slave_con"-tmp" + log_info "rename $xcat_slave_con to $tmp_slave_con_name" + $nmcli con modify $xcat_slave_con connection.id $tmp_slave_con_name autoconnect no + if [ -n "$tmp_slave_con_names" ]; then + tmp_slave_con_names="$tmp_slave_con_names $tmp_slave_con_name" + else + tmp_slave_con_names=$tmp_slave_con_name + fi + + fi + con_use_same_dev=$(nmcli dev show $ifslave|grep GENERAL.CONNECTION|awk -F: '{print $2}'|sed 's/^[ \t]*//g') + if [ "$con_use_same_dev" != "--" -a "$con_use_same_dev" != "$xcat_slave_con" ]; then + $nmcli con down "$con_use_same_dev" + $nmcli con mod "$con_use_same_dev" autoconnect no + $ip link set dev $ifslave down + wait_for_ifstate $ifslave DOWN 20 2 + fi + cmd="$nmcli con add type $slave_type con-name $xcat_slave_con $_mtu method none ifname $ifslave master $xcat_con_name autoconnect yes connection.autoconnect-priority 9" + log_info $cmd + $cmd + if [ $? -ne 0 ]; then + log_error "nmcli failed to add bond slave connection $xcat_slave_con" + if [ -n "$tmp_slave_con_name" ] ; then + $nmcli con modify $tmp_slave_con_name connection.id $xcat_slave_con + fi + rc=1 + break + else + if [ -n "$xcat_slave_con_names" ]; then + xcat_slave_con_names="$xcat_slave_con_names $xcat_slave_con" + else + xcat_slave_con_names=$xcat_slave_con + fi + fi + cmd="$nmcli con up $xcat_slave_con" + log_info $cmd + $cmd + is_connection_activate_intime $xcat_slave_con + is_active=$? + if [ "$is_active" -eq 0 ]; then + log_error "The bond slave connection $xcat_slave_con can not be booted up" + $nmcli con delete $xcat_slave_con + if [ -n "$tmp_slave_con_name" ]; then + $nmcli con modify $tmp_slave_con_name connection.id $xcat_slave_con + fi + rc=1 + break + fi + done + # bring up interface formally + if [ $rc -ne 1 ]; then + log_info "$nmcli con up $xcat_con_name" + $nmcli con up $xcat_con_name + if [ -z "$next_nic" ]; then + is_connection_activate_intime $xcat_con_name + is_active=$? + if [ "$is_active" -eq 0 ]; then + log_error "connection $xcat_con_name failed to activate" + rc=1 + else + wait_for_ifstate $bondname UP 20 10 + if [ $? -ne 0 ]; then + rc=1 + else + $ip address show dev $bondname| $sed -e 's/^/[bond] >> /g' | log_lines info + fi + fi + else + rc=0 + fi + fi + + if [ $rc -eq 1 ]; then + # delete all bond slave and master which is created by xCAT + if [ -n "$xcat_slave_con_names" ]; then + log_info "delete connection $xcat_slave_con_names" + delete_bond_slaves_con "$xcat_slave_con_names" + fi + if [ -n "$tmp_slave_con_names" ]; then + for tmpslave in $tmp_slave_con_names + do + slavecon=$(echo $tmpslave|sed 's/-tmp$//') + log_info "restore connection $slavecon" + $nmcli con modify $tmpslave connection.id $slavecon + done + fi + is_nmcli_connection_exist $xcat_con_name + if [ $? -eq 0 ] ; then + log_info "delete bond connection $xcat_con_name" + $nmcli con delete $xcat_con_name + fi + if [ -n "$tmp_con_name" ] ; then + log_info "restore bond connection $tmp_con_name" + $nmcli con modify $tmp_con_name connection.id $xcat_con_name + fi + else + # delete tmp master and tmp slaves + if [ -n "$tmp_con_name" ] ; then + $nmcli con delete $tmp_con_name + fi + if [ -n "$tmp_slave_con_names" ]; then + delete_bond_slaves_con "$tmp_slave_con_names" + fi + fi + return $rc +} +###################################################################### +# +# delete bond slaves connection +# imput format: ... ... +# +###################################################################### +function delete_bond_slaves_con { + slaves_con_names=$1 + if [ -z "$slaves_con_names" ]; then + log_error "bond slaves connection list is empty" + return + fi + for slave in $slaves_con_names + do + is_nmcli_connection_exist $slave + if [ $? -eq 0 ] ; then + $nmcli con delete $slave + fi + done +} diff --git a/xCAT/postscripts/ospkgs b/xCAT/postscripts/ospkgs index ea5e414e9..dfe18b891 100755 --- a/xCAT/postscripts/ospkgs +++ b/xCAT/postscripts/ospkgs @@ -402,6 +402,8 @@ do tmp=${x#@} #remove leading and trailing spaces tmp=`echo $tmp |sed 's/^ *//;s/ *$//'` + #remove the leading ^ + [ "^" = "${tmp:0:1}" ] && tmp="${tmp:1}" #if there are spaces in the middle of the name, quote it pos=`expr index "$tmp" "\ "` if [ $pos -gt 0 ]; then diff --git a/xCAT/postscripts/otherpkgs b/xCAT/postscripts/otherpkgs index abb4b3219..1161d1836 100755 --- a/xCAT/postscripts/otherpkgs +++ b/xCAT/postscripts/otherpkgs @@ -619,6 +619,36 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do repo_base="/etc/apt/sources.list.d" fi + + urlrepoindex=0 + #add repo for url repos in otherpkgdir + if [ -n "OTHERPKGDIR_INTERNET" ];then + OIFS=$IFS + IFS=',' + OTHERPKGDIRLIST_INTERNET=($OTHERPKGDIR_INTERNET) + + + for url in ${OTHERPKGDIRLIST_INTERNET[@]} + do + if [ $hasyum -eq 1 ] || [ $haszypper -eq 1 ] ; then + REPOFILE="$repo_base/xCAT-otherpkgs$urlrepoindex.repo" + echo "[xcat-otherpkgs$urlrepoindex]" > $REPOFILE + echo "name=xcat-otherpkgs$urlrepoindex" >> $REPOFILE + echo "baseurl=$url" >> $REPOFILE + echo "enabled=1" >> $REPOFILE + echo "gpgcheck=0" >> $REPOFILE + echo "skip_if_unavailable=True" >> $REPOFILE + + elif [ $hasapt -eq 1 ] ; then + REPOFILE="$repo_base/xCAT-otherpkgs${urlrepoindex}.list" + echo "deb "$url >> $REPOFILE + fi + urlrepoindex=$[urlrepoindex+1] + done + + IFS=$OIFS + fi + array_empty repo_path repo_pkgs="" repo_pkgs_preremove="" @@ -700,10 +730,11 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do #try to add the path to the repo if [ $try_repo -eq 1 ]; then index=$(array_get_size repo_path) + localrepoindex=$[urlrepoindex+index] if [ $hasyum -eq 1 ] || [ $haszypper -eq 1 ] ; then - REPOFILE="$repo_base/xCAT-otherpkgs$index.repo" - echo "[xcat-otherpkgs$index]" > $REPOFILE - echo "name=xcat-otherpkgs$index" >> $REPOFILE + REPOFILE="$repo_base/xCAT-otherpkgs$localrepoindex.repo" + echo "[xcat-otherpkgs$localrepoindex]" > $REPOFILE + echo "name=xcat-otherpkgs$localrepoindex" >> $REPOFILE if [ $mounted -eq 0 ]; then echo "baseurl=http://$whole_path" >> $REPOFILE else @@ -711,6 +742,7 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do fi echo "enabled=1" >> $REPOFILE echo "gpgcheck=0" >> $REPOFILE + echo "skip_if_unavailable=True" >> $REPOFILE if [ $hasyum -eq 1 ]; then yum clean all fi @@ -722,7 +754,7 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do fi fi elif [ $hasapt -eq 1 ] ; then - REPOFILE="$repo_base/xCAT-otherpkgs$index.list" + REPOFILE="$repo_base/xCAT-otherpkgs$localrepoindex.list" if [ -n "$OTHERPKGDIR" ];then if [ $mounted -eq 0 ]; then type=http @@ -731,16 +763,6 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do fi echo "deb $type://$whole_path ./" > $REPOFILE fi - if [ -n "$OTHERPKGDIR_INTERNET" ] && [ $index -eq 0 ] ;then - OLDIFS=$IFS - IFS=$',' - urlarray=($OTHERPKGDIR_INTERNET) - for url in ${urlarray[@]} - do - echo "deb "$url >> $REPOFILE - done - IFS=$OLDIFS - fi fi fi if [ $hasyum -eq 1 ]; then @@ -798,38 +820,6 @@ EOF` fi done - #add repo for url repos in otherpkgdir - if [ -n "OTHERPKGDIR_INTERNET" ];then - OIFS=$IFS - IFS=',' - OTHERPKGDIRLIST_INTERNET=($OTHERPKGDIR_INTERNET) - - index=$(array_get_size repo_path) - for url in ${OTHERPKGDIRLIST_INTERNET[@]} - do - if [ $hasyum -eq 1 ] || [ $haszypper -eq 1 ] ; then - REPOFILE="$repo_base/xCAT-otherpkgs$index.repo" - echo "[xcat-otherpkgs$index]" > $REPOFILE - echo "name=xcat-otherpkgs$index" >> $REPOFILE - echo "baseurl=$url" >> $REPOFILE - echo "enabled=1" >> $REPOFILE - echo "gpgcheck=0" >> $REPOFILE - index=$[index+1] - fi - done - - IFS=$OIFS - if [ $hasyum -eq 1 ]; then - yum clean all - fi - if [ $haszypper -eq 1 ]; then - result=`zypper --non-interactive refresh 2>&1` - if [ $VERBOSE ]; then - echo "otherpkgs: zypper --non-interactive refresh" - echo " $result" - fi - fi - fi if [ "$repoonly" -eq 1 ]; then echo "otherpkgs: "repoonly set, so ignore pkg installation ..."" diff --git a/xCAT/postscripts/remoteshell b/xCAT/postscripts/remoteshell index 0c266d9b6..986c9344b 100755 --- a/xCAT/postscripts/remoteshell +++ b/xCAT/postscripts/remoteshell @@ -156,7 +156,7 @@ if [ $? -ne 0 ]; then if ! grep "PRIVATE KEY" /etc/ssh/ssh_host_dsa_key > /dev/null 2>&1 ; then rm /etc/ssh/ssh_host_dsa_key else - ssh-keygen -y -f /etc/ssh/ssh_host_dsa_key > /etc/ssh/ssh_host_dsa_key.pub + ssh-keygen -y -f /etc/ssh/ssh_host_dsa_key -P "" > /etc/ssh/ssh_host_dsa_key.pub chmod 644 /etc/ssh/ssh_host_dsa_key.pub chown root /etc/ssh/ssh_host_dsa_key.pub fi @@ -222,7 +222,7 @@ if [ $? -ne 0 ]; then if ! grep "PRIVATE KEY" /etc/ssh/ssh_host_rsa_key > /dev/null 2>&1 ; then rm /etc/ssh/ssh_host_rsa_key else - ssh-keygen -y -f /etc/ssh/ssh_host_rsa_key > /etc/ssh/ssh_host_rsa_key.pub + ssh-keygen -y -f /etc/ssh/ssh_host_rsa_key -P "" > /etc/ssh/ssh_host_rsa_key.pub chmod 644 /etc/ssh/ssh_host_rsa_key.pub chown root /etc/ssh/ssh_host_rsa_key.pub fi @@ -298,7 +298,7 @@ if ssh-keygen -t ecdsa -f /tmp/ecdsa_key -P "" &>/dev/null ; then # If ture, means support ecdsa, then generate corresponding key.pub. # If false, remove ssh_host_ecdsa_key useless file, to avoid future errors. if ssh-keygen -t ecdsa -y -f /etc/ssh/ssh_host_ecdsa_key -P "" &>/dev/null ; then - ssh-keygen -y -f /etc/ssh/ssh_host_ecdsa_key > /etc/ssh/ssh_host_ecdsa_key.pub + ssh-keygen -y -f /etc/ssh/ssh_host_ecdsa_key -P "" > /etc/ssh/ssh_host_ecdsa_key.pub chmod 644 /etc/ssh/ssh_host_ecdsa_key.pub chown root /etc/ssh/ssh_host_ecdsa_key.pub else @@ -461,7 +461,7 @@ then # if public key does not exist then generate one from the private key if [ ! -f /root/.ssh/id_rsa.pub ]; then if [ -r /root/.ssh/id_rsa ]; then - ssh-keygen -y -f /root/.ssh/id_rsa > /root/.ssh/id_rsa.pub + ssh-keygen -y -f /root/.ssh/id_rsa -P "" > /root/.ssh/id_rsa.pub logger -t $log_label -p local4.err remoteshell:transfer of the id_rsa.pub key failed. Had to generate a public key. fi fi diff --git a/xCAT/postscripts/servicenode b/xCAT/postscripts/servicenode index 7dc208e97..9fd4b3a83 100755 --- a/xCAT/postscripts/servicenode +++ b/xCAT/postscripts/servicenode @@ -150,7 +150,7 @@ else $rc = &runcmd("$::XCATROOT/bin/lsxcatd -v 2>/dev/null || service xcatd restart"); if ($rc != 0) { $msg = " servicenode: Could not start xcat.\n\n $::outref \n"; - `logger -t $log_label -p local4.warning $msg`; + `logger -t $log_label -p local4.warning "$msg"`; } } } diff --git a/xCAT/postscripts/startsyncfiles.awk b/xCAT/postscripts/startsyncfiles.awk index 3219f1c53..c9af5345b 100755 --- a/xCAT/postscripts/startsyncfiles.awk +++ b/xCAT/postscripts/startsyncfiles.awk @@ -3,7 +3,7 @@ BEGIN { if (ENVIRON["USEOPENSSLFORXCAT"]) { server = "openssl s_client -no_ssl3 -connect " ENVIRON["XCATSERVER"] " -rand /bin/nice 2> /dev/null" if (!system("openssl s_client -help 2>&1 | grep -m 1 -q -- -no_ssl2")) { - server = "openssl s_client -no_ssl3 -no_ssl2 -connect " ENVIRON["XCATSERVER"] " 2> /dev/null" + server = "openssl s_client -no_ssl3 -no_ssl2 -connect " ENVIRON["XCATSERVER"] " -rand /bin/nice 2> /dev/null" } } else { server = "/inet/tcp/0/127.0.0.1/400" diff --git a/xCAT/postscripts/syslog b/xCAT/postscripts/syslog index d9b971a3b..845e49be2 100755 --- a/xCAT/postscripts/syslog +++ b/xCAT/postscripts/syslog @@ -231,7 +231,7 @@ config_rsyslog_V8() if [ -f "$conf_file" ]; then #rhels7.4 ships rsyslogd 8.24.0, which does not ship remote.conf #the relevant sections are included in rsyslog.conf - sed -i '/#\$ModLoad \+imudp\|imtcp\|imudp.so\|imtcp.so/s/^#//; + sed -i '/#\$ModLoad \+imudp\|#\$ModLoad \+imtcp\|imudp.so\|imtcp.so/s/^#//; /#\$InputTCPServerRun\|UDPServerRun.*/s/^#//' $conf_file #ubuntu16.04 ships rsyslog 8.16.0,which does not ship remote.conf diff --git a/xCAT/postscripts/xcatdsklspost b/xCAT/postscripts/xcatdsklspost index 38ac8ca6a..057f25ccf 100755 --- a/xCAT/postscripts/xcatdsklspost +++ b/xCAT/postscripts/xcatdsklspost @@ -83,26 +83,6 @@ echolog() } - - - -update_VPD() -{ - if [ -f /usr/sbin/vpdupdate ]; then - vpdupdate - #logger -t xCAT -p local4.info "xcatdsklspost: updating VPD database" - echolog "info" "updating VPD database" - fi -} - -# Run updatevpd only when necessary -if [ -f /usr/sbin/lsvpd ]; then - /usr/sbin/lsvpd | grep -i -E 'cpu|processor' 2>&1 1>/dev/null - if [ "$?" = "1" ]; then - update_VPD - fi -fi - download_postscripts() { server=$1 @@ -304,6 +284,28 @@ else 3|6) MODE=$1;; esac fi + +update_VPD() +{ + if [ -f /usr/sbin/vpdupdate ]; then + echolog "info" "updating VPD database" + vpdupdate + #logger -t xCAT -p local4.info "xcatdsklspost: updating VPD database" + else + echolog "warning" "/usr/sbin/vpdupdate is not available, please check and do VPD update later" + fi +} + +if [ $NODE_DEPLOYMENT -eq 1 ] || [ "$MODE" = "4" ] || [ "$MODE" = "6" ]; then + # Run updatevpd only when necessary + if [ -f /usr/sbin/lsvpd ]; then + /usr/sbin/lsvpd | grep -i -E 'cpu|processor' 2>&1 1>/dev/null + if [ "$?" = "1" ]; then + update_VPD + fi + fi +fi + if [ $NODE_DEPLOYMENT -ne 1 ] && [ $MODE -ne 4 ] ; then echolog "info" "=============updatenode starting====================" fi @@ -493,7 +495,6 @@ else # for common mode MODE=1,2,3,5 (updatenode,moncfg,node deployment) download_postscripts "${SIP}:${HTTPPORT}" if [ $? -eq 0 ]; then downloaded=1 - break fi fi fi diff --git a/xCAT/postscripts/xcatinstallpost b/xCAT/postscripts/xcatinstallpost index 235c241d8..50e71ae00 100755 --- a/xCAT/postscripts/xcatinstallpost +++ b/xCAT/postscripts/xcatinstallpost @@ -24,8 +24,8 @@ SLI=$(awk 'BEGIN{srand(); printf("%d\n",rand()*10)}') sleep $SLI XCATINFOFILE=/opt/xcat/xcatinfo -MACADDR=`grep MACADDRESS= /xcatpost/mypostscript.post |awk -F = '{print $2}'|sed s/\'//g` -INSTALLNIC=`ip -o link|grep -i $MACADDR|awk '{print $2}'|sed s/://` +MACADDR=`grep MACADDRESS= /xcatpost/mypostscript.post | awk -F = '{ print $2 }'| sed "s/\'//g"` +INSTALLNIC=`ip -o link | grep -i "$MACADDR" | awk '{ print $2 }' | sed "s/://"` # the network between the node and MASTER might be not well configured and activated when running the PBS sometimes diff --git a/xCAT/postscripts/xcatlib.sh b/xCAT/postscripts/xcatlib.sh index e1c688402..e7b059494 100755 --- a/xCAT/postscripts/xcatlib.sh +++ b/xCAT/postscripts/xcatlib.sh @@ -463,13 +463,10 @@ function stopservice { elif [ -n "$svcd" ];then cmd="service $svcd stop" fi - - echo $cmd - if [ -z "$cmd" ];then return 127 fi - + echo $cmd #for the linux distributions with systemd support #In the chrooted env, the system management commands(start/stop/restart) will be ignored and the return code is 0 #need to return the proper code in the chrooted scenario @@ -477,7 +474,6 @@ function stopservice { retmsg=`$cmd 2>&1` retval=$? [ "$retval" = "0" ] && (echo "$retmsg" | grep -i "Running in chroot,\s*ignoring request.*" >/dev/null 2>&1) && retval=1 - return $retval } diff --git a/xCAT/xCAT.spec b/xCAT/xCAT.spec index 476b42109..1a1308820 100644 --- a/xCAT/xCAT.spec +++ b/xCAT/xCAT.spec @@ -56,7 +56,7 @@ Requires: /usr/sbin/dhcpd # On RHEL this pulls in openssh-server, on SLES it pulls in openssh Requires: /usr/bin/ssh %if %nots390x -Requires: /etc/xinetd.d/tftp +Requires: /usr/sbin/in.tftpd Requires: xCAT-buildkit # Stty is only needed for rcons on ppc64 nodes, but for mixed clusters require it on both x and p Requires: perl-IO-Stty diff --git a/xCATsn/xCATsn.spec b/xCATsn/xCATsn.spec index f8c3531f2..102218b0e 100644 --- a/xCATsn/xCATsn.spec +++ b/xCATsn/xCATsn.spec @@ -40,7 +40,7 @@ Requires: /usr/sbin/dhcpd # On RHEL this pulls in openssh-server, on SLES it pulls in openssh Requires: /usr/bin/ssh %ifnarch s390x -Requires: /etc/xinetd.d/tftp +Requires: /usr/sbin/in.tftpd # Stty is only needed for rcons on ppc64 nodes, but for mixed clusters require it on both x and p Requires: perl-IO-Stty %endif @@ -81,9 +81,10 @@ Requires: syslinux-xcat %endif %description -xCATsn is a service node management package intended for at-scale management, -including hardware management and software management. - +xCAT supports management of very large sized cluster by creating a Hierarchical +Cluster and the concept of xCAT Service Nodes. The xCAT Management Node can +delegate all management operational needs to the Service Node responsible for a +set of compute node. xCATsn package provides xCAT service node support. %prep %ifos linux