diff --git a/.github/workflows/xcat_test.yml b/.github/workflows/xcat_test.yml new file mode 100644 index 000000000..4f432e5f6 --- /dev/null +++ b/.github/workflows/xcat_test.yml @@ -0,0 +1,9 @@ +name: xcat_test +on: [pull_request, workflow_dispatch] +jobs: + xcat_pr_test: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 + - run: sudo apt-get install -y fakeroot reprepro devscripts debhelper libcapture-tiny-perl libjson-perl libsoap-lite-perl libdbi-perl libcgi-pm-perl quilt openssh-server dpkg looptools genometools software-properties-common + - run: perl github_action_xcat_test.pl diff --git a/Version b/Version index 99e60c056..ffa5fee55 100644 --- a/Version +++ b/Version @@ -1 +1 @@ -2.16.4 +2.16.5 diff --git a/build-ubunturepo b/build-ubunturepo index 94afcaff9..dd30b3a9f 100755 --- a/build-ubunturepo +++ b/build-ubunturepo @@ -105,7 +105,7 @@ for package in ${packages[@]}; do done # Supported distributions -dists="saucy trusty utopic xenial bionic" +dists="saucy trusty utopic xenial bionic focal" c_flag= # xcat-core (trunk-delvel) path d_flag= # xcat-dep (trunk) path diff --git a/builddep.sh b/builddep.sh index acb4a8fc2..9ad4fa864 100755 --- a/builddep.sh +++ b/builddep.sh @@ -239,9 +239,22 @@ if ! $GREP -q '%_gpg_name' $MACROS 2>/dev/null; then echo '%_gpg_name xCAT Automatic Signing Key' >> $MACROS fi -# Sign the rpms that are not already signed. The "standard input reopened" warnings are normal. -echo "===> Signing RPMs..." -$XCATCOREDIR/build-utils/rpmsign.exp `find . -type f -name '*.rpm'` | grep -v -E '(already contains identical signature|was already signed|rpm --quiet --resign|WARNING: standard input reopened)' +# Sign the rpms that are not already signed. The "standard input reopened" warnings are normal. +# First, sign all non RH9 RPMS with DEFAULT algorithm, if running this script on RH7, most likely it will be SHA1 +echo "===> Signing RPMs with DEFAULT algorithm..." +$XCATCOREDIR/build-utils/rpmsign.exp `find . -type f -name '*.rpm' ! -path './rh9/*'` | grep -v -E '(already contains identical signature|was already signed|rpm --quiet --resign|WARNING: standard input reopened)' + +# Update $MACROS file so that RPMS will be signed with SHA256 algorithm +if ! $GREP -q '%_gpg_sign_cmd' $MACROS 2>/dev/null; then + echo '%__gpg_sign_cmd %{__gpg} gpg --force-v3-sigs --batch --verbose --no-armor --passphrase-fd 3 --no-secmem-warning -u "%{_gpg_name}" -sbo %{__signature_filename} --digest-algo sha256 %{__plaintext_filename}' >> $MACROS +fi + +# Second, sign all RH9 RPMS with SHA256 algorithm +echo "===> Signing RH9 RPMs with SHA265 algorithm..." +$XCATCOREDIR/build-utils/rpmsign.exp `find rh9 -type f -name '*.rpm'` | grep -v -E '(already contains identical signature|was already signed|rpm --quiet --resign|WARNING: standard input reopened)' + +# Remove SHA256 algorithm statement from $MACROS file, back to DEFAULT +sed -i '/__gpg_sign_cmd/d' $MACROS # Create the repodata dirs echo "===> Creating repodata directories..." diff --git a/docs/source/advanced/hierarchy/databases/mysql_remove.rst b/docs/source/advanced/hierarchy/databases/mysql_remove.rst index e8c71c951..1817e97fd 100644 --- a/docs/source/advanced/hierarchy/databases/mysql_remove.rst +++ b/docs/source/advanced/hierarchy/databases/mysql_remove.rst @@ -12,10 +12,10 @@ If you no longer want to use MySQL/MariaDB to maintain ``xcatdb``, and like to s XCATBYPASS=1 restorexCATdb -p ~/xcat-dbback -* Change to PostgreSQL, following documentation: :doc:`/advanced/hierarchy/databases/postgres_install` +* To switch to PostgreSQL, follow: :doc:`/advanced/hierarchy/databases/postgres_install` -* Change back to default xCAT database, SQLite (**Note**: xCAT Hierarchy cluster will no longer work) +* To switch to default xCAT database, SQLite (**Note**: xCAT Hierarchy cluster will no longer work): #. Stop the ``xcatd`` daemon on the management node. :: @@ -33,7 +33,7 @@ If you no longer want to use MySQL/MariaDB to maintain ``xcatdb``, and like to s mysql> drop user xcatadm; - #. Move, or remove, the ``/etc/xcat/cfglog`` file as it points xCAT to MySQL/MariaDB. (without this file, xCAT defaults to SQLite): :: + #. Move, or remove, the ``/etc/xcat/cfgloc`` file as it points xCAT to MySQL/MariaDB. (without this file, xCAT defaults to SQLite): :: rm /etc/xcat/cfgloc diff --git a/docs/source/advanced/hierarchy/databases/postgres_remove.rst b/docs/source/advanced/hierarchy/databases/postgres_remove.rst index ea91a7923..908beb46c 100644 --- a/docs/source/advanced/hierarchy/databases/postgres_remove.rst +++ b/docs/source/advanced/hierarchy/databases/postgres_remove.rst @@ -32,9 +32,9 @@ To remove ``xcatdb`` completely from the PostgreSQL database and restore xCAT da rm -rf * exit -#. Move, or remove, the ``/etc/xcat/cfglog`` file as it points xCAT to PostgreSQL. (without this file, xCAT defaults to SQLite): :: +#. Move, or remove, the ``/etc/xcat/cfgloc`` file as it points xCAT to PostgreSQL. (without this file, xCAT defaults to SQLite): :: - mv /etc/xcat/cfgloc /etc/xcat/cfglog.postgres + mv /etc/xcat/cfgloc /etc/xcat/cfgloc.postgres #. Restore the PostgreSQL database into SQLite: :: diff --git a/docs/source/advanced/security/ssl_config.rst b/docs/source/advanced/security/ssl_config.rst index 28ff05036..fe640e06c 100644 --- a/docs/source/advanced/security/ssl_config.rst +++ b/docs/source/advanced/security/ssl_config.rst @@ -1,17 +1,16 @@ OpenSSL Configuration ===================== -xCAT does not ship OpenSSL RPMS nor does it statically link to any OpenSSL libraries. Communication between the xCAT client and daemon utilizes OpenSSL and the administrator can configure SSL_version and SSL_cipher that should be used by xCAT daemons. +xCAT does not ship OpenSSL RPMS nor does it statically link to any OpenSSL libraries. Communication between the xCAT client and daemon utilizes OpenSSL and the administrator can configure the SSL_version and SSL_cipher that should be used by xCAT daemons. -The configuration is stored in the xCAT site table using the ``site.xcatsslversion`` and ``site.xcatsslciphers`` variables. +The configuration is stored in the xCAT site table using the ``site.xcatsslversion`` and ``site.xcatsslciphers`` attributes. Configuration ------------- -``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. +``site.xcatsslversion`` is the ``SSL_version`` option used by ``xcatd`` and passed to ``IO::Socket::SSL->start_SSL()``. See https://metacpan.org/pod/IO::Socket::SSL for more information. By default, xCAT ships with an empty value for ``site.xcatsslversion``. In this case, ``xcatd`` will use ``SSLv23:!SSLv2:!SSLv3:!TLSv1`` internally. -Here is an example of change ``site.xcatsslversoin`` to a different value. Say, TLS 1.2 is preferred. :: +Here is an example of changing ``site.xcatsslversion`` to a different value, ``TLSv1_2``, for example. :: chtab key=xcatsslversion site.value=TLSv1_2 @@ -23,8 +22,7 @@ After making any changes to these configuration values, ``xcatd`` must be restar service restart xcatd - -If any mistakes have been made and communication is lost to xCAT, use ``XCATBYPASS`` to fix/remove the bad configuration: :: +If any mistakes have been made and communication is lost to xCAT, use ``XCATBYPASS`` to fix the bad configuration: :: XCATBYPASS=1 tabedit site diff --git a/docs/source/conf.py b/docs/source/conf.py index c7a309a9b..be07c1aa7 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-2021, IBM Corporation' +copyright = u'2015-2022, 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.16.4' +release = '2.16.5' # 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/additionalpkg/nonubuntu_os_pkg.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/additionalpkg/nonubuntu_os_pkg.rst index 7380332a9..1968f5b7f 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/additionalpkg/nonubuntu_os_pkg.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/additionalpkg/nonubuntu_os_pkg.rst @@ -77,31 +77,33 @@ where **/install/post/custom//myotherlist** is another package list file Note: the trailing **"#"** character at the end of the line. It is important to specify this character for correct pkglist parsing. -Group/Pattern Names -''''''''''''''''''' +Module/Group/Pattern Names +'''''''''''''''''''''''''' -It is only supported for stateful deployment. +.. note:: On SLES pattern names are not supported for diskless deployment -In Linux, a groups of rpms can be packaged together into one package. It is called a group on RedHat, CentOS, Fedora and Scientific Linux. To get the list of available groups, run +On Linux, groups of rpms can be packaged together into one package. It can be a module or a group on RedHat, CentOS, Fedora and Scientific Linux. To get the list of available groups, run * **[RHEL]** :: - yum grouplist + yum group list + yum module list * **[SLES]** :: zypper se -t pattern -You can specify in this file the group/pattern names by adding a **'@'** and a space before the group/pattern names. For example: :: +You can specify module/group/pattern names by adding a **'@'** before the module/group/pattern names. For example: :: - @ base + @base + @Security Tools + @ruby:2.6 Remove RPMs After Installing '''''''''''''''''''''''''''' -It is only supported for stateful deployment. - -You can specify in this file that certain rpms to be removed after installing the new software. This is done by adding **'-'** before the rpm names you want to remove. For example: :: +You can specify that certain rpms to be removed after installing the new software. This is done by adding **'-'** before the rpm names you want to remove. For example: :: -ntp + -@ruby:2.6 diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/generate_img.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/generate_img.rst index ad459e7a5..2284dc84d 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/generate_img.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/generate_img.rst @@ -1,32 +1,31 @@ Generate Diskless Image ======================= -The ``copycds`` command copies the contents of the Linux media to ``/install//`` so that it will be available for installing nodes or creating diskless images. After executing ``copycds``, there are several ``osimage`` definitions created by default. Run ``tabdump osimage`` to view these images: :: +The ``copycds`` command copies the contents of the Linux media to ``/install//`` so that it will be available for installing nodes or creating diskless images. After executing ``copycds``, there are several ``osimage`` definitions created by default. Run ``lsdef -t osimage`` to view these images: :: - tabdump osimage + lsdef -t osimage The output should be similar to the following: :: - "rhels7.1-ppc64le-install-compute",,"compute","linux",,"install",,"rhels7.1-ppc64le",,,"Linux","rhels7.1","ppc64le",,,,,,,, - "rhels7.1-ppc64le-install-service",,"service","linux",,"install",,"rhels7.1-ppc64le",,,"Linux","rhels7.1","ppc64le",,,,,,,, - "rhels7.1-ppc64le-stateful-mgmtnode",,"compute","linux",,"install",,"rhels7.1-ppc64le",,,"Linux","rhels7.1","ppc64le",,,,,,,, - "rhels7.1-ppc64le-netboot-compute",,"compute","linux",,"netboot",,"rhels7.1-ppc64le",,,"Linux","rhels7.1","ppc64le",,,,,,,, + rhels8.5.0-ppc64le-install-compute (osimage) + rhels8.5.0-ppc64le-install-service (osimage) + rhels8.5.0-ppc64le-netboot-compute (osimage) -The ``netboot-compute`` is the default **diskless** osimage created rhels7.1 ppc64le. Run ``genimage`` to generate a diskless image based on the "rhels7.1-ppc64le-netboot-compute" definition: :: +The ``netboot-compute`` is the default **diskless** osimage created for rhels8.5 ppc64le. Run ``genimage`` to generate a diskless image based on the `rhels8.5.0-ppc64le-netboot-compute` definition: :: - genimage rhels7.1-ppc64le-netboot-compute + genimage rhels8.5.0-ppc64le-netboot-compute Before packing the diskless image, you have the opportunity to change any files in the image by changing to the ``rootimgdir`` and making modifications. (e.g. ``/install/netboot/rhels7.1/ppc64le/compute/rootimg``). -However it's recommended that all changes to the image are made via post install scripts so that it's easily repeatable. Although, instead, we recommend that you make all changes to the image via your postinstall script, so that it is repeatable. Refer to :doc:`/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/pre_post_script` for more details. +However it's recommended that all changes to the image are made via post install scripts so that it's easily repeatable. Refer to :doc:`/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/pre_post_script` for more details. Pack Diskless Image =================== -After you run ``genimage`` to create the image, you can go ahead to pack the image to create the ramdisk: :: +After running ``genimage`` to create the image, run ``packimage`` to create the ramdisk: :: - packimage rhels7.1-ppc64le-netboot-compute + packimage rhels8.5.0-ppc64le-netboot-compute Export and Import Image ======================= @@ -34,18 +33,17 @@ Export and Import Image Overview -------- -Note: There is a current restriction that exported 2.7 xCAT images cannot be imported on 2.8 xCAT ``_. This is no longer a restrictions, if you are running xCAT 2.8.3 or later. +.. note:: There is a current restriction that exported 2.7 xCAT images cannot be imported on 2.8 xCAT ``_. We want to create a system of making xCAT images more portable so that they can be shared and prevent people from reinventing the wheel. While every install is unique there are some things that can be shared among different sites to make images more portable. In addition, creating a method like this allows us to create snap shots of images we may find useful to revert to in different situations. -Image exporting and importing are supported for stateful (diskful) and stateless (diskless) clusters. The following documentation will show how to use :doc:`imgexport ` to export images and :doc:`imgimport ` to import images. +Image exporting and importing is supported for stateful (diskful) and stateless (diskless) clusters. The following documentation will show how to use :doc:`imgexport ` to export images and :doc:`imgimport ` to import images. Exporting an image ------------------ -1, The user has a working image and the image is defined in the osimage table and linuximage table. - example: :: +Working image:: lsdef -t osimage myimage Object name: myimage @@ -64,34 +62,28 @@ Exporting an image provmethod=netboot rootimgdir=/install/netboot/sles12/ppc64le/compute1 synclists=/install/custom/netboot/sles/compute1.list -2, The user runs the imgexport command. - example: :: + +Run the ``imgexport`` command:: imgexport myimage -p node1 -e /install/postscripts/myscript1 -e /install/postscripts/myscript2 - (-p and -e are optional) -A bundle file called myimage.tgz will be created under the current directory. The bundle file contains the ramdisk, boot kernel, the root image and all the configuration files for generating the image for a diskless cluster. For diskful, it contains the kickstart/autoyast configuration file. (see appendix). The -p flag puts the names of the postscripts for node1 into the image bundle. The -e flags put additional files into the bundle. In this case two postscripts myscript1 and myscript2 are included. +A bundle file called `myimage.tgz` will be created under the current directory. The bundle file contains the ramdisk, boot kernel, the root image and all the configuration files for generating the image for a diskless node. For diskful, it contains the kickstart/autoyast configuration file. (see appendix). The optional **-p** flag puts the names of the postscripts for node1 into the image bundle. The optional **-e** flags put additional files into the bundle. In this case two postscripts `myscript1` and `myscript2` are included. This image can now be used on other systems. Importing an image ------------------ -#. User downloads a image bundle file from somewhere. (Sumavi.com will be hosting many of these). -#. User runs the imgimport command. - - example: :: +#. Download the image bundle file generated by the ``imgexport``. +#. Run the ``imgimport`` command.:: imgimport myimage.tgz -p group1 - (-p is optional) -This command fills out the osimage and linuximage tables, and populates file directories with appropriate files from the image bundle file such as ramdisk, boot kernel, root image, configuration files for diskless. Any additional files that come with the bundle file will also be put into the appropriate directories. If -p flag is specified, the postscript names that come with the image will be put the into the postscripts table for the given node or group. +This command fills out the osimage and linuximage tables, and populates file directories with appropriate files from the image bundle file such as ramdisk, boot kernel, root image, configuration files for diskless. Any additional files that come with the bundle file will also be put into the appropriate directories. If optional **-p** flag is specified, the postscript names that come with the image will be put the into the postscripts table for the given node or group. Copy an image to a new image name on the MN ------------------------------------------- -Very often, the user wants to make a copy of an existing image on the same xCAT mn as a start point to make modifications. In this case, you can run imgexport first as described on chapter 2, then run imgimport with -f flag to change the profile name of the image. That way the image will be copied into a different directory on the same xCAT mn. - - example: :: +Very often, the user wants to make a copy of an existing image on the same xCAT MN as a start point to make modifications. In this case, you can run ``imgexport`` first as described above, then run imgimport with **-f** flag to change the profile name of the image. That way the image will be copied into a different directory on the same xCAT MN.:: imgimport myimage.tgz -p group1 -f compute2 @@ -100,37 +92,34 @@ Modify an image (optional) Skip this section if you want to use the image as is. -1, The use can modify the image to fit his/her own need. The following can be modified. +1. You can modify the image to fit your needs. The following can be modified. -* Modify .pkglist file to add or remove packages that are from the os distro + * ``.pkglist`` file to add or remove packages that are from the os distro -* Modify .otherpkgs.pkglist to add or remove packages from other sources. Refer to ``Using_Updatenode`` for details + * ``.otherpkgs.pkglist`` to add or remove packages from other sources. Refer to :doc:`Using updatenode ` for details -* For diskful, modify the .tmpl file to change the kickstart/autoyast configuration + * For diskful, ``.tmpl`` file to change the kickstart/autoyast configuration -* Modify .synclist file to change the files that are going to be synchronized to the nodes + * ``.synclist`` file to change the files that are going to be synchronized to the nodes -* Modify the postscripts table for the nodes to be deployed + * postscripts table for the nodes to be deployed -* Modify the osimage and/or linuximage tables for the location of the source rpms and the rootimage location + * the osimage and/or linuximage tables for the location of the source rpms and the rootimage location -2, Run genimage: :: +2. Run ``genimage``: :: genimage image_name -3, Run packimage: :: +3. Run ``packimage``: :: packimage image_name Deploying nodes --------------- -You can change the provmethod of the node to the new image_name if different: :: +You can now deploy the node with the new `` :: - chdef provmethod= - nodeset osimage= - -and the node is ready to deploy. + rinstall osimage= Appendix -------- @@ -144,7 +133,7 @@ You can only export/import one image at a time. Each tarball will have the follo manifest.xml ~~~~~~~~~~~~ -The manifest.xml will be analogous to an autoyast or windows unattend.xml file where it tells xCAT how to store the items. The following is an example for a diskless cluster: :: +The ``manifest.xml`` will be analogous to an autoyast or windows ``unattend.xml`` file where it tells xCAT how to store the items. The following is an example for a diskless cluster: :: manifest.xml: @@ -207,5 +196,5 @@ For diskless: :: x.exlist -Note: Although the postscripts names can be exported by using the -p flag. The postscripts themselves are not included in the bundle file by default. The use has to use -e flag to get them included one by one if needed. +.. note:: Although the postscripts names can be exported by using the **-p** flag, the postscripts themselves are not included in the bundle file by default. Use **-e** flag to get them included one by one if needed. diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/password.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/password.rst index 91f2b0f8b..5b907820e 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/password.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/configure/password.rst @@ -1,15 +1,16 @@ Configure passwords =================== -#. Configure the system password for the ``root`` user on the compute nodes. +#. Configure the system password for the ``root`` user on the compute nodes. This password can be provided in encrypted or clear text form using the :doc:`chtab ` command. + + * Clear text: :: - * Set using the :doc:`chtab ` command: :: chtab key=system passwd.username=root passwd.password=abc123 - To encrypt the password using ``openssl``, use the following command: :: + * Encrypted using ``openssl``: :: - chtab key=system passwd.username=root passwd.password=`openssl passwd -1 abc123` + chtab key=system passwd.username=root passwd.password=`openssl passwd -6 abc123` #. Configure the passwords for Management modules of the compute nodes. diff --git a/docs/source/guides/admin-guides/references/man1/mkvm.1.rst b/docs/source/guides/admin-guides/references/man1/mkvm.1.rst index 66884c9b1..0c72964c3 100644 --- a/docs/source/guides/admin-guides/references/man1/mkvm.1.rst +++ b/docs/source/guides/admin-guides/references/man1/mkvm.1.rst @@ -81,7 +81,7 @@ For PPC (with HMC) specific: ============================ -The first form of \ **mkvm**\ command creates new partition(s) with the same profile/resources as the partition specified by \ *singlenode*\ . The -i and \ *noderange*\ specify the starting numeric partition number and the \ *noderange*\ for the newly created partitions, respectively. The LHEA port numbers and the HCA index numbers will be automatically increased if they are defined in the source partition. +The first form of \ **mkvm**\ command creates new partition(s) with the same profile/resources as the partition specified by \ *singlenode*\ . The \ **-i**\ and \ *noderange*\ specify the starting numeric partition number and the \ *noderange*\ for the newly created partitions, respectively. The LHEA port numbers and the HCA index numbers will be automatically increased if they are defined in the source partition. The second form of this command duplicates all the partitions from the source specified by \ *profile*\ to the destination specified by \ *destcec*\ . The source and destination CECs can be managed by different HMCs. @@ -94,9 +94,9 @@ For PPC (using Direct FSP Management) specific: =============================================== -With option \ *full*\ , a partition using all the resources on a normal power machine will be created. +With option \ **-**\ **-full**\ , a partition using all the resources on a normal power machine will be created. -If no option is specified, a partition using the parameters specified with attributes such as 'vmcpus', 'vmmemory', 'vmphyslots', 'vmothersetting', 'vmnics', 'vmstorage' will be created. Those attributes can either be specified with '\*def' commands running before or be specified with this command. +If no option is specified, a partition using the parameters specified with attributes such as \ **vmcpus**\ , \ **vmmemory**\ , \ **vmphyslots**\ , \ **vmothersetting**\ , \ **vmnics**\ , \ **vmstorage**\ will be created. Those attributes can either be specified with '\*def' commands running before or be specified with this command. For KVM and VMware: @@ -148,9 +148,9 @@ OPTIONS \ **vmcpus=**\ \ *value*\ \ **vmmemory=**\ \ *value*\ \ **vmphyslots=**\ \ *value*\ \ **vmothersetting=**\ \ *value*\ \ **vmnics=**\ \ *value*\ \ **vmstorage=**\ \ *value*\ [\ **-**\ **-vios**\ ] - To specify the parameters which are used to create a partition. The \ *vmcpus*\ , \ *vmmemory*\ are necessary, and the value specified with this command have a more high priority. If the value of any of the three options is not specified, the corresponding value specified for the node object will be used. If any of the three attributes is neither specified with this command nor specified with the node object, error information will be returned. To reference to lsvm(1)|lsvm.1 for more information about 'drc_index' for \ *vmphyslots*\ . + To specify the parameters which are used to create a partition. The \ **vmcpus**\ , \ **vmmemory**\ are necessary, and the value specified with this command have a more high priority. If the value of any of the three options is not specified, the corresponding value specified for the node object will be used. If any of the three attributes is neither specified with this command nor specified with the node object, error information will be returned. To reference to lsvm(1)|lsvm.1 for more information about 'drc_index' for \ *vmphyslots*\ . - The option \ *vios*\ is used to specify the partition that will be created is a VIOS partition. If specified, the value for \ *vmstorage*\ shall be number which indicate the number of vSCSI server adapter will be created, and if no value specified for \ *vmphyslots*\ , all the physical slot of the power machine will be assigned to VIOS partition. If not specified, it shall be in form of \ *vios_name:server_slotid*\ to specify the vios and the virtual slot id of the vSCSI server adapter that will be connected from the Logical partition. + The option \ **vios**\ is used to specify the partition that will be created is a VIOS partition. If specified, the value for \ **vmstorage**\ shall be number which indicate the number of vSCSI server adapter will be created, and if no value specified for \ **vmphyslots**\ , all the physical slot of the power machine will be assigned to VIOS partition. If not specified, it shall be in form of \ **vios_name:server_slotid**\ to specify the vios and the virtual slot id of the vSCSI server adapter that will be connected from the Logical partition. diff --git a/docs/source/guides/admin-guides/references/man1/mysqlsetup.1.rst b/docs/source/guides/admin-guides/references/man1/mysqlsetup.1.rst index cd6566407..334fc4caf 100644 --- a/docs/source/guides/admin-guides/references/man1/mysqlsetup.1.rst +++ b/docs/source/guides/admin-guides/references/man1/mysqlsetup.1.rst @@ -37,11 +37,9 @@ DESCRIPTION *********** -\ **mysqlsetup**\ - Sets up the MySQL or MariaDB database (linux only for MariaDB) for xCAT to use. The mysqlsetup script is run on the Management Node as root after the MySQL code or MariaDB code has been installed. Before running the init option, the MySQL server should be stopped, if it is running. The xCAT daemon, xcatd, must be running, do not stop it. No xCAT commands should be run during the init process, because we will be migrating the xCAT database to MySQL or MariaDB and restarting the xcatd daemon as well as the MySQL daemon. For full information on all the steps that will be done, read the "Configure MySQL and Migrate xCAT Data to MySQL" sections in +\ **mysqlsetup**\ - Sets up the MySQL or MariaDB database (linux only for MariaDB) for xCAT to use. The \ **mysqlsetup**\ script is run on the Management Node as root after the MySQL or MariaDB packages have been installed. Before running the \ **-**\ **-init**\ option, the MySQL server should be stopped, if it is running. The xCAT daemon, \ **xcatd**\ , must be running, do not stop it. No xCAT commands should be run during the init process, because we will be migrating the xCAT database to MySQL or MariaDB and restarting the \ **xcatd**\ daemon as well as the MySQL daemon. For more information, see https://xcat-docs.readthedocs.io/en/stable/advanced/hierarchy/databases/index.html#mysql-mariadb -\ **Setting_Up_MySQL_as_the_xCAT_DB**\ - -Two passwords must be supplied for the setup, a password for the xcatadmin id and a password for the root id in the MySQL database. These will be prompted for interactively, unless the environment variables XCATMYSQLADMIN_PW and XCATMYSQLROOT_PW are set to the passwords for the xcatadmin id and root id in the database,resp. +Two passwords must be supplied for the setup, a password for the xcatadmin id and a password for the root id in the MySQL database. These will be prompted for interactively, unless the environment variables \ **XCATMYSQLADMIN_PW**\ and \ **XCATMYSQLROOT_PW**\ are set to the passwords for the xcatadmin id and root id in the database,respectively. Note below we refer to MySQL but it works the same for MariaDB. @@ -72,14 +70,14 @@ OPTIONS \ **-i|-**\ **-init**\ - The init option is used to setup a xCAT database on an installed MySQL or MariaDB server for xCAT to use. The mysqlsetup script will check for the installed MariaDB server rpm first and will use MariaDB if it is installed. This involves creating the xcatdb database, the xcatadmin id, allowing access to the xcatdb database by the Management Node. It customizes the my.cnf configuration file for xcat and starts the MySQL server. It also backs up the current xCAT database and restores it into the newly setup xcatdb MySQL database. It creates the /etc/xcat/cfgloc file to point the xcatd daemon to the MySQL database and restarts the xcatd daemon using the database. - On AIX, it additionally setup the mysql id and group and corrects the permissions in the MySQL install directories. For AIX, you should be using the MySQL rpms available from the xCAT website. For Linux, you should use the MySQL or MariaDB rpms shipped with the OS. You can chose the -f and/or the -o option, to run after the init. + The \ **-**\ **-init**\ option is used to setup a xCAT database on an installed MySQL or MariaDB server for xCAT to use. The \ **mysqlsetup**\ script will check for the installed MariaDB server rpm first and will use MariaDB if it is installed. This involves creating the xcatdb database, the xcatadmin id, allowing access to the xcatdb database by the Management Node. It customizes the \ **my.cnf**\ configuration file for xcat and starts the MySQL server. It also backs up the current xCAT database and restores it into the newly setup xcatdb MySQL database. It creates the \ **/etc/xcat/cfgloc**\ file to point the xcatd daemon to the MySQL database and restarts the xcatd daemon using the database. + On AIX, it additionally setup the mysql id and group and corrects the permissions in the MySQL install directories. For AIX, you should be using the MySQL rpms available from the xCAT website. For Linux, you should use the MySQL or MariaDB rpms shipped with the OS. You can chose the \ **-f**\ and/or the \ **-o**\ option, to run after the <-**\ **-init>. \ **-u|-**\ **-update**\ - To run the update option, you must first have run the -i option and have xcat successfully running on the MySQL database. You can chose the -f and/or the -o option, to update. + To run the update option, you must first have run the \ **-i**\ option and have xcat successfully running on the MySQL database. You can chose the \ **-f**\ and/or the \ **-o**\ option, to update. @@ -91,17 +89,13 @@ OPTIONS \ **-o|-**\ **-odbc**\ - This option sets up the ODBC /etc/../odbcinst.ini, /etc/../odbc.ini and the .odbc.ini file in roots home directory will be created and initialized to run off the xcatdb MySQL database. - See "Add ODBC Support" in - Setting_Up_MySQL_as_the_xCAT_DB + This option sets up the ODBC \ **/etc/../odbcinst.ini**\ , \ **/etc/../odbc.ini**\ and the \ **.odbc.ini**\ file in roots home directory will be created and initialized to run off the xcatdb MySQL database. \ **-L|-**\ **-LL**\ Additional database configuration specifically for the LoadLeveler product. - See "Add ODBC Support" in - Setting_Up_MySQL_as_the_xCAT_DB diff --git a/docs/source/guides/admin-guides/references/man1/rmvm.1.rst b/docs/source/guides/admin-guides/references/man1/rmvm.1.rst index 304d32dc0..f0ff04598 100644 --- a/docs/source/guides/admin-guides/references/man1/rmvm.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rmvm.1.rst @@ -47,7 +47,7 @@ DESCRIPTION The \ **rmvm**\ command removes the partitions specified in \ *noderange*\ . If \ *noderange*\ is an CEC, all the partitions associated with that CEC will be removed. Note that removed partitions are automatically removed from the xCAT database. For IVM-managed systems, care must be taken to not remove the VIOS partition, or all the associated partitions will be removed as well. -For DFM-managed (short For Direct FSP Management mode) normal power machines, only partitions can be removed. No options is needed. +For DFM-managed (short For Direct FSP Management mode) normal Power machines, only partitions can be removed. No options are needed. ******* @@ -55,23 +55,50 @@ OPTIONS ******* -\ **-h|-**\ **-help**\ Display usage message. -\ **-v|-**\ **-version**\ Command Version. +\ **-h|-**\ **-help**\ + + Display usage message. + -\ **-V|-**\ **-verbose**\ Verbose output. -\ **-r**\ Retain the data object definitions of the nodes. +\ **-v|-**\ **-version**\ + + Command Version. + + + +\ **-V|-**\ **-verbose**\ + + Verbose output. + + + +\ **-r**\ + + Retain the data object definitions of the nodes. + + + +\ **-**\ **-service**\ + + Remove the service partitions of the specified CECs. + -\ **-**\ **-service**\ Remove the service partitions of the specified CECs. \ **-p**\ + + KVM: Purge the existence of the VM from persistent storage. This will erase all storage related to the VM in addition to removing it from the active virtualization configuration. Storage devices of "raw" or "block" type are not removed. + + PPC: Remove the specified partition on normal Power machine. + -KVM: Purge the existence of the VM from persistent storage. This will erase all storage related to the VM in addition to removing it from the active virtualization configuration. Storage devices of "raw" or "block" type are not removed. -PPC: Remove the specified partition on normal power machine. +\ **-f**\ + + Force remove the VM, even if the VM appears to be online. This will bring down a live VM if requested. + -\ **-f**\ Force remove the VM, even if the VM appears to be online. This will bring down a live VM if requested. ************ @@ -172,7 +199,7 @@ Output is similar to: gpok4: Deleting virtual server LNX4... Done -6. To remove a DFM-managed partition on normal power machine: +6. To remove a DFM-managed partition on normal Power machine: .. code-block:: perl diff --git a/docs/source/guides/admin-guides/references/man1/rspconfig.1.rst b/docs/source/guides/admin-guides/references/man1/rspconfig.1.rst index 54a8f4a97..538e223ba 100644 --- a/docs/source/guides/admin-guides/references/man1/rspconfig.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rspconfig.1.rst @@ -777,9 +777,7 @@ EXAMPLES -4. - - To display the frame number for frame 9A00-10000001 +4. To display the frame number for frame 9A00-10000001 .. code-block:: perl diff --git a/docs/source/guides/admin-guides/references/man1/xcattest.1.rst b/docs/source/guides/admin-guides/references/man1/xcattest.1.rst index f24f6f324..6e3470595 100644 --- a/docs/source/guides/admin-guides/references/man1/xcattest.1.rst +++ b/docs/source/guides/admin-guides/references/man1/xcattest.1.rst @@ -128,15 +128,15 @@ The xCAT-test test cases are in flat text format, the testing framework will par #optional, description of the test case description: what the test case is for? #optional, environment requirements - os:AIX/Linux + os:AIX/Linux/sles/ubuntu/rhels/rhels7/rhels8 #optional, environment requirements - arch:ppc/x86 + arch:ppc/ppc64/ppc64le/x86_64 #optional, environment requirements - hcp:hmc/mm/bmc/fsp + hcp:hmc/mm/bmc/fsp/ipmi/openbmc #optional, label label:label1 #required, command need to run - cmd:comand + cmd:command #optional, check return code of last executed command check:rc == or != return code #optional, check output of last executed command @@ -155,7 +155,7 @@ EXAMPLES 1. - To run all test cases related command rpower: + To run all test cases related to command \ **rpower**\ : .. code-block:: perl @@ -167,7 +167,7 @@ EXAMPLES 2. - To run customized bundle with /tmp/config file: + To run customized bundle with \ */tmp/config*\ file: .. code-block:: perl @@ -181,7 +181,7 @@ EXAMPLES 3. - To run specified test cases with /tmp/config file: + To run specified test cases with \ */tmp/config*\ file: .. code-block:: perl @@ -193,7 +193,7 @@ EXAMPLES 4. - To add a new case to test \ **chvm**\ . In the example, we assume that the min_mem should not be equal to 16 in the lpar profile of computenode. The case name is chvm_custom. It create a test lpar named testnode firstly, that change the min_mem of the lpar to 16 using chvm, then check if min_mem have changed correctly. At last, the testnode be remove to ensure no garbage produced in the cases. + To add a new test case to test \ **chvm**\ . In this example, we assume that the \ **min_mem**\ should not be equal to 16 in the lpar profile of computenode. The case name is \ **chvm_custom**\ . It creates a test lpar named \ **testnode**\ first, then changes the \ **min_mem**\ of the lpar to 16 using \ **chvm**\ , then checks if \ **min_mem**\ have changed correctly. Finally, the \ **testnode**\ is removed. .. code-block:: perl diff --git a/docs/source/guides/admin-guides/references/man5/nodetype.5.rst b/docs/source/guides/admin-guides/references/man5/nodetype.5.rst index 7ccbf0198..311832594 100644 --- a/docs/source/guides/admin-guides/references/man5/nodetype.5.rst +++ b/docs/source/guides/admin-guides/references/man5/nodetype.5.rst @@ -44,7 +44,7 @@ nodetype Attributes: \ **os**\ - The operating system deployed on this node. Valid values: AIX, rhels\*,rhelc\*, rhas\*,centos\*,rocky\*,SL\*, fedora\*, sles\* (where \* is the version #). As a special case, if this is set to "boottarget", then it will use the initrd/kernel/parameters specified in the row in the boottarget table in which boottarget.bprofile equals nodetype.profile. + The operating system deployed on this node. Valid values: AIX, rhels\*,rhelc\*, rhas\*,centos\*, alma\*, rocky\*,SL\*, fedora\*, sles\* (where \* is the version #). As a special case, if this is set to "boottarget", then it will use the initrd/kernel/parameters specified in the row in the boottarget table in which boottarget.bprofile equals nodetype.profile. diff --git a/docs/source/guides/admin-guides/references/man5/osimage.5.rst b/docs/source/guides/admin-guides/references/man5/osimage.5.rst index 6dd405fa3..959007aa6 100644 --- a/docs/source/guides/admin-guides/references/man5/osimage.5.rst +++ b/docs/source/guides/admin-guides/references/man5/osimage.5.rst @@ -104,7 +104,7 @@ osimage Attributes: \ **osvers**\ - The Linux operating system deployed on this node. Valid values: rhels\*,rhelc\*, rhas\*,centos\*,rocky\*,SL\*, fedora\*, sles\* (where \* is the version #). + The Linux operating system deployed on this node. Valid values: rhels\*,rhelc\*, rhas\*,centos\*,alma\*, rocky\*,SL\*, fedora\*, sles\* (where \* is the version #). diff --git a/docs/source/guides/admin-guides/references/man5/passwd.5.rst b/docs/source/guides/admin-guides/references/man5/passwd.5.rst index 4123a9258..174745f02 100644 --- a/docs/source/guides/admin-guides/references/man5/passwd.5.rst +++ b/docs/source/guides/admin-guides/references/man5/passwd.5.rst @@ -50,7 +50,7 @@ passwd Attributes: \ **password**\ - The default password for this type of component. On Linux, a crypted form could be provided. Hashes starting with $1$, $5$ and $6$ (md5, sha256 and sha512 respectively) are supported. + The default password for this type of component. On Linux, a crypted form could be provided for the "system" component, which will be used during initial node provisioning. Hashes starting with $1$, $5$ and $6$ (md5, sha256 and sha512 respectively) are supported. diff --git a/docs/source/guides/admin-guides/references/man7/group.7.rst b/docs/source/guides/admin-guides/references/man7/group.7.rst index 5c5153289..c8f339e5a 100644 --- a/docs/source/guides/admin-guides/references/man7/group.7.rst +++ b/docs/source/guides/admin-guides/references/man7/group.7.rst @@ -733,7 +733,7 @@ group Attributes: \ **os**\ (nodetype.os) - The operating system deployed on this node. Valid values: AIX, rhels\*,rhelc\*, rhas\*,centos\*,rocky\*,SL\*, fedora\*, sles\* (where \* is the version #). As a special case, if this is set to "boottarget", then it will use the initrd/kernel/parameters specified in the row in the boottarget table in which boottarget.bprofile equals nodetype.profile. + The operating system deployed on this node. Valid values: AIX, rhels\*,rhelc\*, rhas\*,centos\*, alma\*, rocky\*,SL\*, fedora\*, sles\* (where \* is the version #). As a special case, if this is set to "boottarget", then it will use the initrd/kernel/parameters specified in the row in the boottarget table in which boottarget.bprofile equals nodetype.profile. diff --git a/docs/source/guides/admin-guides/references/man7/node.7.rst b/docs/source/guides/admin-guides/references/man7/node.7.rst index 3fe63eb87..48ca38dc1 100644 --- a/docs/source/guides/admin-guides/references/man7/node.7.rst +++ b/docs/source/guides/admin-guides/references/man7/node.7.rst @@ -739,7 +739,7 @@ node Attributes: \ **os**\ (nodetype.os) - The operating system deployed on this node. Valid values: AIX, rhels\*,rhelc\*, rhas\*,centos\*,rocky\*,SL\*, fedora\*, sles\* (where \* is the version #). As a special case, if this is set to "boottarget", then it will use the initrd/kernel/parameters specified in the row in the boottarget table in which boottarget.bprofile equals nodetype.profile. + The operating system deployed on this node. Valid values: AIX, rhels\*,rhelc\*, rhas\*,centos\*, alma\*, rocky\*,SL\*, fedora\*, sles\* (where \* is the version #). As a special case, if this is set to "boottarget", then it will use the initrd/kernel/parameters specified in the row in the boottarget table in which boottarget.bprofile equals nodetype.profile. diff --git a/docs/source/guides/admin-guides/references/man7/osimage.7.rst b/docs/source/guides/admin-guides/references/man7/osimage.7.rst index b3da0afc7..cf2767a56 100644 --- a/docs/source/guides/admin-guides/references/man7/osimage.7.rst +++ b/docs/source/guides/admin-guides/references/man7/osimage.7.rst @@ -249,7 +249,7 @@ osimage Attributes: \ **osvers**\ (osimage.osvers) - The Linux operating system deployed on this node. Valid values: rhels\*,rhelc\*, rhas\*,centos\*,rocky\*,SL\*, fedora\*, sles\* (where \* is the version #). + The Linux operating system deployed on this node. Valid values: rhels\*,rhelc\*, rhas\*,centos\*,alma\*, rocky\*,SL\*, fedora\*, sles\* (where \* is the version #). diff --git a/docs/source/guides/get-started/quick_start.rst b/docs/source/guides/get-started/quick_start.rst index d8b2b06da..b85d5c9e4 100644 --- a/docs/source/guides/get-started/quick_start.rst +++ b/docs/source/guides/get-started/quick_start.rst @@ -43,10 +43,10 @@ Prepare the Management Node ``xcatmn.mydomain.com`` 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 + /tmp/go-xcat --yes install source /etc/profile.d/xcat.sh -#. Configure the system password for the root user on the compute nodes: :: +#. Configure the system password for the ```root`` user on the compute nodes: :: chtab key=system passwd.username=root passwd.password=abc123 @@ -89,7 +89,7 @@ Stage 2 Provision a node and manage it with parallel shell 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: :: + After ``copycds``, the corresponding basic osimage will be generated automatically. Later, package list or postscripts for target compute nodes can be customised. List generated osimages: :: lsdef -t osimage diff --git a/docs/source/overview/_files/2.16.x.csv b/docs/source/overview/_files/2.16.x.csv index 2b4cdca16..caf0d24b6 100644 --- a/docs/source/overview/_files/2.16.x.csv +++ b/docs/source/overview/_files/2.16.x.csv @@ -1,5 +1,6 @@ Version,Release Date,New OS Supported,Release Notes -2.16.4,2022-06-07,"RHEL 8.5,SLES15.3",`2.16.4 Release Notes `_ +2.16.5,2023-03-08,"RHEL 8.6",`2.16.5 Release Notes `_ +2.16.4,2022-06-20,"RHEL 8.5,SLES15.3",`2.16.4 Release Notes `_ 2.16.3,2021-11-17,"RHEL 8.4",`2.16.3 Release Notes `_ 2.16.2,2021-05-25,"RHEL 8.3",`2.16.2 Release Notes `_ 2.16.1,2020-11-06,"RHEL 8.2",`2.16.1 Release Notes `_ diff --git a/github_action_xcat_test.pl b/github_action_xcat_test.pl new file mode 100644 index 000000000..e0b53e273 --- /dev/null +++ b/github_action_xcat_test.pl @@ -0,0 +1,605 @@ +# IBM(c) 2022 EPL license http://www.eclipse.org/legal/epl-v10.html + +use strict; +use warnings; +use Getopt::Long; +use Data::Dumper; +use Time::Local; +use File::Basename; +use File::Path; +use File::Find; +use LWP::UserAgent; +use HTTP::Request; +use Encode; +use Encode::CN; +use JSON; +use URI::Escape; +use LWP::Simple; +use Cwd; + +use Term::ANSIColor qw(:constants); +$Term::ANSIColor::AUTORESET = 1; + +#---Global attributes--- +my $rst = 0; +my $retries = 5; # Try this many times to get response +my $check_result_str="``CI CHECK RESULT`` : "; +my $last_func_start = timelocal(localtime()); +my $GITHUB_API = "https://api.github.com"; + +#-------------------------------------------------------- +# Fuction name: runcmd +# Description: run a command after 'cmd' label in one case +# Attributes: +# Return code: +# $::RUNCMD_RC : the return code of command +# @$outref : the output of command +#-------------------------------------------------------- +sub runcmd +{ + my ($cmd) = @_; + my $rc = 0; + $::RUNCMD_RC = 0; + my $outref = []; + @$outref = `$cmd 2>&1`; + if ($?) + { + $rc = $?; + $rc = $rc >> 8; + $::RUNCMD_RC = $rc; + } + chomp(@$outref); + return @$outref; + +} + +#-------------------------------------------------------- +# Fuction name: get_files_recursive +# Description: Search all file in one directory recursively +# Attributes: +# $dir (input attribute) +# The target scan directory +# $files_path_ref (output attribute) +# the reference of array where save all vaild files under $dir +# Return code: +#-------------------------------------------------------- +sub get_files_recursive +{ + my $dir = shift; + my $files_path_ref = shift; + + my $fd = undef; + if(!opendir($fd, $dir)){ + print "[get_files_recursive]: failed to open $dir :$!\n"; + return 1; + } + + for (; ;) + { + my $direntry = readdir($fd); + last unless (defined($direntry)); + next if ($direntry =~ m/^\.\w*/); + next if ($direntry eq '..'); + my $target = "$dir/$direntry"; + if (-d $target) { + get_files_recursive($target, $files_path_ref); + } else { + push(@{$files_path_ref}, glob("$target\n")); + } + } + closedir($fd); + return 0; +} + +#-------------------------------------------------------- +# Fuction name: check_pr_format +# Description: +# Attributes: +# Return code: +#-------------------------------------------------------- +sub check_pr_format{ + if($ENV{'TRAVIS_EVENT_TYPE'} eq "pull_request"){ + my $pr_url = "$GITHUB_API/repos/$ENV{'TRAVIS_REPO_SLUG'}/pulls/$ENV{'TRAVIS_PULL_REQUEST'}"; + my $pr_url_resp; + my $counter = 1; + while($counter <= $retries) { + $pr_url_resp = get($pr_url); + if ($pr_url_resp) { + last; # Got response, no more retries + } else { + sleep($counter*2); # Sleep and try again + print "[check_pr_format] $counter Did not get response, sleeping ". $counter*2 . "\n"; + $counter++; + } + } + unless ($pr_url_resp) { + print "[check_pr_format] After $retries retries, not able to get response from $pr_url \n"; + # Failed after trying a few times, return error + return $counter; + } + my $pr_content = decode_json($pr_url_resp); + my $pr_title = $pr_content->{title}; + my $pr_body = $pr_content->{body}; + my $pr_milestone = $pr_content->{milestone}; + my $pr_labels_len = @{$pr_content->{labels}}; + + #print "[check_pr_format] Dumper pr_content:\n"; + #print Dumper $pr_content; + print "[check_pr_format] pr title = $pr_title\n"; + print "[check_pr_format] pr body = $pr_body \n"; + + my $checkrst=""; + if(! $pr_title){ + $checkrst.="Missing title."; + } + if(! $pr_body){ + $checkrst.="Missing description."; + } + + if(! $pr_milestone){ + $checkrst.="Missing milestone."; + } + + if(! $pr_labels_len){ + $checkrst.="Missing labels."; + } + + # Guard against root user making commits + $checkrst.=check_commit_owner('root'); + + if(length($checkrst) == 0){ + $check_result_str .= "> **PR FORMAT CORRECT**"; + #send_back_comment("$check_result_str"); + }else{ + # Warning if missing milestone or labels, others are errors + if($checkrst =~ /milestone/ || $checkrst =~ /labels/){ + $check_result_str .= "> **PR FORMAT WARNING** : $checkrst"; + #send_back_comment("$check_result_str"); + }else{ + $check_result_str .= "> **PR FORMAT ERROR** : $checkrst"; + #send_back_comment("$check_result_str"); + return 1; + } + } + } + return 0; +} + +#-------------------------------------------------------- +# Fuction name: check_commit_owner +# Description: Verify commits are not done by specified user +# Attributes: user login to reject +# Return: +# Error string -User rejected, +# Empty string -User not rejected +#-------------------------------------------------------- +sub check_commit_owner{ + my $invalid_user = shift; + if($ENV{'TRAVIS_EVENT_TYPE'} eq "pull_request"){ + my $commits_content; + my $commits_len = 0; + my $json = new JSON; + my $commits_url = "$GITHUB_API/repos/$ENV{'TRAVIS_REPO_SLUG'}/pulls/$ENV{'TRAVIS_PULL_REQUEST'}/commits"; + my $commits_url_resp; + my $counter = 1; + while($counter <= $retries) { + $commits_url_resp = get($commits_url); + if ($commits_url_resp) { + last; # Got response, no more retries + } else { + sleep($counter*2); # Sleep and try again + print "[check_commit_owner] $counter Did not get response, sleeping ". $counter*2 . "\n"; + $counter++; + } + } + if ($commits_url_resp) { + $commits_content = $json->decode($commits_url_resp); + $commits_len = @$commits_content; + } else { + print "[check_commit_owner] After $retries retries, not able to get response from $commits_url \n"; + return "Unable to verify login of committer."; + } + + if($commits_len > 0) { + foreach my $commit (@{$commits_content}){ + my $committer = $commit->{committer}; + my $committer_login = $committer->{login}; + print "[check_commit_owner] Committer login $committer_login \n"; + if($committer_login =~ /^$invalid_user$/) { + # Committer logins matches + return "Commits by $invalid_user not allowed"; + } + } + } + } + return ""; +} +#-------------------------------------------------------- +# Fuction name: send_back_comment +# Description: Append to comment of the PR passed $message +# Attributes: Message to append to PR +# Return code: +#-------------------------------------------------------- +sub send_back_comment{ + my $message = shift; + + my $comment_url = "$GITHUB_API/repos/$ENV{'TRAVIS_REPO_SLUG'}/issues/$ENV{'TRAVIS_PULL_REQUEST'}/comments"; + my $json = new JSON; + my $comment_len = 0; + my $comment_content; + my $comment_url_resp; + my $counter = 1; + while($counter <= $retries) { + $comment_url_resp = get($comment_url); + if ($comment_url_resp) { + last; # Got response, no more retries + } else { + sleep($counter*2); # Sleep and try again + print "[send_back_comment] $counter Did not get response, sleeping ". $counter*2 . "\n"; + $counter++; + } + } + unless ($comment_url_resp) { + print "[send_back_comment] After $retries retries, not able to get response from $comment_url \n"; + # Failed after trying a few times, return + return; + } + print "\n\n>>>>>Dumper comment_url_resp:\n"; + print Dumper $comment_url_resp; + + $comment_content = $json->decode($comment_url_resp); + $comment_len = @$comment_content; + + my $post_url = $comment_url; + my $post_method = "POST"; + if($comment_len > 0){ + foreach my $comment (@{$comment_content}){ + if($comment->{'body'} =~ /CI CHECK RESULT/) { + $post_url = $comment->{'url'}; + $post_method = "PATCH"; + } + } + } + + print "[send_back_comment] method = $post_method to $post_url. Message = $message\n"; + if ( $ENV{'xcatbotuser'} and $ENV{'xcatbotpw'}) { + `curl -u "$ENV{'xcatbotuser'}:$ENV{'xcatbotpw'}" -X $post_method -d '{"body":"$message"}' $post_url`; + } + else { + print "Not able to update pull request with message: $message\n"; + } +} + +#-------------------------------------------------------- +# Fuction name: build_xcat_core +# Description: +# Attributes: +# Return code: +#-------------------------------------------------------- +sub build_xcat_core{ + my @output; + + my $cmd = "sudo ./build-ubunturepo -c UP=0 BUILDALL=1 GPGSIGN=0"; + @output = runcmd("$cmd"); + if($::RUNCMD_RC){ + my $lastline = $output[-1]; + $lastline =~ s/[\r\n\t\\"']*//g; + print "[build_xcat_core] $cmd ....[Failed]\n"; + $check_result_str .= "> **BUILD ERROR**, Please click ``Details`` label in ``Merge pull request`` box for detailed information"; + print $check_result_str; + return 1; + }else{ + print "[build_xcat_core] $cmd ....[Pass]\n"; + $check_result_str .= "> **BUILD SUCCESSFUL** "; + print $check_result_str; + } + + return 0; +} + +#-------------------------------------------------------- +# Fuction name: install_xcat +# Description: +# Attributes: +# Return code: +#-------------------------------------------------------- +sub install_xcat{ + + my @cmds = ("sudo ./mklocalrepo.sh", + "sudo chmod 777 /etc/apt/sources.list", + "sudo echo \"deb [arch=amd64 allow-insecure=yes] http://xcat.org/files/xcat/repos/apt/devel/xcat-dep bionic main\" >> /etc/apt/sources.list", + "sudo echo \"deb [arch=ppc64el allow-insecure=yes] http://xcat.org/files/xcat/repos/apt/devel/xcat-dep bionic main\" >> /etc/apt/sources.list", + "sudo wget -q -O - \"http://xcat.org/files/xcat/repos/apt/apt.key\" | sudo apt-key add -", + "sudo apt-get -qq --allow-insecure-repositories update"); + chdir $ENV{RUNNER_WORKSPACE};; + + my @output; + foreach my $cmd (@cmds){ + print "[install_xcat] running $cmd\n"; + @output = runcmd("$cmd"); + if($::RUNCMD_RC){ + print RED "[install_xcat] $cmd. ...[Failed]\n"; + print "[install_xcat] error message:\n"; + print Dumper \@output; + $check_result_str .= "> **INSTALL XCAT ERROR** : Please click ``Details`` label in ``Merge pull request`` box for detailed information "; + print $check_result_str; + return 1; + } + } + + my $cmd = "sudo apt-get install xcat --allow-remove-essential --allow-unauthenticated"; + @output = runcmd("$cmd"); + if($::RUNCMD_RC){ + my $lastline = $output[-1]; + $lastline =~ s/[\r\n\t\\"']*//g; + print "[install_xcat] $cmd ....[Failed]\n"; + print ">>>>>Dumper the output of '$cmd'\n"; + print Dumper \@output; + $check_result_str .= "> **INSTALL XCAT ERROR** : Please click ``Details`` label in ``Merge pull request`` box for detailed information"; + print $check_result_str; + return 1; + }else{ + print "[install_xcat] $cmd ....[Pass]\n"; + + print "\n------Config xcat and verify xcat is working correctly-----\n"; + @cmds = ("sudo -s /opt/xcat/share/xcat/scripts/setup-local-client.sh -f runner", + "sudo -s /opt/xcat/sbin/chtab priority=1.1 policy.name=runner policy.rule=allow", + ". /etc/profile.d/xcat.sh && tabdump policy", + ". /etc/profile.d/xcat.sh && tabdump site", + ". /etc/profile.d/xcat.sh && lsxcatd -a", + "ls /opt/xcat/sbin", + "service xcatd status"); + my $ret = 0; + foreach my $cmd (@cmds){ + print "\n[install_xcat] running $cmd.....\n"; + @output = runcmd("$cmd"); + print Dumper \@output; + if($::RUNCMD_RC){ + print RED "[install_xcat] $cmd. ...[Failed]\n"; + #print Dumper \@output; + $ret = 1; + }else{ + print "[install_xcat] $cmd....[Pass]\n"; + } + } + $cmd = "sudo apt-get install xcat-probe --allow-remove-essential --allow-unauthenticated"; + @output = runcmd("$cmd"); + if($::RUNCMD_RC){ + print RED "[install_xcat] $cmd ....[Failed]\n"; + print Dumper \@output; + $ret = 1; + }else{ + print "[install_xcat] $cmd ....[Pass]:\n"; + } + + if($ret){ + $check_result_str .= "> **INSTALL XCAT ERROR** : Please click ``Details`` label in ``Merge pull request`` box for detailed information\n"; + print $check_result_str; + return 1; + } + + $check_result_str .= "> **INSTALL XCAT SUCCESSFUL**"; + print $check_result_str; + } + return 0; +} + + +#-------------------------------------------------------- +# Fuction name: check_syntax +# Description: +# Attributes: +# Return code: +#-------------------------------------------------------- +sub check_syntax{ + my @output; + my @syntax_err; + my $ret = 0; + + my @target_dirs=("/opt/xcat", + "/install"); + foreach my $dir (@target_dirs){ + my @files = (); + get_files_recursive("$dir", \@files); + + foreach my $file (@files) { + next if($file =~ /\/opt\/xcat\/share\/xcat\/netboot\/genesis\//); + next if($file =~ /\/opt\/xcat\/probe\//); + + @output = runcmd("file $file"); + if($output[0] =~ /perl /i){ + @output = runcmd("sudo bash -c '. /etc/profile.d/xcat.sh && perl -I /opt/xcat/lib/perl -I /opt/xcat/lib -I /usr/lib/perl5 -I /usr/share/perl -c $file'"); + if($::RUNCMD_RC){ + push @syntax_err, @output; + $ret = 1; + } + } + } + } + + if(@syntax_err){ + print "[check_syntax] syntax checking ....[Failed]\n"; + print "[check_syntax] Dumper error message:\n"; + print Dumper @syntax_err; + $check_result_str .= "> **CODE SYNTAX ERROR** : Please click ``Details`` label in ``Merge pull request`` box for detailed information"; + print $check_result_str; + }else{ + print "[check_syntax] syntax checking ....[Pass]\n"; + $check_result_str .= "> **CODE SYNTAX CORRECT**"; + print $check_result_str; + } + + return $ret; +} + +#-------------------------------------------------------- +# Fuction name: run_fast_regression_test +# Description: +# Attributes: +# Return code: +#-------------------------------------------------------- +sub run_fast_regression_test{ + my $cmd = "sudo apt-get install xcat-test --allow-remove-essential --allow-unauthenticated"; + my @output = runcmd("$cmd"); + if($::RUNCMD_RC){ + print RED "[run_fast_regression_test] $cmd ....[Failed]\n"; + print Dumper \@output; + return 1; + }else{ + print "[run_fast_regression_test] $cmd .....:\n"; + print Dumper \@output; + } + + $cmd = "sudo bash -c '. /etc/profile.d/xcat.sh && xcattest -h'"; + @output = runcmd("$cmd"); + if($::RUNCMD_RC){ + print RED "[run_fast_regression_test] $cmd ....[Failed]\n"; + print "[run_fast_regression_test] error dumper:\n"; + print Dumper \@output; + return 1; + }else{ + print "[run_fast_regression_test] $cmd .....:\n"; + print Dumper \@output; + } + + my $hostname = `hostname`; + chomp($hostname); + print "hostname = $hostname\n"; + my $conf_file = "$ENV{'PWD'}/regression.conf"; + system "sudo touch $conf_file"; + system "sudo chmod 777 $conf_file"; + open(my $fh, '>', $conf_file) or die "Could not open test configuration file $!"; + print $fh "[System]\nMN=$hostname\n[Table_site]\nkey=domain\nvalue=pok.stglabs.ibm.com\n"; + close($fh); + + print "Dumper regression conf file:\n"; + @output = runcmd("cat $conf_file"); + print Dumper \@output; + + $cmd = "sudo bash -c '. /etc/profile.d/xcat.sh && xcattest -s \"ci_test\" -l'"; + my @caseslist = runcmd("$cmd"); + if($::RUNCMD_RC){ + print RED "[run_fast_regression_test] $cmd ....[Failed]\n"; + print "[run_fast_regression_test] error dumper:\n"; + print Dumper \@caseslist; + return 1; + }else{ + print "[run_fast_regression_test] $cmd .....:\n"; + print Dumper \@caseslist; + } + + my $casenum = @caseslist; + my $x = 0; + my @failcase; + my $passnum = 0; + my $failnum = 0; + foreach my $case (@caseslist){ + ++$x; + $cmd = "sudo bash -c '. /etc/profile.d/xcat.sh && xcattest -f $conf_file -t $case'"; + print "[run_fast_regression_test] run $x: $cmd\n"; + @output = runcmd("$cmd"); + #print Dumper \@output; + for(my $i = $#output; $i>-1; --$i){ + if($output[$i] =~ /------END::(.+)::Failed/){ + push @failcase, $1; + ++$failnum; + print Dumper \@output; + last; + }elsif ($output[$i] =~ /------END::(.+)::Passed/){ + ++$passnum; + last; + } + } + } + + if($failnum){ + my $log_str = join (",", @failcase ); + $check_result_str .= "> **FAST REGRESSION TEST Failed**: Totalcase $casenum Passed $passnum Failed $failnum FailedCases: $log_str. Please click ``Details`` label in ``Merge pull request`` box for detailed information\n"; + print $check_result_str; + return 1; + }else{ + $check_result_str .= "> **FAST REGRESSION TEST Successful**: Totalcase $casenum Passed $passnum Failed $failnum\n"; + print $check_result_str; + } + + return 0; +} + +#-------------------------------------------------------- +# Fuction name: mark_time +# Description: +# Attributes: +# Return code: +#-------------------------------------------------------- +sub mark_time{ + my $func_name=shift; + my $nowtime = timelocal(localtime()); + my $nowtime_str = scalar(localtime()); + my $duration = $nowtime - $last_func_start; + $last_func_start = $nowtime; + print "[mark_time] $nowtime_str, ElapsedTime of $func_name is $duration s\n"; +} + +#===============Main Process============================= + +my @os_info = runcmd("cat /etc/os-release"); +print "Current OS information:\n"; +print Dumper \@os_info; + +my @perl_vserion = runcmd("perl -v"); +print "Current perl information:\n"; +print Dumper \@perl_vserion; + +my @disk = runcmd("df -h"); +print "Disk information:\n"; +print Dumper \@disk; + +# Hacking the netmask. Not sure if we need to recover it after finish xcattest +# Note: Here has an assumption from Travis VM: only 1 UP Ethernet interface available (CHANGEME if it not as is) +my @intfinfo = runcmd("ip -o link |grep 'link/ether'|grep 'state UP' |awk -F ':' '{print \$2}'|head -1"); +foreach my $nic (@intfinfo) { + print "Hacking the netmask length to 16 if it is 32: $nic\n"; + runcmd("ip -4 addr show $nic|grep 'inet'|grep -q '/32' && sudo ip addr add \$(hostname -I|awk '{print \$1}')/16 dev $nic"); +} +my @ipinfo = runcmd("ip addr"); +print "Networking information:\n"; +print Dumper \@ipinfo; + +#Start to build xcat core + +print GREEN "\n------ Building xCAT core package ------\n"; +$rst = build_xcat_core(); +if($rst){ + print RED "Build of xCAT core package failed\n"; + exit $rst; +} +mark_time("build_xcat_core"); + +#Start to install xcat +print GREEN "\n------Installing xCAT ------\n"; +$rst = install_xcat(); +if($rst){ + print RED "Install of xCAT failed\n"; + exit $rst; +} +mark_time("install_xcat"); + +#Check the syntax of changing code +print GREEN "\n------ Checking the syntax of changed code------\n"; +$rst = check_syntax(); +if($rst){ + print RED "Check syntax of changed code failed\n"; + exit $rst; +} +mark_time("check_syntax"); + +#run fast regression +print GREEN "\n------Running fast regression test ------\n"; +$rst = run_fast_regression_test(); +if($rst){ + print RED "Run of fast regression test failed\n"; + exit $rst; +} +mark_time("run_fast_regression_test"); + +exit 0; diff --git a/perl-xCAT/xCAT/NodeRange.pm b/perl-xCAT/xCAT/NodeRange.pm index 46be7a395..e28bac035 100644 --- a/perl-xCAT/xCAT/NodeRange.pm +++ b/perl-xCAT/xCAT/NodeRange.pm @@ -4,7 +4,6 @@ use Text::Balanced qw/extract_bracketed/; require xCAT::Table; require Exporter; use strict; -use xCAT::MsgUtils; #Perl implementation of noderange our @ISA = qw(Exporter); @@ -294,9 +293,6 @@ sub expandatom { #my @grouplist = $grptab->getAllAttribs('groupname'); for my $row (@grplist) { if ($row->{groupname} eq $atom) { - my $rsp; - $rsp->{data}->[0] = "Could not create an object named \'$atom\' of type 'node'. A definition for a group object with the same name already exists."; - xCAT::MsgUtils->message("E", $rsp, $::callback); return (); } } diff --git a/perl-xCAT/xCAT/Schema.pm b/perl-xCAT/xCAT/Schema.pm index 2385e9f7c..9a46920d8 100755 --- a/perl-xCAT/xCAT/Schema.pm +++ b/perl-xCAT/xCAT/Schema.pm @@ -756,7 +756,7 @@ passed as argument rather than by table value', table_desc => 'A few hardware and software characteristics of the nodes.', descriptions => { node => 'The node name or group name.', - os => 'The operating system deployed on this node. Valid values: AIX, rhels*,rhelc*, rhas*,centos*,rocky*,SL*, fedora*, sles* (where * is the version #). As a special case, if this is set to "boottarget", then it will use the initrd/kernel/parameters specified in the row in the boottarget table in which boottarget.bprofile equals nodetype.profile.', + os => 'The operating system deployed on this node. Valid values: AIX, rhels*,rhelc*, rhas*,centos*, alma*, rocky*,SL*, fedora*, sles* (where * is the version #). As a special case, if this is set to "boottarget", then it will use the initrd/kernel/parameters specified in the row in the boottarget table in which boottarget.bprofile equals nodetype.profile.', arch => 'The hardware architecture of this node. Valid values: x86_64, ppc64, x86, ia64.', profile => 'The string to use to locate a kickstart or autoyast template to use for OS deployment of this node. If the provmethod attribute is set to an osimage name, that takes precedence, and profile need not be defined. Otherwise, the os, profile, and arch are used to search for the files in /install/custom first, and then in /opt/xcat/share/xcat.', provmethod => 'The provisioning method for node deployment. The valid values are install, netboot, statelite or an os image name from the osimage table. If an image name is specified, the osimage definition stored in the osimage table and the linuximage table (for Linux) or nimimage table (for AIX) are used to locate the files for templates, pkglists, syncfiles, etc. On Linux, if install, netboot or statelite is specified, the os, profile, and arch are used to search for the files in /install/custom first, and then in /opt/xcat/share/xcat.', @@ -799,7 +799,7 @@ passed as argument rather than by table value', cfmdir => 'CFM directory name for PCM. Set to /install/osimages//cfmdir by PCM. ', profile => 'The node usage category. For example compute, service.', osname => 'Operating system name- AIX or Linux.', - osvers => 'The Linux operating system deployed on this node. Valid values: rhels*,rhelc*, rhas*,centos*,rocky*,SL*, fedora*, sles* (where * is the version #).', + osvers => 'The Linux operating system deployed on this node. Valid values: rhels*,rhelc*, rhas*,centos*,alma*, rocky*,SL*, fedora*, sles* (where * is the version #).', osarch => 'The hardware architecture of this node. Valid values: x86_64, ppc64, x86, ia64.', synclists => 'The fully qualified name of a file containing a list of files to synchronize on the nodes. Can be a comma separated list of multiple synclist files. The synclist generated by PCM named /install/osimages//synclist.cfm is reserved for use only by PCM and should not be edited by the admin.', postscripts => 'Comma separated list of scripts that should be run on this image after diskful installation or diskless boot. For installation of RedHat, CentOS, Fedora, the scripts will be run before the reboot. For installation of SLES, the scripts will be run after the reboot but before the init.d process. For diskless deployment, the scripts will be run at the init.d time, and xCAT will automatically add the list of scripts from the postbootscripts attribute to run after postscripts list. For installation of AIX, the scripts will run after the reboot and acts the same as the postbootscripts attribute. For AIX, use the postbootscripts attribute. See the site table runbootscripts attribute.', @@ -884,7 +884,7 @@ passed as argument rather than by table value', descriptions => { key => 'The type of component this user/pw is for. Valid values: blade (management module), ipmi (BMC), system (nodes), omapi (DHCP), hmc, ivm, cec, frame, switch.', username => 'The default userid for this type of component', - password => 'The default password for this type of component. On Linux, a crypted form could be provided. Hashes starting with $1$, $5$ and $6$ (md5, sha256 and sha512 respectively) are supported.', + password => 'The default password for this type of component. On Linux, a crypted form could be provided for the "system" component, which will be used during initial node provisioning. Hashes starting with $1$, $5$ and $6$ (md5, sha256 and sha512 respectively) are supported.', cryptmethod => 'Indicates the method to use to encrypt the password attribute. On AIX systems, if a value is provided for this attribute it indicates that the password attribute is encrypted. If the cryptmethod value is not set it indicates the password is a simple string value. On Linux systems, the cryptmethod can be set to md5, sha256 or sha512. If not set, sha256 will be used as default to encrypt plain-text passwords.', authdomain => 'The domain in which this entry has meaning, e.g. specifying different domain administrators per active directory domain', comments => 'Any user-written notes.', diff --git a/perl-xCAT/xCAT/Utils.pm b/perl-xCAT/xCAT/Utils.pm index c1ecf0d8b..bb3827a16 100644 --- a/perl-xCAT/xCAT/Utils.pm +++ b/perl-xCAT/xCAT/Utils.pm @@ -2201,7 +2201,7 @@ sub CheckVersion my $index = 0; my $max_index = ($len_a > $len_b) ? $len_a : $len_b; - for ($index = 0 ; $index <= $max_index ; $index++) + for ($index = 0 ; $index < $max_index ; $index++) { my $val_a = ($len_a < $index) ? 0 : $a[$index]; my $val_b = ($len_b < $index) ? 0 : $b[$index]; @@ -3724,7 +3724,7 @@ sub filter_nostatusupdate { #filter out the nodes which support the node provision status feedback my @nodesfiltered = (); if (exists $inref->{$::STATUS_INSTALLING}) { - map { if ($nttabdata->{$_}->[0]->{os} !~ /(fedora|rh|centos|rocky|sles|ubuntu)/) { push @nodesfiltered, $_; } } @{ $inref->{$::STATUS_INSTALLING} }; + map { if ($nttabdata->{$_}->[0]->{os} !~ /(fedora|rh|centos|alma|rocky|sles|ubuntu)/) { push @nodesfiltered, $_; } } @{ $inref->{$::STATUS_INSTALLING} }; delete $inref->{$::STATUS_INSTALLING}; if (@nodesfiltered) { @{ $inref->{$::STATUS_INSTALLING} } = @nodesfiltered; @@ -3733,7 +3733,7 @@ sub filter_nostatusupdate { @nodesfiltered = (); if (exists $inref->{$::STATUS_NETBOOTING}) { - map { if ($nttabdata->{$_}->[0]->{os} !~ /(fedora|rh|centos|rocky|sles|ubuntu)/) { push @nodesfiltered, $_; } } @{ $inref->{$::STATUS_NETBOOTING} }; + map { if ($nttabdata->{$_}->[0]->{os} !~ /(fedora|rh|centos|alma|rocky|sles|ubuntu)/) { push @nodesfiltered, $_; } } @{ $inref->{$::STATUS_NETBOOTING} }; delete $inref->{$::STATUS_NETBOOTING}; if (@nodesfiltered) { @{ $inref->{$::STATUS_NETBOOTING} } = @nodesfiltered; diff --git a/perl-xCAT/xCAT/Zone.pm b/perl-xCAT/xCAT/Zone.pm index babb42281..620443a7c 100644 --- a/perl-xCAT/xCAT/Zone.pm +++ b/perl-xCAT/xCAT/Zone.pm @@ -270,12 +270,12 @@ sub getmyzonename =head3 enableSSHbetweennodes Arguments: - zonename + nodename Returns: 1 if the sshbetweennodes attribute is yes/1 or undefined 0 if the sshbetweennodes attribute is no/0 Example: - xCAT::Zone->enableSSHbetweennodes($zonename); + xCAT::Zone->enableSSHbetweennodes($nodename); =cut #-------------------------------------------------------------------------------- diff --git a/perl-xCAT/xCAT/data/discinfo.pm b/perl-xCAT/xCAT/data/discinfo.pm index 00a5cfc50..19ad579f1 100755 --- a/perl-xCAT/xCAT/data/discinfo.pm +++ b/perl-xCAT/xCAT/data/discinfo.pm @@ -14,6 +14,7 @@ require Exporter; use strict; our %distnames = ( + "1668116088.755845" => "rocky8.7", #x86_64 "1652648703.486923" => "rocky8.6", #x86_64 "1636882174.934804" => "rocky8.5", #x86_64 "1624205633.869423" => "rocky8.4", #x86_64 diff --git a/xCAT-client/bin/mysqlsetup b/xCAT-client/bin/mysqlsetup index 3d0cd6fcf..3c13badac 100755 --- a/xCAT-client/bin/mysqlsetup +++ b/xCAT-client/bin/mysqlsetup @@ -165,7 +165,7 @@ if ($::RUNCMD_RC == 0) { # check to see if mysql is installed # $cmd = "rpm -qa | grep -i perl-DBD-mysql"; -my $msg = "\nMySQL perl DBD "; +my $msg = "\nperl-DBD-mysql "; if ($::debianflag) { if ($::MariaDB) { $cmd = "dpkg -l | grep -i mariadb-server"; @@ -184,39 +184,41 @@ if ($::RUNCMD_RC != 0) exit(1); } -# check to see if MySQL is running +# check to see if MySQL or MariaDB is running $::mysqlrunning = 0; $::xcatrunningmysql = 0; -my $cmd = "ps -ef | grep mysqld"; -my @output = xCAT::Utils->runcmd($cmd, 0); -my $mysqlcheck = "mysql.sock"; # see if really running -if (grep(/$mysqlcheck/, @output)) -{ - if ($::INIT) - { - my $message = - "MySQL is running. Database initialization will not take place."; - xCAT::MsgUtils->message("I", "$message"); - } +my $cmd = "pidof mysqld"; +xCAT::Utils->runcmd($cmd, 0); +if ($::RUNCMD_RC == 0) { $::mysqlrunning = 1; + if ($::INIT) { + my $message = "MySQL is already running. Database initialization will not take place."; + xCAT::MsgUtils->message("I", "$message"); + my $ret = xCAT::Utils->stopservice("mysql"); + if ($ret != 0) { + xCAT::MsgUtils->message("E", " failed to stop MySQL."); + exit(1); + } else { + $::mysqlrunning = 0; # service was stopped + } + } } -# Stop mysql in order to setup init xcat mysql -$cmd = "pidof mysqld"; -xCAT::Utils->runcmd($cmd, -1); -if ($::RUNCMD_RC == 0) -{ - if ($::INIT) - { - my $ret = xCAT::Utils->stopservice("mysql"); - if ($ret != 0) - { - xCAT::MsgUtils->message("E", " failed to stop mysql/mariadb."); +$cmd = "pidof mariadbd"; +xCAT::Utils->runcmd($cmd, 0); +if ($::RUNCMD_RC == 0) { + $::mysqlrunning = 1; + if ($::INIT) { + my $message = "MariaDB is already running. Database initialization will not take place."; + xCAT::MsgUtils->message("I", "$message"); + my $ret = xCAT::Utils->stopservice("mariadb"); + if ($ret != 0) { + xCAT::MsgUtils->message("E", " failed to stop MariaDB."); exit(1); - } - } else { - $::mysqlrunning = 1; + } else { + $::mysqlrunning = 0; # service was stopped + } } } @@ -229,7 +231,7 @@ if (-e ("/etc/xcat/cfgloc")) # check to see if xcat is using mysql if ($::INIT) { my $message = -"The /etc/xcat/cfgloc file is already configured for MySQL and xCAT is using mysql as it's database. No xCAT setup is required."; +"The /etc/xcat/cfgloc file is already configured for MySQL and xCAT is using mysql or mariadb as it's database. No xCAT setup is required."; xCAT::MsgUtils->message("I", "$message"); } $::xcatrunningmysql = 1; @@ -436,6 +438,12 @@ if (($::INIT) && ($::xcatrunningmysql == 0)) } } # end initialization +else { + # MySQL not running, restart it + if ($::mysqlrunning == 0) { + &mysqlstart; + } +} if ($::SETUPODBC) { @@ -952,7 +960,7 @@ sub mysqlstart else { if ($::MariaDB == 1) { # running MariaDB - if ( ($::linuxos =~ /rh.*/) || ($::linuxos =~ /sles15.*/) ) { + if ( $::linuxos =~ /rh.*|ol.*|rocky.*|alma.*|sles15.*/) { $ret = xCAT::Utils->startservice("mariadb"); } else { # sles $ret = xCAT::Utils->startservice("mysql"); @@ -960,7 +968,7 @@ sub mysqlstart } else { # it is mysql - if ($::linuxos =~ /rh.*/) + if ($::linuxos =~ /rh.*|ol.*|rocky.*|alma.*/) { $ret = xCAT::Utils->startservice("mysqld"); } @@ -976,26 +984,25 @@ sub mysqlstart exit(1); } - # make sure running - $cmd = "ps -ef | grep mysqld | grep -v grep"; - my $i; - for ($i = 0 ; $i < 12 ; $i++) - { + # Make sure service has started. On some OSes, mariadb service starts mysql daemon + # on others, mariadb service starts mariadb daemon. Check a few times for one, + # then the other + my $mariadb_process_name = "mariadbd"; + my $mysql_process_name = "mysqld"; + my $db_process_name_pattern = "\'".$mariadb_process_name."\|".$mysql_process_name."\'"; + for (my $i = 0 ; $i < 6 ; $i++) { + $cmd = "ps -ef | grep -E $db_process_name_pattern | grep -v grep"; my @output = xCAT::Utils->runcmd($cmd, 0); - $mysqlcheck = "mysqld"; - if (grep(/$mysqlcheck/, @output)) - { + if (grep(/$mariadb_process_name/, @output) || grep(/$mysql_process_name/, @output)) { sleep 10; # give a few extra seconds to be sure return; - } - else - { + } else { sleep 10; # wait for daemon } } xCAT::MsgUtils->message("E", - " Could not start the mysql daemon, in time allocated (2 minutes)"); + " Could not start the mysql/mariadb daemon in time allocated (1 minute)"); exit(1); } @@ -1063,7 +1070,7 @@ sub mysqlreboot { if ($::MariaDB == 1) { # MariaDB not MySQL - if ( ($::linuxos =~ /rh.*/) || ($::linuxos =~ /sles15.*/) ){ + if ($::linuxos =~ /rh.*|ol.*|rocky.*|alma.*|sles15.*/) { $cmd = "chkconfig mariadb on"; } else { #sles $cmd = "chkconfig mysql on"; @@ -1073,7 +1080,7 @@ sub mysqlreboot } } else { # mysql - if ($::linuxos =~ /rh.*/) + if ($::linuxos =~ /rh.*|ol.*|rocky.*|alma.*/) { $cmd = "chkconfig mysqld on"; } @@ -1611,7 +1618,7 @@ sub setupODBC } # for aix and redhat - if (($::linuxos =~ /rh.*/) || ($::osname eq 'AIX')) + if (($::linuxos =~ /rh.*|ol.*|rocky.*|alma.*/) || ($::osname eq 'AIX')) { $cmd = "rpm -qa | grep mysql-connector-odbc"; xCAT::Utils->runcmd($cmd, 0); @@ -1699,7 +1706,7 @@ sub setupODBC (my $connstring, my $adminid, my $passwd) = split(/\|/, $output[0]); (my $database, my $id, my $server) = split(/=/, $connstring); - if (($::linuxos =~ /rh.*/) || ($::osname eq 'AIX')) + if (($::linuxos =~ /rh.*|ol.*|rocky.*|alma.*/) || ($::osname eq 'AIX')) { $odbcinstfile = "/etc/odbcinst.ini"; $odbcfile = "/etc/odbc.ini"; diff --git a/xCAT-client/bin/pgsqlsetup b/xCAT-client/bin/pgsqlsetup index f6cd6c126..f13ca21dc 100755 --- a/xCAT-client/bin/pgsqlsetup +++ b/xCAT-client/bin/pgsqlsetup @@ -318,7 +318,7 @@ if (($INIT) && ($xcatrunningpgsql == 0)) # if that does not exist use resolved hostname # double check site.master for resolution my $sitefile = "$::backupdir/site.csv"; - my $cmd = "grep \"master $sitefile"; + my $cmd = q{grep \"master } . $sitefile; my @output = xCAT::Utils->runcmd($cmd, -1); if ($::RUNCMD_RC == 0) # entry in site table { diff --git a/xCAT-client/pods/man1/mkvm.1.pod b/xCAT-client/pods/man1/mkvm.1.pod index 6c3d47cc8..59e3cb690 100644 --- a/xCAT-client/pods/man1/mkvm.1.pod +++ b/xCAT-client/pods/man1/mkvm.1.pod @@ -42,7 +42,7 @@ B I [I] [B I] =head2 For PPC (with HMC) specific: -The first form of B command creates new partition(s) with the same profile/resources as the partition specified by I. The -i and I specify the starting numeric partition number and the I for the newly created partitions, respectively. The LHEA port numbers and the HCA index numbers will be automatically increased if they are defined in the source partition. +The first form of B command creates new partition(s) with the same profile/resources as the partition specified by I. The B<-i> and I specify the starting numeric partition number and the I for the newly created partitions, respectively. The LHEA port numbers and the HCA index numbers will be automatically increased if they are defined in the source partition. The second form of this command duplicates all the partitions from the source specified by I to the destination specified by I. The source and destination CECs can be managed by different HMCs. @@ -52,9 +52,9 @@ Note that the B command currently only supports creating standard LPARs, n =head2 For PPC (using Direct FSP Management) specific: -With option I, a partition using all the resources on a normal power machine will be created. +With option B<--full>, a partition using all the resources on a normal power machine will be created. -If no option is specified, a partition using the parameters specified with attributes such as 'vmcpus', 'vmmemory', 'vmphyslots', 'vmothersetting', 'vmnics', 'vmstorage' will be created. Those attributes can either be specified with '*def' commands running before or be specified with this command. +If no option is specified, a partition using the parameters specified with attributes such as B, B, B, B, B, B will be created. Those attributes can either be specified with '*def' commands running before or be specified with this command. =head2 For KVM and VMware: @@ -88,9 +88,9 @@ Request to create a new full system partition for each CEC. =item B I B I B I B I B I B I [B<--vios>] -To specify the parameters which are used to create a partition. The I, I are necessary, and the value specified with this command have a more high priority. If the value of any of the three options is not specified, the corresponding value specified for the node object will be used. If any of the three attributes is neither specified with this command nor specified with the node object, error information will be returned. To reference to L for more information about 'drc_index' for I. +To specify the parameters which are used to create a partition. The B, B are necessary, and the value specified with this command have a more high priority. If the value of any of the three options is not specified, the corresponding value specified for the node object will be used. If any of the three attributes is neither specified with this command nor specified with the node object, error information will be returned. To reference to L for more information about 'drc_index' for I. -The option I is used to specify the partition that will be created is a VIOS partition. If specified, the value for I shall be number which indicate the number of vSCSI server adapter will be created, and if no value specified for I, all the physical slot of the power machine will be assigned to VIOS partition. If not specified, it shall be in form of I to specify the vios and the virtual slot id of the vSCSI server adapter that will be connected from the Logical partition. +The option B is used to specify the partition that will be created is a VIOS partition. If specified, the value for B shall be number which indicate the number of vSCSI server adapter will be created, and if no value specified for B, all the physical slot of the power machine will be assigned to VIOS partition. If not specified, it shall be in form of B to specify the vios and the virtual slot id of the vSCSI server adapter that will be connected from the Logical partition. =item B<-f|--force> diff --git a/xCAT-client/pods/man1/mysqlsetup.1.pod b/xCAT-client/pods/man1/mysqlsetup.1.pod index 021a972a9..b362c93ac 100644 --- a/xCAT-client/pods/man1/mysqlsetup.1.pod +++ b/xCAT-client/pods/man1/mysqlsetup.1.pod @@ -19,11 +19,9 @@ B {B<-L>|B<--LL>} [B<-V>|B<--verbose>] =head1 DESCRIPTION -B - Sets up the MySQL or MariaDB database (linux only for MariaDB) for xCAT to use. The mysqlsetup script is run on the Management Node as root after the MySQL code or MariaDB code has been installed. Before running the init option, the MySQL server should be stopped, if it is running. The xCAT daemon, xcatd, must be running, do not stop it. No xCAT commands should be run during the init process, because we will be migrating the xCAT database to MySQL or MariaDB and restarting the xcatd daemon as well as the MySQL daemon. For full information on all the steps that will be done, read the "Configure MySQL and Migrate xCAT Data to MySQL" sections in +B - Sets up the MySQL or MariaDB database (linux only for MariaDB) for xCAT to use. The B script is run on the Management Node as root after the MySQL or MariaDB packages have been installed. Before running the B<--init> option, the MySQL server should be stopped, if it is running. The xCAT daemon, B, must be running, do not stop it. No xCAT commands should be run during the init process, because we will be migrating the xCAT database to MySQL or MariaDB and restarting the B daemon as well as the MySQL daemon. For more information, see https://xcat-docs.readthedocs.io/en/stable/advanced/hierarchy/databases/index.html#mysql-mariadb -B - -Two passwords must be supplied for the setup, a password for the xcatadmin id and a password for the root id in the MySQL database. These will be prompted for interactively, unless the environment variables XCATMYSQLADMIN_PW and XCATMYSQLROOT_PW are set to the passwords for the xcatadmin id and root id in the database,resp. +Two passwords must be supplied for the setup, a password for the xcatadmin id and a password for the root id in the MySQL database. These will be prompted for interactively, unless the environment variables B and B are set to the passwords for the xcatadmin id and root id in the database,respectively. Note below we refer to MySQL but it works the same for MariaDB. @@ -45,12 +43,12 @@ Displays verbose messages. =item B<-i|--init> -The init option is used to setup a xCAT database on an installed MySQL or MariaDB server for xCAT to use. The mysqlsetup script will check for the installed MariaDB server rpm first and will use MariaDB if it is installed. This involves creating the xcatdb database, the xcatadmin id, allowing access to the xcatdb database by the Management Node. It customizes the my.cnf configuration file for xcat and starts the MySQL server. It also backs up the current xCAT database and restores it into the newly setup xcatdb MySQL database. It creates the /etc/xcat/cfgloc file to point the xcatd daemon to the MySQL database and restarts the xcatd daemon using the database. -On AIX, it additionally setup the mysql id and group and corrects the permissions in the MySQL install directories. For AIX, you should be using the MySQL rpms available from the xCAT website. For Linux, you should use the MySQL or MariaDB rpms shipped with the OS. You can chose the -f and/or the -o option, to run after the init. +The B<--init> option is used to setup a xCAT database on an installed MySQL or MariaDB server for xCAT to use. The B script will check for the installed MariaDB server rpm first and will use MariaDB if it is installed. This involves creating the xcatdb database, the xcatadmin id, allowing access to the xcatdb database by the Management Node. It customizes the B configuration file for xcat and starts the MySQL server. It also backs up the current xCAT database and restores it into the newly setup xcatdb MySQL database. It creates the B file to point the xcatd daemon to the MySQL database and restarts the xcatd daemon using the database. +On AIX, it additionally setup the mysql id and group and corrects the permissions in the MySQL install directories. For AIX, you should be using the MySQL rpms available from the xCAT website. For Linux, you should use the MySQL or MariaDB rpms shipped with the OS. You can chose the B<-f> and/or the B<-o> option, to run after the <--init>. =item B<-u|--update> -To run the update option, you must first have run the -i option and have xcat successfully running on the MySQL database. You can chose the -f and/or the -o option, to update. +To run the update option, you must first have run the B<-i> option and have xcat successfully running on the MySQL database. You can chose the B<-f> and/or the B<-o> option, to update. =item B<-f|--hostfile> @@ -58,15 +56,11 @@ This option runs during update, it will take all the host from the input file (p =item B<-o|--odbc> -This option sets up the ODBC /etc/../odbcinst.ini, /etc/../odbc.ini and the .odbc.ini file in roots home directory will be created and initialized to run off the xcatdb MySQL database. -See "Add ODBC Support" in -Setting_Up_MySQL_as_the_xCAT_DB +This option sets up the ODBC B, B and the B<.odbc.ini> file in roots home directory will be created and initialized to run off the xcatdb MySQL database. =item B<-L|--LL> Additional database configuration specifically for the LoadLeveler product. -See "Add ODBC Support" in -Setting_Up_MySQL_as_the_xCAT_DB =back diff --git a/xCAT-client/pods/man1/rmvm.1.pod b/xCAT-client/pods/man1/rmvm.1.pod index a649b5ac5..5b29d03e6 100644 --- a/xCAT-client/pods/man1/rmvm.1.pod +++ b/xCAT-client/pods/man1/rmvm.1.pod @@ -22,28 +22,43 @@ B I The B command removes the partitions specified in I. If I is an CEC, all the partitions associated with that CEC will be removed. Note that removed partitions are automatically removed from the xCAT database. For IVM-managed systems, care must be taken to not remove the VIOS partition, or all the associated partitions will be removed as well. -For DFM-managed (short For Direct FSP Management mode) normal power machines, only partitions can be removed. No options is needed. +For DFM-managed (short For Direct FSP Management mode) normal Power machines, only partitions can be removed. No options are needed. =head1 OPTIONS +=over 10 -B<-h|--help> Display usage message. +=item B<-h|--help> -B<-v|--version> Command Version. +Display usage message. -B<-V|--verbose> Verbose output. +=item B<-v|--version> -B<-r> Retain the data object definitions of the nodes. +Command Version. -B<--service> Remove the service partitions of the specified CECs. +=item B<-V|--verbose> -B<-p> +Verbose output. + +=item B<-r> + +Retain the data object definitions of the nodes. + +=item B<--service> + +Remove the service partitions of the specified CECs. + +=item B<-p> KVM: Purge the existence of the VM from persistent storage. This will erase all storage related to the VM in addition to removing it from the active virtualization configuration. Storage devices of "raw" or "block" type are not removed. -PPC: Remove the specified partition on normal power machine. +PPC: Remove the specified partition on normal Power machine. -B<-f> Force remove the VM, even if the VM appears to be online. This will bring down a live VM if requested. +=item B<-f> + +Force remove the VM, even if the VM appears to be online. This will bring down a live VM if requested. + +=back =head1 RETURN VALUE @@ -97,7 +112,7 @@ Output is similar to: gpok4: Deleting virtual server LNX4... Done -6. To remove a DFM-managed partition on normal power machine: +6. To remove a DFM-managed partition on normal Power machine: rmvm lpar1 diff --git a/xCAT-client/pods/man1/rspconfig.1.pod b/xCAT-client/pods/man1/rspconfig.1.pod index 67abfc794..f452dc2cc 100644 --- a/xCAT-client/pods/man1/rspconfig.1.pod +++ b/xCAT-client/pods/man1/rspconfig.1.pod @@ -572,7 +572,6 @@ Output is similar to: node4: BMC SNMP Destination 1: 9.114.47.227 =item 4. - To display the frame number for frame 9A00-10000001 rspconfig> 9A00-10000001 frame diff --git a/xCAT-client/xCAT-client.spec b/xCAT-client/xCAT-client.spec index cd64489bd..8ed907edf 100644 --- a/xCAT-client/xCAT-client.spec +++ b/xCAT-client/xCAT-client.spec @@ -29,6 +29,7 @@ Requires: cpio # fping or nmap is needed by pping (in case xCAT-client is installed by itself on a remote client) %ifos linux +BuildRequires: perl-generators Requires: nmap perl-XML-Simple perl-XML-Parser %else Requires: expat @@ -317,6 +318,11 @@ PATH=\$XCATROOT/bin:\$XCATROOT/sbin:\$XCATROOT/share/xcat/tools:\$PATH MANPATH=\$XCATROOT/share/man:\$MANPATH export XCATROOT PATH MANPATH export PERL_BADLANG=0 +# If /usr/local/share/perl5 is not already in @INC, add it to PERL5LIB +perl -e "print \"@INC\"" | egrep "(^|\W)/usr/local/share/perl5($| )" > /dev/null +if [ \$? = 1 ]; then + export PERL5LIB=/usr/local/share/perl5:\$PERL5LIB +fi EOF # export XCATSSLVER for sles11. Others OS can work without this setting. @@ -336,6 +342,11 @@ else setenv MANPATH \${XCATROOT}/share/man:\${MANPATH} endif setenv PERL_BADLANG 0 +# If /usr/local/share/perl5 is not already in @INC, add it to PERL5LIB +perl -e "print \"@INC\"" | egrep "(^|\W)/usr/local/share/perl5($| )" > /dev/null +if [ \$? = 1 ]; then + setenv PERL5LIB /usr/local/share/perl5:\${PERL5LIB} +fi EOF chmod 755 /etc/profile.d/xcat.* diff --git a/xCAT-client/xpod2man b/xCAT-client/xpod2man index 908804ba7..0096885a2 100755 --- a/xCAT-client/xpod2man +++ b/xCAT-client/xpod2man @@ -98,7 +98,7 @@ sub createDummyPods { mkdir "$poddir/man7"; foreach my $d (@dummyPods) { if (!open(TMP, ">>$d")) { warn "Could not create dummy pod file $d ($!)\n"; } - else { close TMP; } + else { print TMP "=head1 NAME"; close TMP; } } return @dummyPods; diff --git a/xCAT-genesis-builder/README.md b/xCAT-genesis-builder/README.md index b454cf9dd..8f593280a 100644 --- a/xCAT-genesis-builder/README.md +++ b/xCAT-genesis-builder/README.md @@ -48,8 +48,12 @@ do the following (assuming 2.16.10 is your xCAT version): ```sh cd xcat-core/xCAT-genesis-builder -sed -i 's/%%REPLACE_CURRENT_VERSION%%/2.16.10/g' xCAT-genesis-base.spec -buildrpm +``` + +If needed, update version number inside `xCAT-genesis-base.spec` + +``` +./buildrpm ``` If this command is successful, runs error free, it will generate a `xCAT-genesis-base` RPM that you can transfer diff --git a/xCAT-genesis-builder/xCAT-genesis-base.spec b/xCAT-genesis-builder/xCAT-genesis-base.spec index 831008d41..3bc288fb2 100644 --- a/xCAT-genesis-builder/xCAT-genesis-base.spec +++ b/xCAT-genesis-builder/xCAT-genesis-base.spec @@ -1,5 +1,5 @@ -%define version %%REPLACE_CURRENT_VERSION%% -Version: %{?version:%{version}}%{!?version:%(cat Version)} +%global version %(rpm -q xCAT --qf "%{VERSION}" 2>/dev/null | grep -Po '[0-9\.]+' || echo "2.16.5") +Version: %{version} Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")} %ifarch i386 i586 i686 x86 %define tarch x86 diff --git a/xCAT-genesis-scripts/usr/bin/bmcsetup b/xCAT-genesis-scripts/usr/bin/bmcsetup index b93a7663c..322c3bea1 100755 --- a/xCAT-genesis-scripts/usr/bin/bmcsetup +++ b/xCAT-genesis-scripts/usr/bin/bmcsetup @@ -1,3 +1,4 @@ +#!/bin/sh # IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html # Lenovo (c) 2016 # @@ -109,6 +110,11 @@ if ! ipmitool -V 2>/dev/null| grep "version"; then fi # Add ipmi_devintf module to allow the ipmitool operation in-band +if grep -q "^ppc64" <<< "$(uname -m)"; then + modprobe ipmi_powernv +else + modprobe ipmi_si +fi modprobe ipmi_devintf for parm in `cat /proc/cmdline`; do diff --git a/xCAT-openbmc-py/xCAT-openbmc-py.spec b/xCAT-openbmc-py/xCAT-openbmc-py.spec index 563b34a2a..a323b5d8a 100644 --- a/xCAT-openbmc-py/xCAT-openbmc-py.spec +++ b/xCAT-openbmc-py/xCAT-openbmc-py.spec @@ -12,6 +12,9 @@ Distribution: %{?_distribution:%{_distribution}}%{!?_distribution:%{_vendor}} Prefix: /opt/xcat BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root +# Disable shebang mangling of python scripts +%undefine __brp_mangle_shebangs + %ifnos linux AutoReqProv: no %endif diff --git a/xCAT-probe/subcmds/osdeploy b/xCAT-probe/subcmds/osdeploy index afe461baa..a34869a09 100755 --- a/xCAT-probe/subcmds/osdeploy +++ b/xCAT-probe/subcmds/osdeploy @@ -812,15 +812,28 @@ Start capturing every message during OS provision process.... my @hdls; my $starttime = time(); my @candidate_mn_hostname_in_log = $log_parse->obtain_candidate_mn_hostname_in_log(); + my $log_content_ref_last; - #read log realtimely, then handle each log + # Loop forever, reading each log file for (; ;) { if (@hdls = $select->can_read(0)) { foreach my $hdl (@hdls) { my $line = ""; chomp($line = <$hdl>); my $log_content_ref = $log_parse->obtain_log_content($fd_filetype_map{$hdl}, $line); - dispatch_log_to_handler($log_content_ref, \@candidate_mn_hostname_in_log, \%node_state); + if ($log_content_ref->{label} == $::LOGLABEL_XCAT) { + # If reading computes or cluster log files, try to eliminate duplicated lines + unless (($log_content_ref_last->{time_record} eq $log_content_ref->{time_record}) && + ($log_content_ref_last->{sender} eq $log_content_ref->{sender}) && + ($log_content_ref_last->{msg} eq $log_content_ref->{msg})) { + dispatch_log_to_handler($log_content_ref, \@candidate_mn_hostname_in_log, \%node_state); + } + # Save messages details for later duplicate detection + $log_content_ref_last = { %$log_content_ref }; + } + else { + dispatch_log_to_handler($log_content_ref, \@candidate_mn_hostname_in_log, \%node_state); + } } } diff --git a/xCAT-probe/xCAT-probe.spec b/xCAT-probe/xCAT-probe.spec index 847f8a4ab..108774e7d 100644 --- a/xCAT-probe/xCAT-probe.spec +++ b/xCAT-probe/xCAT-probe.spec @@ -13,6 +13,9 @@ Prefix: /opt/xcat BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root Requires: xCAT-client = 4:%{version}-%{release} +# Disable shebang mangling of python scripts +%undefine __brp_mangle_shebangs + %ifos linux BuildArch: noarch %endif diff --git a/xCAT-server/etc/init.d/xcatd.service b/xCAT-server/etc/init.d/xcatd.service index 0ec230f0b..6ebc244b2 100644 --- a/xCAT-server/etc/init.d/xcatd.service +++ b/xCAT-server/etc/init.d/xcatd.service @@ -5,7 +5,7 @@ After=network.target syslog.service [Service] EnvironmentFile=-/etc/sysconfig/xcat Type=forking -PIDFile=/var/run/xcatd.pid +PIDFile=/run/xcatd.pid ExecStart=/etc/init.d/xcatd start ExecStop=/etc/init.d/xcatd stop LimitNOFILE=16000 diff --git a/xCAT-server/lib/perl/xCAT/IPMI.pm b/xCAT-server/lib/perl/xCAT/IPMI.pm index 3fb50d582..2164e8aee 100644 --- a/xCAT-server/lib/perl/xCAT/IPMI.pm +++ b/xCAT-server/lib/perl/xCAT/IPMI.pm @@ -717,7 +717,7 @@ sub handle_ipmi_packet { my @payload = splice(@rsp, 12, $psize); if ($encrypted) { my $iv = pack("C*", splice @payload, 0, 16); - my $cipher = Crypt::CBC->new(-literal_key => 1, -key => $self->{aeskey}, -cipher => "Crypt::Rijndael", -header => "none", -iv => $iv, -keysize => 16, -blocksize => 16, -padding => \&cbc_pad); + my $cipher = Crypt::CBC->new(-literal_key => 1, -key => $self->{aeskey}, -cipher => "Crypt::Rijndael", -header => "none", -iv => $iv, -keysize => 16, -padding => \&cbc_pad); my $crypted = pack("C*", @payload); @payload = unpack("C*", $cipher->decrypt($crypted)); } diff --git a/xCAT-server/lib/perl/xCAT/Postage.pm b/xCAT-server/lib/perl/xCAT/Postage.pm index e3ab9a886..b7d44b9d3 100644 --- a/xCAT-server/lib/perl/xCAT/Postage.pm +++ b/xCAT-server/lib/perl/xCAT/Postage.pm @@ -1222,6 +1222,7 @@ sub getImageitems_for_node { if ($os =~ /rh.*/) { $platform = "rh"; } elsif ($os =~ /centos.*/) { $platform = "centos"; } + elsif ($os =~ /alma.*/) { $platform = "alma"; } elsif ($os =~ /rocky.*/) { $platform = "rocky"; } elsif ($os =~ /fedora.*/) { $platform = "fedora"; } elsif ($os =~ /SL.*/) { $platform = "SL"; } diff --git a/xCAT-server/lib/perl/xCAT/SvrUtils.pm b/xCAT-server/lib/perl/xCAT/SvrUtils.pm index 817eac405..40c17982f 100755 --- a/xCAT-server/lib/perl/xCAT/SvrUtils.pm +++ b/xCAT-server/lib/perl/xCAT/SvrUtils.pm @@ -401,6 +401,7 @@ sub getsynclistfile() if ($os) { if ($os =~ /rh.*/) { $platform = "rh"; } elsif ($os =~ /centos.*/) { $platform = "centos"; } + elsif ($os =~ /alma.*/) { $platform = "alma"; } elsif ($os =~ /rocky.*/) { $platform = "rocky"; } elsif ($os =~ /fedora.*/) { $platform = "fedora"; } elsif ($os =~ /sles.*/) { $platform = "sles"; } @@ -432,6 +433,7 @@ sub getsynclistfile() if ($os) { if ($os =~ /rh.*/) { $platform = "rh"; } elsif ($os =~ /centos.*/) { $platform = "centos"; } + elsif ($os =~ /alma.*/) { $platform = "alma"; } elsif ($os =~ /rocky.*/) { $platform = "rocky"; } elsif ($os =~ /fedora.*/) { $platform = "fedora"; } elsif ($os =~ /sles.*/) { $platform = "sles"; } @@ -691,6 +693,7 @@ sub update_tables_with_templates my $arch = shift; #like ppc64, x86, x86_64 my $ospkgdir = shift; my $osdistroname = shift; + my $legacyUB20 = shift; my %args = @_; my $osname = $osver;; #like sles, rh, centos, windows @@ -722,7 +725,7 @@ sub update_tables_with_templates # for Focal and later Ubuntu we repurpose genos to indicate the use # of the subiquity installer if ($osver =~ /ubuntu(\d+\.\d+)/) { - if ($1 >= 20.04) { + if (($1 >= 20.04) and ($legacyUB20 !~ /legacy/)) { $genos = "subiquity"; } } @@ -2172,6 +2175,10 @@ sub getplatform { { $platform = "centos"; } + elsif ($os =~ /alma.*/) + { + $platform = "alma"; + } elsif ($os =~ /rocky.*/) { $platform = "rocky"; diff --git a/xCAT-server/lib/perl/xCAT/Template.pm b/xCAT-server/lib/perl/xCAT/Template.pm index 9eb971ff5..27ae00094 100644 --- a/xCAT-server/lib/perl/xCAT/Template.pm +++ b/xCAT-server/lib/perl/xCAT/Template.pm @@ -301,7 +301,7 @@ sub subvars { my $space10 = " " x 10; my $space12 = " " x 12; foreach my $pkgdir (@pkgdirs) { - if ($platform =~ /^(rh|SL|centos|ol|fedora|rocky)$/) { + if ($platform =~ /^(rh|SL|centos|alma|ol|fedora|rocky)$/) { if ($c == 0) { # After some tests, if we put the repo in pre scripts in the kickstart like for rhels6.x # the rhels5.9 will not be installed successfully. So put in kickstart directly. diff --git a/xCAT-server/lib/xcat/plugins/AAsn.pm b/xCAT-server/lib/xcat/plugins/AAsn.pm index 511b81853..11744ca52 100755 --- a/xCAT-server/lib/xcat/plugins/AAsn.pm +++ b/xCAT-server/lib/xcat/plugins/AAsn.pm @@ -2,6 +2,12 @@ # IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html #------------------------------------------------------- package xCAT_plugin::AAsn; + +BEGIN +{ + $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat'; +} +use lib "$::XCATROOT/lib/perl"; use strict; use xCAT::Table; diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index 5c0d0507a..541cec729 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -41,10 +41,10 @@ sub handled_commands { return { copycd => "anaconda", - mknetboot => "nodetype:os=(^ol[0-9].*)|(centos.*)|(rocky.*)|(rh.*)|(fedora.*)|(SL.*)", - mkinstall => "nodetype:os=(pkvm.*)|(esxi4.1)|(esx[34].*)|(^ol[0-9].*)|(centos.*)|(rocky.*)|(rh(?!evh).*)|(fedora.*)|(SL.*)", - mksysclone => "nodetype:os=(esxi4.1)|(esx[34].*)|(^ol[0-9].*)|(centos.*)|(rocky.*)|(rh(?!evh).*)|(fedora.*)|(SL.*)", - mkstatelite => "nodetype:os=(esx[34].*)|(^ol[0-9].*)|(centos.*)|(rocky.*)|(rh.*)|(fedora.*)|(SL.*)", + mknetboot => "nodetype:os=(^ol[0-9].*)|(centos.*)|(alma.*)|(rocky.*)|(rh.*)|(fedora.*)|(SL.*)", + mkinstall => "nodetype:os=(pkvm.*)|(esxi4.1)|(esx[34].*)|(^ol[0-9].*)|(centos.*)|(alma.*)|(rocky.*)|(rh(?!evh).*)|(fedora.*)|(SL.*)", + mksysclone => "nodetype:os=(esxi4.1)|(esx[34].*)|(^ol[0-9].*)|(centos.*)|(alma.*)|(rocky.*)|(rh(?!evh).*)|(fedora.*)|(SL.*)", + mkstatelite => "nodetype:os=(esx[34].*)|(^ol[0-9].*)|(centos.*)|(alma.*)|(rocky.*)|(rh.*)|(fedora.*)|(SL.*)", }; } @@ -145,7 +145,7 @@ sub process_request sub using_dracut { my $os = shift; - if ($os =~ /(rhels|rhel|centos|rocky|ol)(\d+)/) { + if ($os =~ /(rhels|rhel|centos|alma|rocky|ol)(\d+)/) { if ($2 >= 6) { return 1; } @@ -762,7 +762,7 @@ sub mknetboot } # turn off the selinux - if ($osver =~ m/(fedora12|fedora13|rhels7|rhels8|ol7|ol8|rocky8)/) { + if ($osver =~ m/(fedora12|fedora13|rhels7|rhels8|ol7|ol8|alma8|rocky8)/) { $kcmdline .= " selinux=0 "; } @@ -2013,6 +2013,7 @@ sub copycd } if ($distname and $distname !~ /^centos/ + and $distname !~ /^alma/ and $distname !~ /^rocky/ and $distname !~ /^fedora/ and $distname !~ /^SL/ @@ -2070,6 +2071,8 @@ sub copycd $distname = "centos-stream" . $1; } elsif ($desc and $desc =~ /Rocky Linux (.*)/) { $distname = "rocky" . $1; + } elsif ($desc and $desc =~ /AlmaLinux (.*)/) { + $distname = "alma" . $1; } unless ($dno) { @@ -2156,7 +2159,11 @@ sub copycd } elsif ($_ =~ /family\s*=\s*Rocky/i) { $distname = "rocky" . $desc; last; + } elsif ($_ =~ /family\s*=\s*Alma/i) { + $distname = "alma" . $desc; + last; } + } close($dinfo); } @@ -2407,6 +2414,10 @@ sub getplatform { { $platform = "centos"; } + elsif ($os =~ /alma.*/) + { + $platform = "alma"; + } elsif ($os =~ /rocky.*/) { $platform = "rocky"; diff --git a/xCAT-server/lib/xcat/plugins/credentials.pm b/xCAT-server/lib/xcat/plugins/credentials.pm index 0e9a2b0e7..52e5a6c7a 100644 --- a/xCAT-server/lib/xcat/plugins/credentials.pm +++ b/xCAT-server/lib/xcat/plugins/credentials.pm @@ -133,18 +133,34 @@ sub process_request my $sshrootkeydir = "$root/.ssh"; # old default if ((($parm =~ /^ssh_root_key/) || ($parm =~ /^ssh_root_pub_key/)) && ($foundkeys == 0)) { my ($rootkeyparm, $zonename) = split(/:/, $parm); + my $client_zonename = xCAT::Zone->getmyzonename($client); + my $default_zonename = xCAT::Zone->getdefaultzone(); + if ($zonename) { $parm = $rootkeyparm; # take the zone off xCAT::MsgUtils->trace(0, 'I', "credentials: The node ($client) is asking for sshkeys of zone: $zonename."); - $sshrootkeydir = xCAT::Zone->getzonekeydir($zonename); - if ($sshrootkeydir == 1) { # error return - xCAT::MsgUtils->trace(0, 'W', "credentials: The zone: $zonename is not defined."); + if ($client_zonename eq $zonename) { + my $sshbetweenodes_allowed = xCAT::Zone->enableSSHbetweennodes($client); + if (($sshbetweenodes_allowed == 1) || ($parm =~ /^ssh_root_pub_key/)) { # check if sshbetweennodes is allowed or pub key is requested + $sshrootkeydir = xCAT::Zone->getzonekeydir($zonename); + if ($sshrootkeydir == 1) { # error return + xCAT::MsgUtils->trace(0, 'W', "credentials: The zone: $zonename is not defined."); + } else { + $foundkeys = 1; # don't want to read the zone data twice + } + } else { + xCAT::MsgUtils->trace(0, 'E', "credentials: Not allowed to read root's private ssh key because sshbetweennodes is disabled."); + $sshrootkeydir = 1; + } } else { - $foundkeys = 1; # don't want to read the zone data twice + xCAT::MsgUtils->trace(0, 'E', "credentials: Not allowed to read root's private ssh key of different zone."); + $sshrootkeydir = 1; } + } elsif ($client_zonename ne $default_zonename) { # check if no zonename is submitted but node is not in default zone + xCAT::MsgUtils->trace(0, 'E', "credentials: Not allowed to read root's private ssh key of default zone."); + $sshrootkeydir = 1; } } - if ($parm =~ /ssh_root_key/) { unless (-r "$sshrootkeydir/id_rsa") { push @{ $rsp->{'error'} }, "Unable to read root's private ssh key"; diff --git a/xCAT-server/lib/xcat/plugins/ddns.pm b/xCAT-server/lib/xcat/plugins/ddns.pm index 712375e24..ab0414d88 100644 --- a/xCAT-server/lib/xcat/plugins/ddns.pm +++ b/xCAT-server/lib/xcat/plugins/ddns.pm @@ -1282,10 +1282,10 @@ sub update_namedconf { push @newnamed, "\t\t$_;\n"; } push @newnamed, "\t};\n"; - my $bind_version_cmd="/usr/sbin/named -v | cut -d' ' -f2"; + my $bind_version_cmd="/usr/sbin/named -v | cut -d' ' -f2 | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+'"; my @bind_version =xCAT::Utils->runcmd($bind_version_cmd, 0); # Turn off DNSSEC if running with bind vers 9.16.6 or higher - if ((scalar @bind_version > 0) && ($bind_version[0] ge "9.16.6")) { + if ((scalar @bind_version > 0) && (xCAT::Utils::CheckVersion($bind_version[0], "9.16.6") >= 0)) { push @newnamed, "\tdnssec-enable no;\n"; push @newnamed, "\tdnssec-validation no;\n"; } diff --git a/xCAT-server/lib/xcat/plugins/debian.pm b/xCAT-server/lib/xcat/plugins/debian.pm index 02b93ff1d..80b307961 100644 --- a/xCAT-server/lib/xcat/plugins/debian.pm +++ b/xCAT-server/lib/xcat/plugins/debian.pm @@ -168,8 +168,9 @@ sub using_dracut sub using_subiquity { my $os = shift; + my $tmplfile = shift; if ($os =~ /ubuntu(\d+\.\d+)/) { - if ($1 >= 20.04) { + if (($1 >= 20.04) and ($tmplfile =~ /subiquity/)) { return 1; } } @@ -258,6 +259,7 @@ sub copycd close($dinfo); my $isnetinst = 0; + my $legacyUB20 = ""; # Is this a Ubuntu20.04.1 legacy ISO my $prod = $line2[0]; # The product should be the first word my $ver = $line2[1]; # The version should be the second word my $darch = $line2[6]; # The architecture should be the seventh word @@ -339,11 +341,16 @@ sub copycd return; } } + if ((-r $path . "/install/vmlinuz") and ($distname =~ /ubuntu20.04/)) + { + # Presence of /install/vmlinuz file on Ubuntu20.04 iso indicates + # a legacy (non subiquity installer) image + $legacyUB20 = "(legacy)"; + } if ($inspection) { $callback->( { - info => -"DISTNAME:$distname\n" . "ARCH:$debarch\n" . "DISCNO:$discno\n" + info => "DISTNAME:$distname" . "$legacyUB20" ." \n" . "ARCH:$debarch\n" . "DISCNO:$discno\n" } ); return; @@ -440,7 +447,7 @@ sub copycd $callback->({ data => "Media copy operation successful" }); unless ($noosimage) { - my @ret = xCAT::SvrUtils->update_tables_with_templates($distname, $arch, $temppath, $osdistroname); + my @ret = xCAT::SvrUtils->update_tables_with_templates($distname, $arch, $temppath, $osdistroname, $legacyUB20); if ($ret[0] != 0) { $callback->({ data => "Error when updating the osimage tables: " . $ret[1] }); } @@ -580,7 +587,7 @@ sub mkinstall { my $pltfrm = getplatform($ref->{'osvers'}); my $tmplfile = xCAT::SvrUtils::get_tmpl_file_name("$installroot/custom/install/$pltfrm", $ref->{'profile'}, $ref->{'osvers'}, $ref->{'osarch'}, $ref->{'osvers'}); - if (using_subiquity($os)) { + if (using_subiquity($os,$tmplfile)) { # in this context we use the genos parameter to search for the subiquity template $tmplfile = xCAT::SvrUtils::get_tmpl_file_name("$installroot/custom/install/$pltfrm", @@ -738,7 +745,7 @@ sub mkinstall { my $autoinstfile = "$installroot/autoinst/" . $node; # handle nocloud-net datasource for ubuntu 20.04+ - if (using_subiquity($os)) { + if (using_subiquity($os,$tmplfile)) { # clean up existing files to make way for the new directory if (-f $autoinstfile) { @@ -767,7 +774,7 @@ sub mkinstall { # maybe Debian will decide to use subiquity at some point? my $prescript = "$::XCATROOT/share/xcat/install/scripts/pre.$platform"; - if (using_subiquity($os)) { + if (using_subiquity($os,$tmplfile)) { $prescript = $prescript . ".subiquity"; } my $postscript = "$::XCATROOT/share/xcat/install/scripts/post.$platform"; @@ -896,7 +903,7 @@ sub mkinstall { mkpath("$tftppath"); copy($kernpath, "$tftppath/vmlinuz"); # we don't want to customise the subiquity initrd - if (using_subiquity($os)) { + if (using_subiquity($os,$tmplfile)) { copy($initrdpath, "$tftppath/initrd.img"); } else { copyAndAddCustomizations($initrdpath, "$tftppath/initrd.img"); @@ -927,7 +934,7 @@ sub mkinstall { my $kcmdline = "nofb utf8 auto xcatd=" . $instserver; - if (using_subiquity($os)) { + if (using_subiquity($os,$tmplfile)) { $kcmdline .= " autoinstall ip=dhcp netboot=nfs nfsroot=${instserver}:${pkgdir}"; $kcmdline .= " ds=nocloud-net;s=http://${instserver}:${httpport}/install/autoinst/${node}/"; } else { diff --git a/xCAT-server/lib/xcat/plugins/geninitrd.pm b/xCAT-server/lib/xcat/plugins/geninitrd.pm index 5e1710fd0..157280ee7 100644 --- a/xCAT-server/lib/xcat/plugins/geninitrd.pm +++ b/xCAT-server/lib/xcat/plugins/geninitrd.pm @@ -190,7 +190,7 @@ sub geninitrd { mkpath $tftppath; } if ($arch =~ /x86/) { - if ($osvers =~ /(^ol[0-9].*)|(centos.*)|(rocky.*)|(rh.*)|(fedora.*)|(SL.*)/) { + if ($osvers =~ /(^ol[0-9].*)|(centos.*)|(alma.*)|(rocky.*)|(rh.*)|(fedora.*)|(SL.*)/) { $kernelpath = "$tftppath/vmlinuz"; copy("$pkgdir/images/pxeboot/vmlinuz", $kernelpath); $initrdpath = "$tftppath/initrd.img"; @@ -205,7 +205,7 @@ sub geninitrd { return; } } elsif ($arch =~ /ppc/) { - if ($osvers =~ /(^ol[0-9].*)|(centos.*)|(rocky.*)|(rh.*)|(fedora.*)|(SL.*)|(pkvm.*)/) { + if ($osvers =~ /(^ol[0-9].*)|(centos.*)|(alma.*)|(rocky.*)|(rh.*)|(fedora.*)|(SL.*)|(pkvm.*)/) { $kernelpath = "$tftppath/vmlinuz"; copy("$pkgdir/ppc/ppc64/vmlinuz", $kernelpath); if (-r "$pkgdir/ppc/ppc64/ramdisk.image.gz") { @@ -231,7 +231,7 @@ sub geninitrd { # call the insert_dd function in the anaconda or sles to hack the initrd that: # 1. Get the new kernel from update distro and copy it to /tftpboot # 2. Inject the drivers to initrd in /tftpboot base on the new kernel ver - if ($osvers =~ /(^ol[0-9].*)|(centos.*)|(rocky.*)|(rh.*)|(fedora.*)|(SL.*)/) { + if ($osvers =~ /(^ol[0-9].*)|(centos.*)|(alma.*)|(rocky.*)|(rh.*)|(fedora.*)|(SL.*)/) { require xCAT_plugin::anaconda; xCAT_plugin::anaconda->insert_dd($callback, $osvers, $arch, $initrdpath, $kernelpath, $driverupdatesrc, $netdrivers, $osdisupdir, $ignorekernelchk); } elsif ($osvers =~ /(sles.*)|(suse.*)/) { diff --git a/xCAT-server/lib/xcat/plugins/imgcapture.pm b/xCAT-server/lib/xcat/plugins/imgcapture.pm index 6c11f596c..2074bf333 100755 --- a/xCAT-server/lib/xcat/plugins/imgcapture.pm +++ b/xCAT-server/lib/xcat/plugins/imgcapture.pm @@ -463,6 +463,8 @@ sub getplatform { $platform = "rh"; } elsif ($os =~ m/centos.*/) { $platform = "centos"; + } elsif ($os =~ m/alma.*/) { + $platform = "alma"; } elsif ($os =~ m/rocky.*/) { $platform = "rocky"; } elsif ($os =~ m/fedora.*/) { @@ -846,6 +848,12 @@ sub getOsVersion { $version = $lines[0]; $version =~ s/[^0-9]*([0-9.]+).*/$1/; $os = $os . $version; + } + elsif (grep (/Alma Linux/, @lines)) { + $os = "alma"; + $version = $lines[0]; + $version =~ s/[^0-9]*([0-9.]+).*/$1/; + $os = $os . $version; } elsif (grep (/Rocky/, @lines)) { $os = "rocky"; diff --git a/xCAT-server/lib/xcat/plugins/imgport.pm b/xCAT-server/lib/xcat/plugins/imgport.pm index ab0446ba9..620d7cf49 100644 --- a/xCAT-server/lib/xcat/plugins/imgport.pm +++ b/xCAT-server/lib/xcat/plugins/imgport.pm @@ -1354,6 +1354,7 @@ sub change_profile { if ($os) { if ($os =~ /rh.*/) { $platform = "rh"; } elsif ($os =~ /centos.*/) { $platform = "centos"; } + elsif ($os =~ /alma.*/) { $platform = "alma"; } elsif ($os =~ /rocky.*/) { $platform = "rocky"; } elsif ($os =~ /fedora.*/) { $platform = "fedora"; } elsif ($os =~ /sles.*/) { $platform = "sles"; } diff --git a/xCAT-server/lib/xcat/plugins/kvm.pm b/xCAT-server/lib/xcat/plugins/kvm.pm index b4d1a1178..08b43df07 100755 --- a/xCAT-server/lib/xcat/plugins/kvm.pm +++ b/xCAT-server/lib/xcat/plugins/kvm.pm @@ -970,7 +970,7 @@ sub build_xmldesc { # do nothing for ppc64le, do not support sound at this time ; } else { - $xtree{devices}->{sound}->{model} = 'ac97'; + $xtree{devices}->{sound}->{model} = 'ich6'; } $xtree{devices}->{console}->{type} = 'pty'; @@ -2258,7 +2258,7 @@ sub chvm { } if ($cpucount or $memory) { if ($currstate eq 'on') { - if ($cpucount) { xCAT::SvrUtils::sendmsg([ 1, "Hot add of cpus not supported (VM must be powered down to successfuly change)" ], $callback, $node); } + if ($cpucount) { xCAT::SvrUtils::sendmsg([ 1, "Hot add of cpus not supported (VM must be powered down to successfully change)" ], $callback, $node); } if ($cpucount) { #$dom->set_vcpus($cpucount); this didn't work out as well as I hoped.. diff --git a/xCAT-server/lib/xcat/plugins/mknb.pm b/xCAT-server/lib/xcat/plugins/mknb.pm index 435cede47..62c21d55e 100644 --- a/xCAT-server/lib/xcat/plugins/mknb.pm +++ b/xCAT-server/lib/xcat/plugins/mknb.pm @@ -104,7 +104,7 @@ sub process_request { $callback->({ error => "Need to specify architecture (x86, x86_64 or ppc64)" }, { errorcode => [1] }); return; } elsif ($arch eq "ppc64le" or $arch eq "ppc64el") { - $callback->({ data => "The arch:$arch is not supported at present, use \"ppc64\" instead" }); + $callback->({ data => "The arch:$arch is not supported, using \"ppc64\" instead" }); $arch = 'ppc64'; $request->{arg}->[0] = $arch; } @@ -300,14 +300,10 @@ sub process_request { print $cfg "#!gpxe\n"; if ($invisibletouch) { print $cfg 'imgfetch -n kernel http://${next-server}:'.$httpport.'/tftpboot/xcat/genesis.kernel.' . "$arch quiet xcatd=" . $normnets->{$_} . ":$xcatdport $consolecmdline BOOTIF=01-" . '${netX/machyp}' . "\n"; - if ($lzma_exit_value) { - print $cfg 'imgfetch -n nbfs http://${next-server}:'.$httpport.'/tftpboot/xcat/genesis.fs.' . "$arch.gz\n"; - } else { - print $cfg 'imgfetch -n nbfs http://${next-server}:'.$httpport.'/tftpboot/xcat/genesis.fs.' . "$arch.lzma\n"; - } + print $cfg 'imgfetch -n nbfs http://${next-server}:'.$httpport . "$initrd_file\n"; } else { print $cfg 'imgfetch -n kernel http://${next-server}:'.$httpport.'/tftpboot/xcat/nbk.' . "$arch quiet xcatd=" . $normnets->{$_} . ":$xcatdport $consolecmdline\n"; - print $cfg 'imgfetch -n nbfs http://${next-server}:'.$httpport.'/tftpboot/xcat/nbfs.' . "$arch.gz\n"; + print $cfg 'imgfetch -n nbfs http://${next-server}:'.$httpport . "$initrd_file\n"; } print $cfg "imgload kernel\n"; print $cfg "imgexec kernel\n"; @@ -318,18 +314,14 @@ sub process_request { print $cfg " delay=5\n"; print $cfg ' image=/tftpboot/xcat/genesis.kernel.' . "$arch\n"; print $cfg " label=\"xCAT Genesis (" . $normnets->{$_} . ")\"\n"; - if ($lzma_exit_value) { - print $cfg " initrd=/tftpboot/xcat/genesis.fs.$arch.gz\n"; - } else { - print $cfg " initrd=/tftpboot/xcat/genesis.fs.$arch.lzma\n"; - } + print $cfg " initrd=$initrd_file\n"; print $cfg " append=\"quiet xcatd=" . $normnets->{$_} . ":$xcatdport destiny=discover $consolecmdline BOOTIF=%B\"\n"; close($cfg); open($cfg, ">", "$tftpdir/xcat/xnba/nets/$net.uefi"); print $cfg "#!gpxe\n"; print $cfg 'imgfetch -n kernel http://${next-server}:'.$httpport.'/tftpboot/xcat/genesis.kernel.' . "$arch\nimgload kernel\n"; print $cfg "imgargs kernel quiet xcatd=" . $normnets->{$_} . ":$xcatdport $consolecmdline BOOTIF=01-" . '${netX/mac:hexhyp}' . " destiny=discover initrd=initrd\n"; - print $cfg 'imgfetch -n initrd http://${next-server}:'.$httpport.'/tftpboot/xcat/genesis.fs.' . "$arch.gz\nimgexec kernel\n"; + print $cfg 'imgfetch -n initrd http://${next-server}:'.$httpport . "$initrd_file\nimgexec kernel\n"; close($cfg); } } elsif ($arch =~ /ppc/) { @@ -364,11 +356,12 @@ sub process_request { } } if ($dopxe) { + my ($ignored, $tftp_initrd) = split /\/tftpboot\//, $initrd_file, 2; open($cfgfile, ">", "$tftpdir/pxelinux.cfg/" . uc($_)); print $cfgfile "DEFAULT xCAT\n"; print $cfgfile " LABEL xCAT\n"; print $cfgfile " KERNEL xcat/nbk.$arch\n"; - print $cfgfile " APPEND initrd=xcat/nbfs.$arch.gz quiet xcatd=" . $hexnets->{$_} . ":$xcatdport $consolecmdline\n"; + print $cfgfile " APPEND initrd=$tftp_initrd quiet xcatd=" . $hexnets->{$_} . ":$xcatdport $consolecmdline\n"; close($cfgfile); } elsif ($arch =~ /ppc/) { open($cfgfile, ">", "$tftpdir/etc/" . lc($_)); diff --git a/xCAT-server/lib/xcat/plugins/nodestat.pm b/xCAT-server/lib/xcat/plugins/nodestat.pm index bdea53303..201b59673 100644 --- a/xCAT-server/lib/xcat/plugins/nodestat.pm +++ b/xCAT-server/lib/xcat/plugins/nodestat.pm @@ -136,7 +136,7 @@ sub preprocess_request # parse the options $::UPDATE = 0; - $::QUITE = 0; + $::QUIET = 0; $::MON = 0; $::POWER = 0; @@ -146,7 +146,7 @@ sub preprocess_request $Getopt::Long::ignorecase = 0; if (!GetOptions( 'm|usemon' => \$::MON, - 'q|quite' => \$::QUITE, #this is a internal flag used by monitoring + 'q|quiet' => \$::QUIET, #this is a internal flag used by monitoring 'u|updatedb' => \$::UPDATE, 'p|powerstat' => \$::POWER, 'h|help' => \$::HELP, @@ -174,7 +174,7 @@ sub preprocess_request } $req->{'update'}->[0] = $::UPDATE; - $req->{'quite'}->[0] = $::QUITE; + $req->{'quiet'}->[0] = $::QUIET; $req->{'mon'}->[0] = $::MON; $req->{'power'}->[0] = $::POWER; return [$req]; @@ -1123,11 +1123,11 @@ sub process_request { #print Dumper($request); my $update = $request->{'update'}->[0]; - my $quite = $request->{'quite'}->[0]; + my $quiet = $request->{'quiet'}->[0]; #show the output - if (!$quite) { + if (!$quiet) { foreach my $node1 (sort keys(%$status)) { my %rsp; $rsp{name} = [$node1]; diff --git a/xCAT-server/lib/xcat/plugins/ontap.pm b/xCAT-server/lib/xcat/plugins/ontap.pm index 1b2b1e67d..3c4ad1e0b 100644 --- a/xCAT-server/lib/xcat/plugins/ontap.pm +++ b/xCAT-server/lib/xcat/plugins/ontap.pm @@ -217,6 +217,7 @@ sub create_new_lun { my %osmap = ( 'rh.*' => 'linux', 'centos.*' => 'linux', + 'alma.*' => 'linux', 'rocky.*' => 'linux', 'sles.*' => 'linux', 'win2k8' => 'windows_2008', diff --git a/xCAT-server/lib/xcat/plugins/packimage.pm b/xCAT-server/lib/xcat/plugins/packimage.pm index 3eb79ba23..412f786fc 100755 --- a/xCAT-server/lib/xcat/plugins/packimage.pm +++ b/xCAT-server/lib/xcat/plugins/packimage.pm @@ -329,6 +329,18 @@ sub process_request { xCAT::Utils->runcmd("cp /opt/xcat/share/xcat/netboot/rh/dracut_033/install.netboot $rootimg_dir/usr/lib/dracut/modules.d/97xcat/install", 0, 1); + # timedatectl requires /etc/localtime link to the zoneinfo in /usr/share/zoneinfo + if ($timezone[0]) { + unlink("$rootimg_dir/etc/localtime"); + symlink("../usr/share/zoneinfo/$timezone[0]", "$rootimg_dir/etc/localtime"); + + if (not stat "$rootimg_dir/etc/localtime") { + $callback->({ warning => ["Unable to set timezone to \'$timezone[0]\', check this is a valid timezone"] }); + } + } else { + $callback->({ info => ["No timezone defined in site table, skipping timezone /etc/localtime configuration"] }); + } + my $xcat_packimg_tmpfile = "/tmp/xcat_packimg.$$"; my $excludestr = "find . -xdev "; my $includestr; @@ -344,11 +356,7 @@ sub process_request { } close($exlist); - # timedatectl requires /etc/localtime link to the zoneinfo in /usr/share/zoneinfo if ($timezone[0]) { - unlink("$rootimg_dir/etc/localtime"); - symlink("../usr/share/zoneinfo/$timezone[0]", "$rootimg_dir/etc/localtime"); - # Add the zoneinfo to the include list $excludetext .= "+./usr/share/zoneinfo/$timezone[0]\n"; @@ -361,11 +369,8 @@ sub process_request { $excludetext .= "+.$relativetzpath\n"; } - if (not stat "$rootimg_dir/etc/localtime") { - $callback->({ warning => ["Unable to set timezone to \'$timezone[0]\', check this is a valid timezone"] }); - } } else { - $callback->({ info => ["No timezone defined in site table, skipping timezone configuration"] }); + $callback->({ info => ["No timezone defined in site table, skipping timezone exlist configuration"] }); } #handle the #INLCUDE# tag recursively diff --git a/xCAT-server/lib/xcat/plugins/route.pm b/xCAT-server/lib/xcat/plugins/route.pm index 659e651e0..cf5282505 100644 --- a/xCAT-server/lib/xcat/plugins/route.pm +++ b/xCAT-server/lib/xcat/plugins/route.pm @@ -669,7 +669,7 @@ sub set_route { } elsif ($os =~ /ubuntu|debian/) { #ubuntu or Debian? addPersistentRoute_Debian($callback, $net, $mask, $gw_ip, $gw, $ifname); } - elsif ($os =~ /rh|fedora|centos|rocky/) { #RH, Ferdora, CentOS + elsif ($os =~ /rh|fedora|centos|alma|rocky/) { #RH, Ferdora, CentOS addPersistentRoute_RH($callback, $net, $mask, $gw_ip, $gw, $ifname); } } else { #AIX @@ -756,7 +756,7 @@ sub delete_route { } elsif ($os =~ /ubuntu/) { #ubuntu or Debian? deletePersistentRoute_Debian($callback, $net, $mask, $gw_ip, $gw, $ifname); } - elsif ($os =~ /rh|fedora|centos|rocky/) { #RH, Ferdora + elsif ($os =~ /rh|fedora|centos|alma|rocky/) { #RH, Ferdora deletePersistentRoute_RH($callback, $net, $mask, $gw_ip, $gw, $ifname); } } diff --git a/xCAT-server/lib/xcat/plugins/sles.pm b/xCAT-server/lib/xcat/plugins/sles.pm index dea6643b7..9bfbb9238 100644 --- a/xCAT-server/lib/xcat/plugins/sles.pm +++ b/xCAT-server/lib/xcat/plugins/sles.pm @@ -1770,6 +1770,15 @@ sub copycd $distname = "sle15"; } }; + } elsif ($dsc =~ /SLE-15/ and $dsc =~ /SOURCE/) { + $discnumber = 2; + unless ($distname) { + if ($dsc =~ /SLE-15-SP(\d)/) { + $distname = "sle15.$1"; + } else { + $distname = "sle15"; + } + }; } elsif ($dsc =~ /SLE-15/ and $dsc =~ /Full/) { $discnumber = 1; $linktwo = 1; diff --git a/xCAT-server/lib/xcat/plugins/updatenode.pm b/xCAT-server/lib/xcat/plugins/updatenode.pm index 60f8403ed..6ee068cb7 100644 --- a/xCAT-server/lib/xcat/plugins/updatenode.pm +++ b/xCAT-server/lib/xcat/plugins/updatenode.pm @@ -3352,7 +3352,7 @@ sub updateOS $version =~ s/[^0-9]*([0-9]+).*/$1/; } - # SUSE Linux + # SUSE Linux 12 and earlier elsif ( `ssh -o ConnectTimeout=5 $node "test -f /etc/SuSE-release && echo 'SuSE'"` ) @@ -3363,6 +3363,17 @@ sub updateOS $version =~ s/[^0-9]*([0-9]+).*/$1/; } + # SUSE Linux 15 and later + elsif ( +`ssh -o ConnectTimeout=5 $node "test -f /etc/SUSE-brand && echo 'SuSE'"` + ) + { + $installOS = "sles"; + chomp($version = + `ssh $node "tr -d '.' < /etc/SUSE-brand" | grep VERSION`); + $version =~ s/[^0-9]*([0-9]+).*/$1/; + } + # Everything else else { diff --git a/xCAT-server/sbin/makenamed.conf b/xCAT-server/sbin/makenamed.conf index d481bb76c..eaf197932 100755 --- a/xCAT-server/sbin/makenamed.conf +++ b/xCAT-server/sbin/makenamed.conf @@ -63,8 +63,19 @@ do echo " $i;" done >>$FILE echo " };" >>$FILE -BIND_VERSION=$(/usr/sbin/named -v | cut -d" " -f2) -if [[ $BIND_VERSION > "9.16.5" ]]; then + +# Natural version compare against version of bind. +# If version 9.16.6 or higher, turn off DNSSEC +BIND_VERSION=$(/usr/sbin/named -v | cut -d" " -f2 | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+' | head -n1) +CONTROL_BIND_VERSION="9.16.6" + +# "sort --version-sort" takes lines of version strings and sorts them. +# Output is lines of versions in sorted order, last line is highest version number +LAST_IN_COMPARE=`printf '%s\n' $BIND_VERSION $CONTROL_BIND_VERSION | sort --version-sort | tail -n1` + +if [ $BIND_VERSION = $LAST_IN_COMPARE ]; then + # current version of BIND was last in sorted order, + # therefor it is higher than CONTROL_BIND_VERSION echo " dnssec-enable no; dnssec-validation no;" >>$FILE fi diff --git a/xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install b/xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install index 58a2a4ac6..69c03da1f 100755 --- a/xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install +++ b/xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install @@ -376,7 +376,7 @@ EOF # Being called from .postinstall script # Assume we are on the same machine - if [ -f /etc/SuSE-release ]; then + if [ -f /etc/SuSE-release ] || [ -f /etc/SUSE-brand ]; then chroot "$IMGROOTPATH" rpm -e --noscripts --allmatches mlnx-ofa_kernel-kmp-default 2>/dev/null chroot "$IMGROOTPATH" rpm -e --nodeps --allmatches libibverbs 2>/dev/null elif grep -q Ubuntu /etc/os-release 2>/dev/null; then diff --git a/xCAT-server/share/xcat/ib/scripts/configiba.1port b/xCAT-server/share/xcat/ib/scripts/configiba.1port index 108e4e5eb..69e391729 100755 --- a/xCAT-server/share/xcat/ib/scripts/configiba.1port +++ b/xCAT-server/share/xcat/ib/scripts/configiba.1port @@ -64,7 +64,7 @@ then if [ -f /etc/redhat-release ] then OS_name="redhat" - elif [ -f /etc/SuSE-release ] + elif [ -f /etc/SuSE-release ] || [ -f /etc/SUSE-brand ] then OS_name="suse" else diff --git a/xCAT-server/share/xcat/ib/scripts/configiba.2ports b/xCAT-server/share/xcat/ib/scripts/configiba.2ports index 91b44f024..964972c22 100755 --- a/xCAT-server/share/xcat/ib/scripts/configiba.2ports +++ b/xCAT-server/share/xcat/ib/scripts/configiba.2ports @@ -57,7 +57,7 @@ then if [ -f /etc/redhat-release ] then OS_name="redhat" - elif [ -f /etc/SuSE-release ] + elif [ -f /etc/SuSE-release ] || [ -f /etc/SUSE-brand ] then OS_name="suse" else @@ -142,7 +142,7 @@ do if [ -f /etc/redhat-release ] then OS_name="redhat" - elif [ -f /etc/SuSE-release ] + elif [ -f /etc/SuSE-release ] || [ -f /etc/SUSE-brand ] then OS_name="suse" else diff --git a/xCAT-server/share/xcat/install/alma/compute.alma8.pkglist b/xCAT-server/share/xcat/install/alma/compute.alma8.pkglist new file mode 120000 index 000000000..ccb1fe4ef --- /dev/null +++ b/xCAT-server/share/xcat/install/alma/compute.alma8.pkglist @@ -0,0 +1 @@ +../rh/compute.rhels8.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/install/alma/compute.alma8.tmpl b/xCAT-server/share/xcat/install/alma/compute.alma8.tmpl new file mode 120000 index 000000000..50866c82a --- /dev/null +++ b/xCAT-server/share/xcat/install/alma/compute.alma8.tmpl @@ -0,0 +1 @@ +../rh/compute.rhels8.tmpl \ No newline at end of file diff --git a/xCAT-server/share/xcat/install/alma/service.alma8.pkglist b/xCAT-server/share/xcat/install/alma/service.alma8.pkglist new file mode 120000 index 000000000..818f670ec --- /dev/null +++ b/xCAT-server/share/xcat/install/alma/service.alma8.pkglist @@ -0,0 +1 @@ +../rh/service.rhels8.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/install/alma/service.alma8.tmpl b/xCAT-server/share/xcat/install/alma/service.alma8.tmpl new file mode 120000 index 000000000..373e2f6eb --- /dev/null +++ b/xCAT-server/share/xcat/install/alma/service.alma8.tmpl @@ -0,0 +1 @@ +../rh/service.rhels8.tmpl \ No newline at end of file diff --git a/xCAT-server/share/xcat/install/alma/service.alma8.x86_64.otherpkgs.pkglist b/xCAT-server/share/xcat/install/alma/service.alma8.x86_64.otherpkgs.pkglist new file mode 120000 index 000000000..03999f75f --- /dev/null +++ b/xCAT-server/share/xcat/install/alma/service.alma8.x86_64.otherpkgs.pkglist @@ -0,0 +1 @@ +../rh/service.rhels8.x86_64.otherpkgs.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/install/scripts/post.rhels8 b/xCAT-server/share/xcat/install/scripts/post.rhels8 index a45862796..6ab305e87 100644 --- a/xCAT-server/share/xcat/install/scripts/post.rhels8 +++ b/xCAT-server/share/xcat/install/scripts/post.rhels8 @@ -22,7 +22,7 @@ done # List of internal repos to be disabled -internet_repo_file_list="oracle-linux-ol8.repo uek-ol8.repo Rocky-AppStream.repo Rocky-BaseOS.repo Rocky-Extras.repo CentOS-Base.repo" +internet_repo_file_list="oracle-linux-ol8.repo uek-ol8.repo Rocky-AppStream.repo Rocky-BaseOS.repo Rocky-Extras.repo CentOS-Base.repo almalinux-ha.repo almalinux-nfv.repo almalinux-powertools.repo almalinux.repo almalinux-resilientstorage.repo almalinux-rt.repo" for repo_file in $internet_repo_file_list do diff --git a/xCAT-server/share/xcat/install/ubuntu/compute.tmpl b/xCAT-server/share/xcat/install/ubuntu/compute.tmpl index e784e01ac..086b1c455 100644 --- a/xCAT-server/share/xcat/install/ubuntu/compute.tmpl +++ b/xCAT-server/share/xcat/install/ubuntu/compute.tmpl @@ -143,6 +143,8 @@ d-i preseed/late_command string \ mount -o bind /dev/pts /target/dev/pts -t devpts; \ mount -o bind /sys /target/sys; \ chroot /target /root/post.script; \ - cp /target/etc/network/interfaces /etc/network/interfaces; \ + if [ -f /target/etc/network/interfaces ]; then \ + cp /target/etc/network/interfaces /etc/network/interfaces; \ + fi; \ } >>/target/var/log/xcat/xcat.log 2>&1 diff --git a/xCAT-server/share/xcat/netboot/add-on/torque/add_torque b/xCAT-server/share/xcat/netboot/add-on/torque/add_torque index 6180b7be4..32f011237 100755 --- a/xCAT-server/share/xcat/netboot/add-on/torque/add_torque +++ b/xCAT-server/share/xcat/netboot/add-on/torque/add_torque @@ -101,7 +101,7 @@ echo "export PATH=\$PATH:$TORQUEDIR/\$XARCH/bin:$TORQUEDIR/\$XARCH/sbin" >>etc/p echo "export PBS_DEFAULT=$TORQUESERVER" >>etc/profile.d/torque.sh chmod 755 etc/profile.d/torque.* -if [ -r /etc/SuSE-release ] +if [ -r /etc/SuSE-release ] || [ -r /etc/SUSE-brand ] then cp $XCATROOT/share/xcat/netboot/add-on/torque/pbs_mom.suse etc/init.d/pbs_mom cp $XCATROOT/share/xcat/netboot/add-on/torque/pbs_mom.suse sbin/rcpbs_mom diff --git a/xCAT-server/share/xcat/netboot/alma/compute.alma8.x86_64.exlist b/xCAT-server/share/xcat/netboot/alma/compute.alma8.x86_64.exlist new file mode 120000 index 000000000..a6d9c0135 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/alma/compute.alma8.x86_64.exlist @@ -0,0 +1 @@ +../rh/compute.rhels8.x86_64.exlist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/alma/compute.alma8.x86_64.pkglist b/xCAT-server/share/xcat/netboot/alma/compute.alma8.x86_64.pkglist new file mode 120000 index 000000000..5ecd4c4d1 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/alma/compute.alma8.x86_64.pkglist @@ -0,0 +1 @@ +../rh/compute.rhels8.x86_64.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/alma/compute.alma8.x86_64.postinstall b/xCAT-server/share/xcat/netboot/alma/compute.alma8.x86_64.postinstall new file mode 120000 index 000000000..3e16d254e --- /dev/null +++ b/xCAT-server/share/xcat/netboot/alma/compute.alma8.x86_64.postinstall @@ -0,0 +1 @@ +../rh/compute.rhels8.x86_64.postinstall \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/alma/dracut b/xCAT-server/share/xcat/netboot/alma/dracut new file mode 120000 index 000000000..11bde8445 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/alma/dracut @@ -0,0 +1 @@ +../rh/dracut \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/alma/dracut_033 b/xCAT-server/share/xcat/netboot/alma/dracut_033 new file mode 120000 index 000000000..0e9de994a --- /dev/null +++ b/xCAT-server/share/xcat/netboot/alma/dracut_033 @@ -0,0 +1 @@ +../rh/dracut_033 \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/alma/dracut_047 b/xCAT-server/share/xcat/netboot/alma/dracut_047 new file mode 120000 index 000000000..fe26fce05 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/alma/dracut_047 @@ -0,0 +1 @@ +../rh/dracut_047 \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/alma/genimage b/xCAT-server/share/xcat/netboot/alma/genimage new file mode 120000 index 000000000..1c50b1848 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/alma/genimage @@ -0,0 +1 @@ +../rh/genimage \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/alma/geninitrd b/xCAT-server/share/xcat/netboot/alma/geninitrd new file mode 120000 index 000000000..2271c3f0f --- /dev/null +++ b/xCAT-server/share/xcat/netboot/alma/geninitrd @@ -0,0 +1 @@ +genimage \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/alma/kvm.exlist b/xCAT-server/share/xcat/netboot/alma/kvm.exlist new file mode 120000 index 000000000..c86878d02 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/alma/kvm.exlist @@ -0,0 +1 @@ +../rh/kvm.exlist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/alma/kvm.pkglist b/xCAT-server/share/xcat/netboot/alma/kvm.pkglist new file mode 120000 index 000000000..010315c63 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/alma/kvm.pkglist @@ -0,0 +1 @@ +../rh/kvm.rhels5.4.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/alma/service.alma8.x86_64.exlist b/xCAT-server/share/xcat/netboot/alma/service.alma8.x86_64.exlist new file mode 120000 index 000000000..9d1e45244 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/alma/service.alma8.x86_64.exlist @@ -0,0 +1 @@ +../rh/service.rhels8.x86_64.exlist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/alma/service.alma8.x86_64.otherpkgs.pkglist b/xCAT-server/share/xcat/netboot/alma/service.alma8.x86_64.otherpkgs.pkglist new file mode 120000 index 000000000..03999f75f --- /dev/null +++ b/xCAT-server/share/xcat/netboot/alma/service.alma8.x86_64.otherpkgs.pkglist @@ -0,0 +1 @@ +../rh/service.rhels8.x86_64.otherpkgs.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/alma/service.alma8.x86_64.pkglist b/xCAT-server/share/xcat/netboot/alma/service.alma8.x86_64.pkglist new file mode 120000 index 000000000..cba1edc0e --- /dev/null +++ b/xCAT-server/share/xcat/netboot/alma/service.alma8.x86_64.pkglist @@ -0,0 +1 @@ +../rh/service.rhels8.x86_64.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/alma/service.alma8.x86_64.postinstall b/xCAT-server/share/xcat/netboot/alma/service.alma8.x86_64.postinstall new file mode 120000 index 000000000..cd4cbff17 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/alma/service.alma8.x86_64.postinstall @@ -0,0 +1 @@ +../rh/service.rhels8.x86_64.postinstall \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/alma/xen.exlist b/xCAT-server/share/xcat/netboot/alma/xen.exlist new file mode 120000 index 000000000..f968576ce --- /dev/null +++ b/xCAT-server/share/xcat/netboot/alma/xen.exlist @@ -0,0 +1 @@ +../rh/xen.exlist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/alma/xen.pkglist b/xCAT-server/share/xcat/netboot/alma/xen.pkglist new file mode 120000 index 000000000..b8f195934 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/alma/xen.pkglist @@ -0,0 +1 @@ +../rh/xen.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels6.ppc64.exlist b/xCAT-server/share/xcat/netboot/rh/compute.rhels6.ppc64.exlist index ccad8b8c8..829567777 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels6.ppc64.exlist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels6.ppc64.exlist @@ -25,6 +25,7 @@ +./usr/share/locale/locale.alias +./usr/lib/locale/locale-archive +./usr/lib/locale/en* ++./usr/lib/locale/C* ./usr/share/man* ./usr/share/omf* ./usr/share/vim/site/doc* diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels6.x86_64.exlist b/xCAT-server/share/xcat/netboot/rh/compute.rhels6.x86_64.exlist index f717a5bcc..01bbec99c 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels6.x86_64.exlist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels6.x86_64.exlist @@ -25,6 +25,7 @@ +./usr/share/locale/locale.alias +./usr/lib/locale/locale-archive +./usr/lib/locale/en* ++./usr/lib/locale/C* ./usr/share/man* ./usr/share/omf* ./usr/share/vim/site/doc* diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels7.ppc64.exlist b/xCAT-server/share/xcat/netboot/rh/compute.rhels7.ppc64.exlist index 30b29ed63..2ed589342 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels7.ppc64.exlist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels7.ppc64.exlist @@ -25,6 +25,7 @@ +./usr/share/locale/locale.alias +./usr/lib/locale/locale-archive +./usr/lib/locale/en* ++./usr/lib/locale/C* ./usr/share/omf* ./usr/share/vim/site/doc* ./usr/share/vim/vim74/doc* diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels7.x86_64.exlist b/xCAT-server/share/xcat/netboot/rh/compute.rhels7.x86_64.exlist index 38de24002..275bdd591 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels7.x86_64.exlist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels7.x86_64.exlist @@ -25,6 +25,7 @@ +./usr/share/locale/locale.alias +./usr/lib/locale/locale-archive +./usr/lib/locale/en* ++./usr/lib/locale/C* ./usr/share/man* ./usr/share/omf* ./usr/share/vim/site/doc* diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.exlist b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.exlist index 944d990e7..07436e39f 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.exlist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.exlist @@ -23,6 +23,7 @@ +./usr/share/locale/locale.alias +./usr/lib/locale/locale-archive +./usr/lib/locale/en* ++./usr/lib/locale/C* ./usr/share/omf* ./usr/share/vim/site/doc* ./usr/share/vim/vim74/doc* diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.exlist b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.exlist index def3241d3..c74b15c00 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.exlist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.exlist @@ -23,6 +23,7 @@ +./usr/share/locale/locale.alias +./usr/lib/locale/locale-archive +./usr/lib/locale/en* ++./usr/lib/locale/C* ./usr/share/man* ./usr/share/omf* ./usr/share/vim/site/doc* diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels9.ppc64le.exlist b/xCAT-server/share/xcat/netboot/rh/compute.rhels9.ppc64le.exlist index 944d990e7..07436e39f 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels9.ppc64le.exlist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels9.ppc64le.exlist @@ -23,6 +23,7 @@ +./usr/share/locale/locale.alias +./usr/lib/locale/locale-archive +./usr/lib/locale/en* ++./usr/lib/locale/C* ./usr/share/omf* ./usr/share/vim/site/doc* ./usr/share/vim/vim74/doc* diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels9.x86_64.exlist b/xCAT-server/share/xcat/netboot/rh/compute.rhels9.x86_64.exlist index def3241d3..c74b15c00 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels9.x86_64.exlist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels9.x86_64.exlist @@ -23,6 +23,7 @@ +./usr/share/locale/locale.alias +./usr/lib/locale/locale-archive +./usr/lib/locale/en* ++./usr/lib/locale/C* ./usr/share/man* ./usr/share/omf* ./usr/share/vim/site/doc* diff --git a/xCAT-server/share/xcat/netboot/rh/genimage b/xCAT-server/share/xcat/netboot/rh/genimage index 09ee04210..a79194f23 100755 --- a/xCAT-server/share/xcat/netboot/rh/genimage +++ b/xCAT-server/share/xcat/netboot/rh/genimage @@ -786,7 +786,7 @@ if ((-d "$rootimg_dir/usr/share/dracut") or (-d "$rootimg_dir/usr/lib/dracut")) # List of internet repos to be disabled -my @internet_repo_file_list = ("oracle-linux-ol8.repo", "uek-ol8.repo", "Rocky-AppStream.repo", "Rocky-BaseOS.repo", "Rocky-Extras.repo", "CentOS-Base.repo"); +my @internet_repo_file_list = ("oracle-linux-ol8.repo", "uek-ol8.repo", "Rocky-AppStream.repo", "Rocky-BaseOS.repo", "Rocky-Extras.repo", "CentOS-Base.repo", "almalinux-ha.repo", "almalinux-nfv.repo", "almalinux-plus.repo", "almalinux-powertools.repo", "almalinux.repo", "almalinux-resilientstorage.repo", "almalinux-rt.repo"); foreach ( @internet_repo_file_list ) { if (-e "$rootimg_dir/etc/yum.repos.d/$_") { @@ -1103,9 +1103,9 @@ sub mkinitrd_dracut { } } - print $DRACUTCONF qq{dracutmodules+="$dracutmodulelist"\n}; - print $DRACUTCONF qq{add_drivers+="$add_drivers"\n}; - print $DRACUTCONF qq{filesystems+="nfs"\n}; + print $DRACUTCONF qq{dracutmodules+=" $dracutmodulelist "\n}; + print $DRACUTCONF qq{add_drivers+=" $add_drivers "\n}; + print $DRACUTCONF qq{filesystems+=" nfs "\n}; close $DRACUTCONF; } elsif ($mode eq "stateless") { cp("$fullpath/$dracutdir/install.netboot", "$dracutmpath/install"); @@ -1146,8 +1146,8 @@ sub mkinitrd_dracut { # update etc/dracut.conf open($DRACUTCONF, '>', "$rootimg_dir/etc/dracut.conf"); - print $DRACUTCONF qq{dracutmodules+="$dracutmodulelist"\n}; - print $DRACUTCONF qq{add_drivers+="$add_drivers"\n}; + print $DRACUTCONF qq{dracutmodules+=" $dracutmodulelist "\n}; + print $DRACUTCONF qq{add_drivers+=" $add_drivers "\n}; close $DRACUTCONF; } else { xdie "the mode: $mode is not supported by genimage"; diff --git a/xCAT-server/share/xcat/netboot/rh/service.rhels7.ppc64le.exlist b/xCAT-server/share/xcat/netboot/rh/service.rhels7.ppc64le.exlist index 38de24002..275bdd591 100644 --- a/xCAT-server/share/xcat/netboot/rh/service.rhels7.ppc64le.exlist +++ b/xCAT-server/share/xcat/netboot/rh/service.rhels7.ppc64le.exlist @@ -25,6 +25,7 @@ +./usr/share/locale/locale.alias +./usr/lib/locale/locale-archive +./usr/lib/locale/en* ++./usr/lib/locale/C* ./usr/share/man* ./usr/share/omf* ./usr/share/vim/site/doc* diff --git a/xCAT-server/share/xcat/netboot/rh/service.rhels7.x86_64.exlist b/xCAT-server/share/xcat/netboot/rh/service.rhels7.x86_64.exlist index 38de24002..275bdd591 100644 --- a/xCAT-server/share/xcat/netboot/rh/service.rhels7.x86_64.exlist +++ b/xCAT-server/share/xcat/netboot/rh/service.rhels7.x86_64.exlist @@ -25,6 +25,7 @@ +./usr/share/locale/locale.alias +./usr/lib/locale/locale-archive +./usr/lib/locale/en* ++./usr/lib/locale/C* ./usr/share/man* ./usr/share/omf* ./usr/share/vim/site/doc* diff --git a/xCAT-server/share/xcat/netboot/sles/genimage b/xCAT-server/share/xcat/netboot/sles/genimage index 22cf71e69..9daeed130 100755 --- a/xCAT-server/share/xcat/netboot/sles/genimage +++ b/xCAT-server/share/xcat/netboot/sles/genimage @@ -666,7 +666,7 @@ if ((-d "$rootimg_dir/usr/share/dracut") or (-d "$rootimg_dir/usr/lib/dracut")) $dracutmode = 1; # get dracut version - $dracutver = `chroot $rootimg_dir rpm -qi dracut | awk '/Version/{print \$3}' | awk -F. '{print \$1}'`; + $dracutver = `chroot $rootimg_dir rpm -qi dracut | awk '/Version/ {print \$3}' | awk -F[.+] '{print \$1}'`; chomp($dracutver); if ($dracutver =~ /^\d\d\d$/) { if ($dracutver >= "033") { @@ -1097,13 +1097,13 @@ sub mkinitrd_dracut { #update etc/dracut.conf open($DRACUTCONF, '>', "$rootimg_dir/etc/dracut.conf"); if (-d glob($dracutmoduledir . "[0-9]*fadump")) { - print $DRACUTCONF qq{dracutmodules+="xcat nfs base network kernel-modules lvm fadump"\n}; + print $DRACUTCONF qq{dracutmodules+=" xcat nfs base network kernel-modules lvm fadump "\n}; } else { - print $DRACUTCONF qq{dracutmodules+="xcat nfs base network kernel-modules lvm"\n}; + print $DRACUTCONF qq{dracutmodules+=" xcat nfs base network kernel-modules lvm "\n}; } - print $DRACUTCONF qq{add_drivers+="$add_drivers"\n}; - print $DRACUTCONF qq{filesystems+="nfs"\n}; + print $DRACUTCONF qq{add_drivers+=" $add_drivers "\n}; + print $DRACUTCONF qq{filesystems+=" nfs "\n}; close $DRACUTCONF; } elsif ($mode eq "stateless") { cp("$fullpath/$dracutdir/install.netboot", "$dracutmpath/install"); @@ -1135,12 +1135,12 @@ sub mkinitrd_dracut { # update etc/dracut.conf open($DRACUTCONF, '>', "$rootimg_dir/etc/dracut.conf"); if (-d glob($dracutmoduledir . "[0-9]*fadump")) { - print $DRACUTCONF qq{dracutmodules+="xcat nfs base network kernel-modules lvm fadump syslog"\n}; + print $DRACUTCONF qq{dracutmodules+=" xcat nfs base network kernel-modules lvm fadump syslog "\n}; } else { - print $DRACUTCONF qq{dracutmodules+="xcat nfs base network kernel-modules lvm syslog"\n}; + print $DRACUTCONF qq{dracutmodules+=" xcat nfs base network kernel-modules lvm syslog "\n}; } - print $DRACUTCONF qq{add_drivers+="$add_drivers"\n}; + print $DRACUTCONF qq{add_drivers+=" $add_drivers "\n}; close $DRACUTCONF; } else { xdie "the mode: $mode is not supported by genimage"; diff --git a/xCAT-server/share/xcat/netboot/suse/genimage b/xCAT-server/share/xcat/netboot/suse/genimage index ffd157a3c..3bc683a90 100755 --- a/xCAT-server/share/xcat/netboot/suse/genimage +++ b/xCAT-server/share/xcat/netboot/suse/genimage @@ -211,8 +211,10 @@ unless (grep /af_packet/, @ndrivers) { unshift(@ndrivers, "af_packet.ko"); } +# Check both possible SLES files for version number. +# "--no-messages" suppresses "grep: : No such file or directory" my $osver_host; -if (`grep VERSION /etc/SuSE-release` =~ /VERSION = (\d+)/) { +if (`grep --no-messages VERSION /etc/SuSE-release /etc/SUSE-brand` =~ /VERSION = (\d+)/) { $osver_host = $1; } else { $osver_host = 11; diff --git a/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu20.04.x86_64.pkglist b/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu20.04.x86_64.pkglist index b83d5ffdb..dcdfb53a1 100644 --- a/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu20.04.x86_64.pkglist +++ b/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu20.04.x86_64.pkglist @@ -1,5 +1,4 @@ bash -ifupdown nfs-common openssl isc-dhcp-client @@ -8,7 +7,6 @@ linux-image-generic openssh-server openssh-client wget -vim rsync busybox-static gawk diff --git a/xCAT-server/share/xcat/netboot/ubuntu/genimage b/xCAT-server/share/xcat/netboot/ubuntu/genimage index 32163e784..98b8fe146 100755 --- a/xCAT-server/share/xcat/netboot/ubuntu/genimage +++ b/xCAT-server/share/xcat/netboot/ubuntu/genimage @@ -947,9 +947,9 @@ sub mkinitrd_dracut { # update etc/dracut.conf open($DRACUTCONF, '>', "$rootimg_dir/etc/dracut.conf"); - print $DRACUTCONF qq{dracutmodules+="xcat nfs base network kernel-modules"\n}; - print $DRACUTCONF qq{add_drivers+="$add_drivers"\n}; - print $DRACUTCONF qq{filesystems+="nfs"\n}; + print $DRACUTCONF qq{dracutmodules+=" xcat nfs base network kernel-modules "\n}; + print $DRACUTCONF qq{add_drivers+=" $add_drivers "\n}; + print $DRACUTCONF qq{filesystems+=" nfs "\n}; close $DRACUTCONF; } elsif ($mode eq "stateless") { cp("$fullpath/$dracutdir/install.netboot", "$dracutmpath/install"); @@ -977,8 +977,8 @@ sub mkinitrd_dracut { # update etc/dracut.conf open($DRACUTCONF, '>', "$rootimg_dir/etc/dracut.conf"); - print $DRACUTCONF qq{dracutmodules+="xcat nfs base network kernel-modules"\n}; - print $DRACUTCONF qq{add_drivers+="$add_drivers"\n}; + print $DRACUTCONF qq{dracutmodules+=" xcat nfs base network kernel-modules "\n}; + print $DRACUTCONF qq{add_drivers+=" $add_drivers "\n}; close $DRACUTCONF; } else { xdie "the mode: $mode is not supported by genimage"; diff --git a/xCAT-server/share/xcat/scripts/xHRM b/xCAT-server/share/xcat/scripts/xHRM index 4770c7e1e..03960cad6 100755 --- a/xCAT-server/share/xcat/scripts/xHRM +++ b/xCAT-server/share/xcat/scripts/xHRM @@ -246,7 +246,7 @@ elif [ "bridgeprereq" = "$1" ]; then fi #now save the settings into the config files so that they will be persistent among reboots - if [[ $OSVER = sles* ]] || [[ $OSVER = suse* ]] || [[ -f /etc/SuSE-release ]]; then + if [[ $OSVER = sles* ]] || [[ $OSVER = suse* ]] || [[ -f /etc/SuSE-release ]] || [[ -f /etc/SUSE-brand ]]; then nwdir="/etc/sysconfig/network" isSLES=1 elif [ -f "/etc/debian_version" ];then diff --git a/xCAT-server/share/xcat/tools/go-xcat b/xCAT-server/share/xcat/tools/go-xcat index e6d384ce1..8f88447fb 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.50 +# Version 1.0.53 # # Copyright (C) 2016 - 2021 International Business Machines # Eclipse Public License, Version 1.0 (EPL-1.0) @@ -40,6 +40,12 @@ # - Provide correct versions of packages to be installed # 2021-07-27 Mark Gurevich # - Add support for Rocky Linux +# 2022-11-01 Mark Gurevich +# - Make sure initscripts installed on RH family of OSes +# 2022-12-06 Mark Gurevich +# - Check for EPEL and CRB repository on EL9 family of OSes +# 2023-01-19 Mark Gurevich +# - Add support for Alma Linux # @@ -203,6 +209,8 @@ GO_XCAT_UNINSTALL_LIST=("${GO_XCAT_INSTALL_LIST[@]}" PATH="/usr/sbin:/usr/bin:/sbin:/bin" export PATH +EL9_EPEL_TEST_RPM="perl-Crypt-CBC" +EL9_CRB_TEST_RPM="perl-IO-Tty" # # warn_if_bad Put out warning message(s) if $1 has bad RC. @@ -515,6 +523,7 @@ function check_linux_distro() echo "${ID}")" [[ -z "${distro}" && -f /etc/redhat-release ]] && distro="rhel" [[ -z "${distro}" && -f /etc/SuSE-release ]] && distro="sles" + [[ -z "${distro}" && -f /etc/SUSE-brand ]] && distro="sles" echo "${distro}" } @@ -528,6 +537,8 @@ function check_linux_version() /etc/redhat-release)" [[ -z "${ver}" && -f /etc/SuSE-release ]] && ver="$(awk '/VERSION/ { print $NF }' /etc/SuSE-release)" + [[ -z "${ver}" && -f /etc/SUSE-brand ]] && + ver="$(awk '/VERSION/ { print $NF }' /etc/SUSE-brand)" echo "${ver}" } @@ -1592,6 +1603,7 @@ function add_xcat_dep_repo_yum_or_zypper() "centos"*) distro="rh${distro#centos}" ;; "ol"*) distro="rh${distro#ol}" ;; "rocky"*) distro="rh${distro#rocky}" ;; + "alma"*) distro="rh${distro#almalinux}" ;; "fedora10"|"fedora11") distro="fedora9" ;; "fedora1"[678]) distro="rh6" ;; "fedora19"|"fedora2"?) distro="rh7" ;; @@ -1703,16 +1715,20 @@ function update_repo() function install_packages_dnf() { type dnf >/dev/null 2>&1 || return 255 + el9_epel_and_crb_check dnf local -a yes=() [[ "$1" = "-y" ]] && yes=("-y") && shift + dnf --nogpgcheck "${yes[@]}" install initscripts dnf --nogpgcheck "${yes[@]}" install "$@" } function install_packages_yum() { type yum >/dev/null 2>&1 || return 255 + el9_epel_and_crb_check yum local -a yes=() [[ "$1" = "-y" ]] && yes=("-y") && shift + yum --nogpgcheck "${yes[@]}" install initscripts yum --nogpgcheck "${yes[@]}" install "$@" } @@ -1725,6 +1741,55 @@ function github_issue_5503_workaround() return 0 } +# Check for EPEL and CRB repositories when installing on RH family of OSes +function el9_epel_and_crb_check() +{ + action="$@" # Passed parameter will only be 'yum' or 'dnf' + if [[ "${GO_XCAT_LINUX_DISTRO}" = "fedora" ]] + then + # For Fedora, version 35 is equivalent to EL9 + # But since xCAT currently does not support that version, just + # return and let 'yum install' fail if needed packages are not + # found + return 0 + else + [[ "${GO_XCAT_LINUX_VERSION}" =~ ^9(\.[0-9]) ]] || return 0 + fi + ${action} list -q ${EL9_EPEL_TEST_RPM} + ret="$?" + case "${ret}" in + "1") + # Can not find EL9_EPEL_TEST_RPM + echo " +Installation on ${GO_XCAT_LINUX_DISTRO} ${GO_XCAT_LINUX_VERSION} requires EPEL repository to be enabled" + echo "Running '${action} install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm' will enable EPEL repository" + exit 1 + ;; + esac + ${action} list -q ${EL9_CRB_TEST_RPM} + ret="$?" + case "${ret}" in + "1") + # Can not find EL9_CRB_TEST_RPM + echo " +Installation on ${GO_XCAT_LINUX_DISTRO} ${GO_XCAT_LINUX_VERSION} requires CRB repository to be enabled" + echo "Try adding the following entries to new or existing '.repo' file:" + echo " +[crb] +name=CentOS Stream $releasever - CRB +metalink=https://mirrors.centos.org/metalink?repo=centos-crb-$stream&arch=$basearch&protocol=https,http +gpgcheck=0 +repo_gpgcheck=0 +metadata_expire=6h +countme=1 +enabled=1 + " + exit 1 + ;; + esac + return 0 +} + function install_packages_zypper() { type zypper >/dev/null 2>&1 || return 255 @@ -2291,7 +2356,7 @@ Version: ${GO_XCAT_LINUX_VERSION} EOF case "${GO_XCAT_LINUX_DISTRO}" in -"centos"|"fedora"|"rhel"|"sles"|"ubuntu"|"ol"|"rocky") +"centos"|"fedora"|"rhel"|"sles"|"ubuntu"|"ol"|"rocky"|"almalinux") ;; *) warn_if_bad 1 "${GO_XCAT_LINUX_DISTRO}: unsupported Linux distro" diff --git a/xCAT-server/share/xcat/tools/mktoolscenter b/xCAT-server/share/xcat/tools/mktoolscenter index cd633a785..7066d97ed 100755 --- a/xCAT-server/share/xcat/tools/mktoolscenter +++ b/xCAT-server/share/xcat/tools/mktoolscenter @@ -191,6 +191,8 @@ my $OSVER = "unknown"; if (-e '/etc/SuSE-release') { $OSVER = `grep -h VERSION /etc/SuSE-release |awk '{print $3}'` +} elsif (-e '/etc/SUSE-brand') { + $OSVER = `grep -h VERSION /etc/SUSE-brand |awk '{print $3}'` } elsif (-e '/etc/redhat-release') { $OSVER = "rhels" . `cat /etc/redhat-release |cut -f7 -d' '`; chomp($OSVER); diff --git a/xCAT-server/xCAT-server.spec b/xCAT-server/xCAT-server.spec index 912796a0b..0823f2a1f 100644 --- a/xCAT-server/xCAT-server.spec +++ b/xCAT-server/xCAT-server.spec @@ -28,6 +28,9 @@ AutoReqProv: no # Define a different location for various httpd configs in s390x mode %define httpconfigdir %(if [ "$s390x" = "1" ];then echo "xcathttpdsave"; else echo "xcat"; fi) +# Disable shebang mangling of python scripts +%undefine __brp_mangle_shebangs + # AIX will build with an arch of "ppc" # also need to fix Requires for AIX %ifos linux @@ -37,6 +40,7 @@ BuildArch: noarch %if %s390x Requires: perl-IO-Socket-SSL perl-XML-Simple perl-XML-Parser %else +BuildRequires: perl-generators Requires: perl-IO-Socket-SSL perl-XML-Simple perl-XML-Parser perl-Digest-SHA1 perl(LWP::Protocol::https) perl-XML-LibXML %endif Obsoletes: atftp-xcat diff --git a/xCAT-server/xCAT-wsapi/xcatws.cgi b/xCAT-server/xCAT-wsapi/xcatws.cgi index bd0768137..ac5fbc976 100755 --- a/xCAT-server/xCAT-wsapi/xcatws.cgi +++ b/xCAT-server/xCAT-wsapi/xcatws.cgi @@ -3449,7 +3449,7 @@ sub fetchParameters { # in the sles 11.x, the 'PUTDATA' param is not supported for PUT method # so we have to work around it by getting it by myself unless ($pdata) { - if (-f "/etc/SuSE-release") { # SUSE os + if ((-f "/etc/SuSE-release") || (-f "/etc/SUSE-brand")) { # SUSE os if ($ENV{'CONTENT_TYPE'} =~ /json/) { $q->read_from_client(\$pdata, $ENV{'CONTENT_LENGTH'}); } diff --git a/xCAT-test/autotest/bundle/rhels8_ppcle_weekly.bundle b/xCAT-test/autotest/bundle/rhels8_ppcle_weekly.bundle new file mode 100644 index 000000000..32b9104c3 --- /dev/null +++ b/xCAT-test/autotest/bundle/rhels8_ppcle_weekly.bundle @@ -0,0 +1,39 @@ +#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 +bmcdiscover_h +bmcdiscover_nmap_range +bmcdiscover_v +bmcdiscover_range_w +bmcdiscover_range_z +bmcdiscover_help +bmcdiscover_q +bmcdiscover_version +xcatprobe_work +confignetwork_static_installnic +get_xcat_postscripts_loginfo +nodeset_cmdline +nodeset_runimg +nodeset_shell +nodeset_shell_lzma +reg_linux_diskfull_installation_flat +reg_linux_diskfull_installation_flat_modules_and_groups_rh8 +compare_postscripts +cleanup_postscripts_diskfull +reg_linux_diskless_installation_flat +reg_linux_diskless_installation_flat_squashfs +reg_linux_diskless_installation_flat_modules_and_groups_rh8 +reg_linux_statelite_installation_flat +cleanup_postscripts_diskless +rmimage_diskless +rpower_reset +runcmdinstaller_command +linux_diskless_kdump diff --git a/xCAT-test/autotest/bundle/rhels8_x86_weekly.bundle b/xCAT-test/autotest/bundle/rhels8_x86_weekly.bundle new file mode 100644 index 000000000..d4249a502 --- /dev/null +++ b/xCAT-test/autotest/bundle/rhels8_x86_weekly.bundle @@ -0,0 +1,33 @@ +#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 +bmcdiscover_h +bmcdiscover_nmap_range +bmcdiscover_v +bmcdiscover_range_w +bmcdiscover_range_z +bmcdiscover_help +bmcdiscover_q +bmcdiscover_version +xcatprobe_work +confignetwork_static_installnic +get_xcat_postscripts_loginfo +nodeset_cmdline +nodeset_runimg +nodeset_shell +nodeset_shell_lzma +reg_linux_diskfull_installation_flat +reg_linux_diskfull_installation_flat_modules_and_groups_rh8 +compare_postscripts +cleanup_postscripts_diskfull +reg_linux_diskless_installation_flat +reg_linux_diskless_installation_flat_squashfs +reg_linux_diskless_installation_flat_modules_and_groups_rh8 diff --git a/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle b/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle index d1ef3de1e..a39991440 100644 --- a/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle +++ b/xCAT-test/autotest/bundle/rhels_ppcle_daily.bundle @@ -151,7 +151,6 @@ mkdef_regex_nicsip mkdef_rhels73 mkdef_t_o_error mkdef_z -mkdef_nodename_hit_groupname nodeadd_err_symbol nodeadd_h nodeadd_noderange diff --git a/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle b/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle index 55a98b827..cf89e8abd 100644 --- a/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle +++ b/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle @@ -24,10 +24,12 @@ nodeset_cmdline nodeset_runimg nodeset_shell reg_linux_diskfull_installation_flat +reg_linux_diskfull_installation_flat_groups_rh7 compare_postscripts cleanup_postscripts_diskfull reg_linux_diskless_installation_flat reg_linux_diskless_installation_flat_squashfs +reg_linux_diskless_installation_flat_groups_rh7 reg_linux_statelite_installation_flat cleanup_postscripts_diskless rmimage_diskless diff --git a/xCAT-test/autotest/bundle/rhels_x86_daily.bundle b/xCAT-test/autotest/bundle/rhels_x86_daily.bundle index e4f886992..608e862ee 100644 --- a/xCAT-test/autotest/bundle/rhels_x86_daily.bundle +++ b/xCAT-test/autotest/bundle/rhels_x86_daily.bundle @@ -151,7 +151,6 @@ mkdef_regex_nicsip mkdef_rhels73 mkdef_t_o_error mkdef_z -mkdef_nodename_hit_groupname nodeadd_err_symbol nodeadd_h nodeadd_noderange diff --git a/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle b/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle index 5cb54620a..5f2d4b16e 100644 --- a/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle +++ b/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle @@ -24,10 +24,12 @@ nodeset_cmdline nodeset_runimg nodeset_shell reg_linux_diskfull_installation_flat +reg_linux_diskfull_installation_flat_groups_rh7 compare_postscripts cleanup_postscripts_diskfull reg_linux_diskless_installation_flat reg_linux_diskless_installation_flat_squashfs +reg_linux_diskless_installation_flat_groups_rh7 reg_linux_statelite_installation_flat cleanup_postscripts_diskless rmimage_diskless diff --git a/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle b/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle index dd1b0bad0..db5fb3832 100644 --- a/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle +++ b/xCAT-test/autotest/bundle/sles_ppcle_daily.bundle @@ -110,7 +110,6 @@ mkdef_regex_kvm mkdef_regex_nicsip mkdef_t_o_error mkdef_z -mkdef_nodename_hit_groupname nodeadd_err_symbol nodeadd_h nodeadd_noderange diff --git a/xCAT-test/autotest/bundle/sles_x86_daily.bundle b/xCAT-test/autotest/bundle/sles_x86_daily.bundle index dbe30b6e3..33c28f32a 100644 --- a/xCAT-test/autotest/bundle/sles_x86_daily.bundle +++ b/xCAT-test/autotest/bundle/sles_x86_daily.bundle @@ -110,7 +110,6 @@ mkdef_regex_kvm mkdef_regex_nicsip mkdef_t_o_error mkdef_z -mkdef_nodename_hit_groupname nodeadd_err_symbol nodeadd_h nodeadd_noderange diff --git a/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle b/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle index 41ed0bcc5..b0182265c 100644 --- a/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle +++ b/xCAT-test/autotest/bundle/ubuntu_ppcle_daily.bundle @@ -79,7 +79,6 @@ mkdef_regex_kvm mkdef_regex_nicsip mkdef_t_o_error mkdef_z -mkdef_nodename_hit_groupname nodeadd_err_symbol nodeadd_h nodeadd_noderange diff --git a/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle b/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle index c2f8b10d3..154c66025 100644 --- a/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle +++ b/xCAT-test/autotest/bundle/ubuntu_x86_daily.bundle @@ -81,7 +81,6 @@ mkdef_regex_kvm mkdef_regex_nicsip mkdef_t_o_error mkdef_z -mkdef_nodename_hit_groupname nodeadd_err_symbol nodeadd_h nodeadd_noderange diff --git a/xCAT-test/autotest/testcase/confignetwork/cases0 b/xCAT-test/autotest/testcase/confignetwork/cases0 index c76620631..7585a857e 100644 --- a/xCAT-test/autotest/testcase/confignetwork/cases0 +++ b/xCAT-test/autotest/testcase/confignetwork/cases0 @@ -34,7 +34,7 @@ check:rc==0 check:output=~booted 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|Rocky" /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: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|Rocky|Alma" /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=~BOOTPROTO=none|static @@ -84,7 +84,7 @@ check:rc==0 check:output=~booted 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|Rocky" /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|Rocky|Alma" /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 @@ -137,11 +137,11 @@ 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 -E "Red Hat|CentOS|Rocky" /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|Rocky|Alma" /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=~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|Rocky" /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 +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|Rocky|Alma" /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=~BOOTPROTO=none|static @@ -162,7 +162,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 -E "Red Hat|CentOS|Rocky" /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 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS|Rocky|Alma" /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: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 @@ -173,16 +173,16 @@ check:rc==0 cmd:rmdef -t network -o confignetworks_test1 cmd:if [ -e /tmp/CN.stanza ]; then rmdef $$CN; cat /tmp/CN.stanza | mkdef -z; rm -rf /tmp/CN.stanza; fi check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\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|Rocky" /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 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\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|Rocky|Alma" /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|Rocky" /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|Rocky|Alma" /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,3}(\..*)/\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|Rocky" /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 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS|Rocky|Alma" /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|Rocky" /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:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS|Rocky|Alma" /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 @@ -195,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 -E "Red Hat|CentOS|Rocky" /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 SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS|Rocky|Alma" /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 @@ -206,14 +206,14 @@ check:rc==0 cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 cmd:if [ -e /tmp/CN.stanza ]; then rmdef $$CN; cat /tmp/CN.stanza | mkdef -z; rm -rf /tmp/CN.stanza; fi check:rc==0 -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|Rocky" /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|Rocky|Alma" /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|Rocky" /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 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep MTU /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS|Rocky|Alma" /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|Rocky" /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 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS|Rocky|Alma" /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|Rocky" /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:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS|Rocky|Alma" /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 @@ -226,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 -E "Red Hat|CentOS|Rocky" /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 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS|Rocky|Alma" /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: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 @@ -243,10 +243,10 @@ check:output=~aliases1-2 cmd:updatenode $$CN -P confignetwork check:rc==0 cmd:xdsh $$CN date -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS|Rocky" /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|Rocky|Alma" /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=~BOOTPROTO=none|static -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS|Rocky" /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|Rocky|Alma" /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=~12.1.0.100 check:output=~BOOTPROTO=none|static cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 @@ -254,7 +254,7 @@ 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" check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC";xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts";xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/";elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -f /etc/network/interfaces.d/$$SECONDNIC /etc/network/interfaces.d/$$SECONDNIC:1";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 "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC";xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS|Rocky|Alma" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts";xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/";elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -f /etc/network/interfaces.d/$$SECONDNIC /etc/network/interfaces.d/$$SECONDNIC:1";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:if [ -e /tmp/CN.stanza ]; then rmdef $$CN; cat /tmp/CN.stanza | mkdef -z; rm -rf /tmp/CN.stanza; fi @@ -273,7 +273,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 -E "Red Hat|CentOS|Rocky" /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 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS|Rocky|Alma" /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:cp -f /etc/hosts /etc/hosts.bak 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 @@ -289,26 +289,26 @@ check:output=~$$CN-$$SECONDNIC-1 check:output=~$$CN-$$SECONDNIC-2 cmd:updatenode $$CN -P confignetwork check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\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|Rocky" /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 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\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|Rocky|Alma" /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:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS|Rocky" /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 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS|Rocky|Alma" /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,3}(\..*)/\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|Rocky" /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 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\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|Rocky|Alma" /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:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS|Rocky" /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 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS|Rocky|Alma" /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=~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|Rocky" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; 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|Rocky|Alma" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; 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,3}(\..*)/\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,3}(\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" cmd:if [ -e /tmp/CN.stanza ]; then rmdef $$CN; cat /tmp/CN.stanza | mkdef -z; rm -rf /tmp/CN.stanza; 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|Rocky" /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:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS|Rocky|Alma" /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/" @@ -379,7 +379,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 -E "Red Hat|CentOS|Rocky" /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|Rocky|Alma" /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 @@ -401,7 +401,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 -E "Red Hat|CentOS|Rocky" /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|Rocky|Alma" /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 @@ -447,7 +447,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 -E "Red Hat|CentOS|Rocky" /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 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS|Rocky|Alma" /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 check:rc==0 @@ -473,21 +473,21 @@ check:output=~$$CN-$$THIRDNIC-2 cmd:updatenode $$CN -P confignetwork check:rc==0 cmd:xdsh $$CN date -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|Rocky" /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|Rocky|Alma" /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 -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; 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|Rocky|Alma" /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; 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 -E "Red Hat|CentOS|Rocky" /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|Rocky|Alma" /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 -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "grep 14.1.0.100 /etc/sysconfig/network-scripts/ifcfg-*$$THIRDNIC*"; 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|Rocky|Alma" /etc/*release;then xdsh $$CN "grep 14.1.0.100 /etc/sysconfig/network-scripts/ifcfg-*$$THIRDNIC*"; 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 -E "Red Hat|CentOS|Rocky" /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 /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|Rocky|Alma" /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 /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 -E "Red Hat|CentOS|Rocky" /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/$$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|Rocky|Alma" /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/$$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" @@ -496,7 +496,7 @@ cmd:xdsh $$CN "ip addr del 14.1.0.100/16 dev $$THIRDNIC" cmd:if [ -e /tmp/CN.stanza ]; then rmdef $$CN; cat /tmp/CN.stanza | mkdef -z; rm -rf /tmp/CN.stanza; 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|Rocky" /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:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS|Rocky|Alma" /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/" @@ -511,7 +511,7 @@ check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 -cmd:xdsh $$CN "if grep SUSE /etc/*release;then cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/; elif grep -E \"Red Hat|CentOS|Rocky\" /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:xdsh $$CN "if grep SUSE /etc/*release;then cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/; elif grep -E \"Red Hat|CentOS|Rocky|Alma\" /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:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 @@ -524,7 +524,7 @@ cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=105.;var4=`echo $cnip |awk -F. check:rc==0 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:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\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|Rocky\" /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" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\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|Rocky|Alma\" /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,3}(\..*)/\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 @@ -532,11 +532,11 @@ cmd:updatenode $$CN -P confignetwork check:rc==0 cmd:if [ -e /tmp/CN.stanza ]; then rmdef $$CN; cat /tmp/CN.stanza | mkdef -z; rm -rf /tmp/CN.stanza; fi check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=105;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\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|Rocky\" /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" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=105;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\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|Rocky|Alma\" /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,3}(\..*)/\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|Rocky\" /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" +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var2=106;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\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|Rocky|Alma\" /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|Rocky\" /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" +cmd:xdsh $$CN "if grep SUSE /etc/*release;then rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC; elif grep -E \"Red Hat|CentOS|Rocky|Alma\" /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,3}(\..*)/\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,3}(\..*)/\1/'`;second7ip=$var2$var3;xdsh $$CN "ip addr del $second7ip/8 dev $$SECONDNIC.7" @@ -546,9 +546,9 @@ 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,3}(\..*)/\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|Rocky\" /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" +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|Rocky|Alma\" /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|Rocky\" /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" +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|Rocky|Alma\" /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 @@ -563,14 +563,14 @@ check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 -cmd:xdsh $$CN "if grep SUSE /etc/*release;then cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/; elif grep -E \"Red Hat|CentOS|Rocky\" /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:xdsh $$CN "if grep SUSE /etc/*release;then cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/; elif grep -E \"Red Hat|CentOS|Rocky|Alma\" /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:xdsh $$CN "if grep SUSE /etc/*release;then grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC; elif grep -E \"Red Hat|CentOS|Rocky\" /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" +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|Rocky|Alma\" /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 @@ -589,11 +589,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:xdsh $$CN "if grep SUSE /etc/*release;then rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC; elif grep -E \"Red Hat|CentOS|Rocky\" /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" +cmd:xdsh $$CN "if grep SUSE /etc/*release;then rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC; elif grep -E \"Red Hat|CentOS|Rocky|Alma\" /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.stanza ]; then rmdef $$CN; cat /tmp/CN.stanza | mkdef -z; rm -rf /tmp/CN.stanza; 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.*|Rocky .* 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" +cmd:xdsh $$CN "if grep SUSE /etc/*release;then cp -f /tmp/backupnet/* /etc/sysconfig/network/; elif grep -E \"Red Hat .* 8.*|CentOS .* 8.*|Rocky .* 8.*|AlmaLinux .* 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 @@ -608,8 +608,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 -E "Red Hat|CentOS|Rocky" /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|Rocky" /etc/*release;then xdsh $$CN "if yum -q list bridge-utils ; then yum -y install bridge-utils; fi";fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS|Rocky|Alma" /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|Rocky|Alma" /etc/*release;then xdsh $$CN "if yum -q list bridge-utils ; then yum -y install bridge-utils; fi";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:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 @@ -632,23 +632,23 @@ cmd:xdsh $$CN "ls /sys/class/net" check:output=~bond0 cmd:xdsh $$CN "cat /sys/class/net/bonding_masters" check:output=~bond0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\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|Rocky" /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 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\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|Rocky|Alma" /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 confignetworks_test1 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS|Rocky" /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|Rocky|Alma" /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_test2 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS|Rocky" /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|Rocky|Alma" /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,3}(\..*)/\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 -E "Red Hat|CentOS|Rocky" /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 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-bond0"; elif grep -E "Red Hat|CentOS|Rocky|Alma" /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.stanza ]; then rmdef $$CN; cat /tmp/CN.stanza | mkdef -z; rm -rf /tmp/CN.stanza; 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|Rocky" /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:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS|Rocky|Alma" /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" @@ -664,8 +664,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 -E "Red Hat|CentOS|Rocky" /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|Rocky" /etc/*release;then xdsh $$CN "if yum -q list bridge-utils ; then yum -y install bridge-utils; fi";fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS|Rocky|Alma" /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|Rocky|Alma" /etc/*release;then xdsh $$CN "if yum -q list bridge-utils ; then yum -y install bridge-utils; fi";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:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 @@ -690,15 +690,15 @@ check:rc!=0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\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,3}(\..*)/\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|Rocky" /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|Rocky|Alma" /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_test2 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS|Rocky" /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|Rocky|Alma" /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:if [ -e /tmp/CN.stanza ]; then rmdef $$CN; cat /tmp/CN.stanza | mkdef -z; rm -rf /tmp/CN.stanza; 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|Rocky" /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|Rocky|Alma" /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 @@ -713,8 +713,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 -E "Red Hat|CentOS|Rocky" /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 -cmd:if grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "if yum -q list bridge-utils ; then yum -y install bridge-utils; fi";fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS|Rocky|Alma" /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 +cmd:if grep -E "Red Hat|CentOS|Rocky|Alma" /etc/*release;then xdsh $$CN "if yum -q list bridge-utils ; then yum -y install bridge-utils; fi";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:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 @@ -735,9 +735,9 @@ cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=103;var3=`echo $cnip check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\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|Rocky" /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 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\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|Rocky|Alma" /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,3}(\..*)/\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|Rocky" /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 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var2=103;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\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|Rocky|Alma" /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 @@ -746,10 +746,10 @@ check:output=~bond0.3 cmd:xdsh $$CN "cat /sys/class/net/bonding_masters" check:output=~bond0 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|Rocky" /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 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS|Rocky|Alma" /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: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|Rocky" /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/$$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|Rocky|Alma" /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/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:rmdef -t network -o confignetworks_test3 cmd:rmdef -t network -o confignetworks_test4 @@ -761,11 +761,11 @@ 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 -E "Red Hat|CentOS|Rocky" /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 /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|Rocky|Alma" /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 /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.stanza ]; then rmdef $$CN; cat /tmp/CN.stanza | mkdef -z; rm -rf /tmp/CN.stanza; 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|Rocky" /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:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS|Rocky|Alma" /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" @@ -781,8 +781,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 -E "Red Hat|CentOS|Rocky" /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|Rocky" /etc/*release;then xdsh $$CN "if yum -q list bridge-utils ; then yum -y install bridge-utils; fi";fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS|Rocky|Alma" /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|Rocky|Alma" /etc/*release;then xdsh $$CN "if yum -q list bridge-utils ; then yum -y install bridge-utils; fi";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:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 @@ -807,13 +807,13 @@ cmd:xdsh $$CN "ls /sys/class/net" check:output=~br0 cmd:xdsh $$CN "cat /sys/class/net/bonding_masters" check:output=~bond0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=103;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\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|Rocky" /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 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=103;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\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|Rocky|Alma" /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 confignetworks_test1 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS|Rocky" /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|Rocky|Alma" /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_test2 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS|Rocky" /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|Rocky|Alma" /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_test cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=103;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;br0ip=$var1$var2;xdsh $$CN "ip addr del $br0ip/16 dev br0" @@ -821,11 +821,11 @@ cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r ' cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\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 -E "Red Hat|CentOS|Rocky" /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 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-br0"; elif grep -E "Red Hat|CentOS|Rocky|Alma" /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.stanza ]; then rmdef $$CN; cat /tmp/CN.stanza | mkdef -z; rm -rf /tmp/CN.stanza; 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|Rocky" /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:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS|Rocky|Alma" /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" cmd:chtab -d node=$$CN nics @@ -839,8 +839,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 -E "Red Hat|CentOS|Rocky" /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 -cmd:if grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "if yum -q list bridge-utils ; then yum -y install bridge-utils; fi";fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS|Rocky|Alma" /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 +cmd:if grep -E "Red Hat|CentOS|Rocky|Alma" /etc/*release;then xdsh $$CN "if yum -q list bridge-utils ; then yum -y install bridge-utils; fi";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:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$SECONDNIC=$second1ip nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=confignetworks_test1 @@ -860,9 +860,9 @@ cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=103;var3=`echo $cnip check:rc==0 cmd:updatenode $$CN -P confignetwork -t 1800 check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\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|Rocky" /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 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\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|Rocky|Alma" /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:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=103;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\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|Rocky" /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 +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=103;var3=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\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|Rocky|Alma" /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 @@ -873,7 +873,7 @@ cmd:xdsh $$CN "ip addr show bond0.3" cmd:xdsh $$CN "ip addr show br33" 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|Rocky" /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 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS|Rocky|Alma" /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:rmdef -t network -o confignetworks_test3 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\1/'`;br22ip=$var1$var2;xdsh $$CN "ip addr del $br22ip/16 dev br22" @@ -887,11 +887,11 @@ cmd:xdsh $$CN "ip link del dev bond0" cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]{1,3}(\..*)/\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,3}(\..*)/\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 -E "Red Hat|CentOS|Rocky" /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 /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|Rocky|Alma" /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 /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.stanza ]; then rmdef $$CN; cat /tmp/CN.stanza | mkdef -z; rm -rf /tmp/CN.stanza; 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|Rocky" /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:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS|Rocky|Alma" /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" @@ -906,8 +906,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 -E "Red Hat|CentOS|Rocky" /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 -cmd:if grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "if yum -q list bridge-utils ; then yum -y install bridge-utils; fi";fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS|Rocky|Alma" /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 +cmd:if grep -E "Red Hat|CentOS|Rocky|Alma" /etc/*release;then xdsh $$CN "if yum -q list bridge-utils ; then yum -y install bridge-utils; fi";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 @@ -924,25 +924,25 @@ 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 -E "Red Hat|CentOS|Rocky" /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|Rocky|Alma" /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:xdsh $$CN "cat /sys/class/net/bonding_masters" check:output=~bond0 -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|Rocky" /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 +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|Rocky|Alma" /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 -E "Red Hat|CentOS|Rocky" /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|Rocky|Alma" /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" check:output=~br22 check:output=~br33 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 -E "Red Hat|CentOS|Rocky" /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 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS|Rocky|Alma" /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 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 -E "Red Hat|CentOS|Rocky" /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/$$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|Rocky|Alma" /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/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi 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:xdsh $$CN "ip link del dev br22" @@ -954,7 +954,7 @@ 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";xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/";elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts";xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/";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";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 "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";xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/";elif grep -E "Red Hat|CentOS|Rocky|Alma" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts";xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/";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";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:if [ -e /tmp/CN.stanza ]; then rmdef $$CN; cat /tmp/CN.stanza | mkdef -z; rm -rf /tmp/CN.stanza; fi @@ -973,8 +973,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 -E "Red Hat|CentOS|Rocky" /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|Rocky" /etc/*release;then xdsh $$CN "if yum -q list bridge-utils ; then yum -y install bridge-utils; fi";fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS|Rocky|Alma" /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|Rocky|Alma" /etc/*release;then xdsh $$CN "if yum -q list bridge-utils ; then yum -y install bridge-utils; fi";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 @@ -994,7 +994,7 @@ cmd:xdsh $$CN "ip link del dev bond0.3" cmd:xdsh $$CN "ip link del dev bond0" cmd:if [ -e /tmp/CN.stanza ]; then rmdef $$CN; cat /tmp/CN.stanza | mkdef -z; rm -rf /tmp/CN.stanza; 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|Rocky" /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|Rocky|Alma" /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" cmd:chtab -d node=$$CN nics end @@ -1006,7 +1006,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 -E "Red Hat|CentOS|Rocky" /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 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS|Rocky|Alma" /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" @@ -1018,7 +1018,7 @@ 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" diff --git a/xCAT-test/autotest/testcase/genesis/cases0 b/xCAT-test/autotest/testcase/genesis/cases0 index ed1b4ee59..e2e7e7ca8 100644 --- a/xCAT-test/autotest/testcase/genesis/cases0 +++ b/xCAT-test/autotest/testcase/genesis/cases0 @@ -1,3 +1,30 @@ +start:nodeset_shell_lzma +os:rhels8 +label:others,genesis +description: verify could log in genesis shell lzma compression +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "rhel" ]]; then yum install -y https://rpmfind.net/linux/centos/8-stream/PowerTools/__GETNODEATTR($$CN,arch)__/os/Packages/xz-lzma-compat-5.2.4-3.el8.__GETNODEATTR($$CN,arch)__.rpm; elif rpm -q xz; then yum download https://rpmfind.net/linux/centos/8-stream/PowerTools/__GETNODEATTR($$CN,arch)__/os/Packages/xz-lzma-compat-5.2.4-3.el8.__GETNODEATTR($$CN,arch)__.rpm; rpm -ivh --nodeps xz-lzma-compat-5.2.4-3.el8.__GETNODEATTR($$CN,arch)__.rpm; fi +#Generate genesis network boot with lzma compression +cmd:mknb __GETNODEATTR($$CN,arch)__ +check:rc==0 +cmd:nodeset $$CN shell +check:rc==0 +cmd:ls -l /tftpboot/xcat/genesis.fs.*.lzma +check:output=~genesis +cmd:find /tftpboot -type f -name $$CN | xargs grep "lzma" +check:output=~genesis +cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n $$CN -g +check:rc==0 +cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n $$CN -s +check:rc==0 +cmd:perl /opt/xcat/share/xcat/tools/autotest/testcase/genesis/genesistest.pl -n $$CN -c +check:rc==0 +cmd:cat /tmp/genesistestlog/* +#Remove lzma compression RPM, cleanup and generate default gz genesis network boot +cmd:yum remove -y xz-lzma-compat +cmd:rm -f /tftpboot/xcat/genesis.fs.*.lzma +cmd:mknb __GETNODEATTR($$CN,arch)__ +end + start:nodeset_shell label:others,genesis description: verify could log in genesis shell diff --git a/xCAT-test/autotest/testcase/go_xcat/case3 b/xCAT-test/autotest/testcase/go_xcat/case3 index 7c1ea5a9a..a62653d02 100644 --- a/xCAT-test/autotest/testcase/go_xcat/case3 +++ b/xCAT-test/autotest/testcase/go_xcat/case3 @@ -39,6 +39,35 @@ check:output=~Version cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running + +#Uninstall xCAT, then install again and verify public keys +cmd:xdsh $$CN "cd /; ./go-xcat -y completely uninstall" +check:rc==0 +check:output=~xCAT has been uninstalled + +#Remove --nogpgcheck (yum/dnf) --no-gpg-checks (zypper) and --allow-unauthenticated (apt-get) flags from go-xcat +# to install xCAT public key when installing packages +cmd:xdsh $$CN "sed -i 's/\-\-nogpgcheck//g' /go-xcat" +cmd:xdsh $$CN "sed -i 's/\-\-no\-gpg\-checks//g' /go-xcat" +cmd:xdsh $$CN "sed -i 's/\-\-allow\-unauthenticated//g' /go-xcat" + +#Install devel version of xCAT. If first attempt fails, try again +cmd:xdsh $$CN "cd /; ./go-xcat --xcat-version=devel -y install" +cmd:version=`xdsh $$CN /opt/xcat/bin/lsxcatd -v`; if [[ $version =~ "Version" ]]; then echo "xCAT installed successfully first time"; else echo "First attempt to install xCAT failed, attempting to install xCAT again"; xdsh $$CN "cd /; ./go-xcat --xcat-version=devel -y install"; fi + +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh; lsxcatd -v" +check:output=~Version +cmd:xdsh $$CN "service xcatd status" +check:rc==0 +check:output=~running + +#Verify xCAT public key was installed +cmd:if [[ "$$OS" =~ "ubuntu" ]]; then xdsh $$CN "apt-key list"; else xdsh $$CN "rpm -q gpg-pubkey --qf '%{name}-%{version}-%{release} --> %{summary}\n'"; fi +check:output=~xCAT Automatic Signing Key + +#Remove public key on non-Ubuntu system. It was installed during go-xcat RPM installs +cmd:if [[ "$$OS" != "ubuntu" ]]; then xdsh $$CN "rpm -e gpg-pubkey-ca548a47-5b2c830b"; fi + cmd:xdsh $$CN "service xcatd stop" end diff --git a/xCAT-test/autotest/testcase/go_xcat/focal-x86_64.sources.list b/xCAT-test/autotest/testcase/go_xcat/focal-x86_64.sources.list new file mode 100644 index 000000000..b355e6871 --- /dev/null +++ b/xCAT-test/autotest/testcase/go_xcat/focal-x86_64.sources.list @@ -0,0 +1,3 @@ +deb http://archive.ubuntu.com/ubuntu focal main restricted universe +deb http://archive.ubuntu.com/ubuntu focal-updates main restricted universe +deb http://archive.ubuntu.com/ubuntu focal-security main restricted universe diff --git a/xCAT-test/autotest/testcase/install_xCAT/case0 b/xCAT-test/autotest/testcase/install_xCAT/case0 index c39f5cfd2..e5d309f9e 100644 --- a/xCAT-test/autotest/testcase/install_xCAT/case0 +++ b/xCAT-test/autotest/testcase/install_xCAT/case0 @@ -21,6 +21,16 @@ check:rc==0 check:output=~running cmd:rm -rf /install_xCAT_xcat-core.tar.bz2 /install_xCAT_xcat-dep.tar.bz2 +# Check host keys supported by the operating system and report new ones, if any. +cmd:echo -e "dsa\necdsa\ned25519\nrsa\nrsa1" > /tmp/known_host_keys +check:rc==0 +cmd:ssh-keygen --help 2>&1 | grep "\[-t" | sed -E 's/.*(\[\-t.*)/\1/' | cut -d "[" -f2 | cut -d "]" -f1 | sed 's/-t//' | sed 's/|//g' | xargs -n 1 | grep -v '\-sk' > /tmp/current_os_host_keys +check:rc==0 +cmd:diff /tmp/known_host_keys /tmp/current_os_host_keys +check:output!~> +cmd:rm -f /tmp/known_host_keys /tmp/current_os_host_keys +check:rc==0 + # Obtain the highest version of TLS supported by OpenSSL/TLS. cmd:openssl s_client --help 2>&1 | grep "\-tls1" | awk '{print $1}' | sort | tail -1 check:rc==0 @@ -61,6 +71,16 @@ cmd:sleep 5 cmd:service goconserver status cmd:service conserver status +# Check host keys supported by the operating system and report new ones, if any. +cmd:echo -e "dsa\necdsa\ned25519\nrsa\nrsa1" > /tmp/known_host_keys +check:rc==0 +cmd:ssh-keygen --help 2>&1 | grep "\[-t" | sed -E 's/.*(\[\-t.*)/\1/' | cut -d "[" -f2 | cut -d "]" -f1 | sed 's/-t//' | sed 's/|//g' | xargs -n 1 | grep -v '\-sk' > /tmp/current_os_host_keys +check:rc==0 +cmd:diff /tmp/known_host_keys /tmp/current_os_host_keys +check:output!~> +cmd:rm -f /tmp/known_host_keys /tmp/current_os_host_keys +check:rc==0 + # Obtain the highest version of TLS supported by OpenSSL/TLS. cmd:openssl s_client --help 2>&1 | grep "\-tls1" | awk '{print $1}' | sort | tail -1 check:rc==0 diff --git a/xCAT-test/autotest/testcase/installation/SN_setup_case b/xCAT-test/autotest/testcase/installation/SN_setup_case index 37d62ec2b..68ceac5d6 100644 --- a/xCAT-test/autotest/testcase/installation/SN_setup_case +++ b/xCAT-test/autotest/testcase/installation/SN_setup_case @@ -24,13 +24,13 @@ 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\|Rocky" >/dev/null;then cat /var/lib/dhcpd/dhcpd.leases|grep $$SN;fi +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\|Rocky\|AlmaLinux" >/dev/null;then cat /var/lib/dhcpd/dhcpd.leases|grep $$SN;fi check:output=~$$SN cmd:chdef -t node $$SN groups=service,all check:rc==0 cmd:chdef -t group -o service profile=service primarynic=mac installnic=mac check:rc==0 -cmd:chdef -t group -o service setupnfs=1 setupdhcp=1 setuptftp=1 setupnameserver=1 setupconserver=1 setupntp=1 +cmd:chdef -t group -o service setupnfs=1 setupdhcp=1 setuptftp=1 setupnameserver=1 setupconserver=2 setupntp=1 check:rc==0 cmd:chdef -t group -o service nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN monserver=$$MN check:rc==0 @@ -46,13 +46,13 @@ 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";path2="rh";elif [[ "__GETNODEATTR($$SN,os)__" =~ "sle" ]];then path="sles";path2="sles";elif [[ "__GETNODEATTR($$SN,os)__" =~ "ol" ]];then path="ol";path2="rh";elif [[ "__GETNODEATTR($$SN,os)__" =~ "rocky" ]];then path="rocky";path2="rh";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/$path2$ver/__GETNODEATTR($$SN,arch)__ && createrepo .; +cmd:if [[ "__GETNODEATTR($$SN,os)__" =~ "rh" ]]; then path="rh";path2="rh";elif [[ "__GETNODEATTR($$SN,os)__" =~ "sle" ]];then path="sles";path2="sles";elif [[ "__GETNODEATTR($$SN,os)__" =~ "ol" ]];then path="ol";path2="rh";elif [[ "__GETNODEATTR($$SN,os)__" =~ "rocky" ]];then path="rocky";path2="rh";elif [[ "__GETNODEATTR($$SN,os)__" =~ "alma" ]];then path="alma";path2="rh";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/$path2$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)__" =~ "sle" ]];then path="sles";elif [[ "__GETNODEATTR($$SN,os)__" =~ "ol" ]];then path="ol";elif [[ " __GETNODEATTR($$SN,os)__" =~ "rocky" ]];then path="rocky";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)__" =~ "sle" ]];then path="sles";elif [[ "__GETNODEATTR($$SN,os)__" =~ "ol" ]];then path="ol";elif [[ "__GETNODEATTR($$SN,os)__" =~ "rocky" ]];then path="rocky";elif [[ "__GETNODEATTR($$SN,os)__" =~ "alma" ]];then path="alma";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 #add support python in sn @@ -100,7 +100,7 @@ check:output=~IMAGENAME=__GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-inst 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:xdsh $$SN "cat /var/log/xcat/xcat.log" -cmd:if [[ "__GETNODEATTR($$SN,arch)__" =~ "x86_64" ]]; then if [[ "__GETNODEATTR($$SN,os)__" =~ "sle" ]];then xdsh $$SN "zypper -n install perl-Sys-Virt"; elif [[ "__GETNODEATTR($$SN,os)__" =~ "rh" || "__GETNODEATTR($$SN,os)__" =~ "ol" || "__GETNODEATTR($$SN,os)__" =~ "rocky" ]];then xdsh $$SN "yum install -y perl-Sys-Virt";fi;fi +cmd:if [[ "__GETNODEATTR($$SN,arch)__" =~ "x86_64" ]]; then if [[ "__GETNODEATTR($$SN,os)__" =~ "sle" ]];then xdsh $$SN "zypper -n install perl-Sys-Virt"; elif [[ "__GETNODEATTR($$SN,os)__" =~ "rh" || "__GETNODEATTR($$SN,os)__" =~ "ol" || "__GETNODEATTR($$SN,os)__" =~ "rocky" || "__GETNODEATTR($$SN,os)__" =~ "alma" ]];then xdsh $$SN "yum install -y perl-Sys-Virt";fi;fi check:rc==0 cmd:makentp -a check:rc==0 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 db489679d..199fcabaa 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat @@ -79,7 +79,7 @@ cmd:xdsh $$CN "grep 'load host key' /var/log/xcat/xcat.log || echo 'No load host check:output=~No load hostkey warning # Check node can be rebooted from disk cmd:xdsh $$CN shutdown -r now -cmd:sleep 300 +cmd:sleep 360 cmd:xdsh $$CN uptime check:rc==0 check:output=~up diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat_modules_and_groups b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat_modules_and_groups new file mode 100644 index 000000000..21cfa2feb --- /dev/null +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat_modules_and_groups @@ -0,0 +1,80 @@ +start:reg_linux_diskfull_installation_flat_modules_and_groups_rh8 +description:Test provision and updatenode with yum groups and modules. Runs only on RH8 +os:rhels8 +label:flat_cn_diskful,provision +cmd:cp /opt/xcat/share/xcat/install/rh/compute.rhels8.pkglist /opt/xcat/share/xcat/install/rh/compute.pkglist.modules +cmd:echo "@Security Tools" >> /opt/xcat/share/xcat/install/rh/compute.pkglist.modules +cmd:echo "@ruby:2.6" >> /opt/xcat/share/xcat/install/rh/compute.pkglist.modules +cmd:chdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute pkglist=/opt/xcat/share/xcat/install/rh/compute.pkglist.modules +cmd:cat /opt/xcat/share/xcat/install/rh/compute.pkglist.modules +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:ping $$CN -c 3 +check:rc==0 +check:output=~64 bytes from $$CN +cmd:lsdef -l $$CN | grep status +check:rc==0 +check:output=~booted +cmd:xdsh $$CN date +check:rc==0 +# Verify group and module were installed +cmd:xdsh $$CN yum group list installed +check:output=~Security Tools +cmd:xdsh $$CN yum module list --installed +check:output=~ruby 2.6 +# Verify group and module can be removed +cmd:cp /opt/xcat/share/xcat/install/rh/compute.rhels8.pkglist /opt/xcat/share/xcat/install/rh/compute.pkglist.modules +cmd:echo "-@Security Tools" >> /opt/xcat/share/xcat/install/rh/compute.pkglist.modules +cmd:echo "-@ruby:2.6" >> /opt/xcat/share/xcat/install/rh/compute.pkglist.modules +cmd:updatenode $$CN -P ospkgs +check:rc==0 +cmd:xdsh $$CN yum group list installed +check:output!~Security Tools +cmd:xdsh $$CN yum module list --installed +check:output!~ruby 2.6 +# Cleanup +cmd:chdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute pkglist=/opt/xcat/share/xcat/install/rh/compute.rhels8.pkglist +cmd:rm /opt/xcat/share/xcat/install/rh/compute.pkglist.modules +end + +start:reg_linux_diskfull_installation_flat_groups_rh7 +description:Test provision and updatenode with yum groups. Runs only on RH7 +os:rhels7 +label:flat_cn_diskful,provision +cmd:cp /opt/xcat/share/xcat/install/rh/compute.rhels7.pkglist /opt/xcat/share/xcat/install/rh/compute.pkglist.modules +cmd:echo "@Security Tools" >> /opt/xcat/share/xcat/install/rh/compute.pkglist.modules +cmd:chdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute pkglist=/opt/xcat/share/xcat/install/rh/compute.pkglist.modules +cmd:cat /opt/xcat/share/xcat/install/rh/compute.pkglist.modules +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:ping $$CN -c 3 +check:rc==0 +check:output=~64 bytes from $$CN +cmd:lsdef -l $$CN | grep status +check:rc==0 +check:output=~booted +cmd:xdsh $$CN date +check:rc==0 +# Verify group was installed by cheking individual RPMs +cmd:xdsh $$CN rpm -q xml-common openscap-scanner openscap scap-security-guide +check:output=~xml-common- +check:output=~openscap-scanner- +check:output=~openscap- +check:output=~scap-security-guide- +# Verify group can be removed (manually install, then remove using updatenode) +cmd:xdsh $$CN yum group install -y compat-libraries +check:rc==0 +cmd:xdsh $$CN yum group list installed +check:output=~Compatibility Libraries +cmd:cp /opt/xcat/share/xcat/install/rh/compute.rhels7.pkglist /opt/xcat/share/xcat/install/rh/compute.pkglist.modules +cmd:echo "-@Compatibility Libraries" >> /opt/xcat/share/xcat/install/rh/compute.pkglist.modules +cmd:updatenode $$CN -P ospkgs +check:rc==0 +cmd:xdsh $$CN yum group list installed +check:output!~Compatibility Libraries +# Cleanup +cmd:chdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute pkglist=/opt/xcat/share/xcat/install/rh/compute.rhels7.pkglist +cmd:rm /opt/xcat/share/xcat/install/rh/compute.pkglist.modules +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 2c0a0252a..1d2ed7413 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat @@ -20,7 +20,7 @@ cmd:makedhcp -n check:rc==0 cmd:makedhcp -a check:rc==0 -cmd:a=0;while true; do [ $a -eq 100 ] && { echo "After 100 iterations, makedhcp -q $$CN did not return any output"; makedhcp -q all; exit 1; }; output=$(makedhcp -q $$CN);[ $? -ne 0 ] && exit 1;echo $output|grep $$CN 2>/dev/null && exit 0;echo "[$a] Waiting for makedhcp -q $$CN to return output"; a=$[$a+1]; sleep 1;done +cmd:a=0;while true; do [ $a -eq 10 ] && { echo "After 10 iterations, makedhcp -q $$CN did not return any output"; makedhcp -q all; exit 1; }; [ $a -eq 5 ] && { echo "After 5 iterations, makedhcp -q $$CN did not return any output. Retrying makedhcp -a again"; makedhcp -a; }; output=$(makedhcp -q $$CN);[ $? -ne 0 ] && exit 1;echo $output|grep $$CN 2>/dev/null && exit 0;echo "[$a] Waiting for makedhcp -q $$CN to return output"; a=$[$a+1]; sleep 1;done check:rc==0 cmd:copycds $$ISO check:rc==0 @@ -134,11 +134,14 @@ cmd:makedhcp -n check:rc==0 cmd:makedhcp -a check:rc==0 -cmd:a=0;while true; do [ $a -eq 100 ] && { echo "After 100 iterations, makedhcp -q $$CN did not return any output"; makedhcp -q all; exit 1; }; output=$(makedhcp -q $$CN);[ $? -ne 0 ] && exit 1;echo $output|grep $$CN 2>/dev/null && exit 0;echo "[$a] Waiting for makedhcp -q $$CN to return output"; a=$[$a+1]; sleep 1;done +cmd:a=0;while true; do [ $a -eq 10 ] && { echo "After 10 iterations, makedhcp -q $$CN did not return any output"; makedhcp -q all; exit 1; }; [ $a -eq 5 ] && { echo "After 5 iterations, makedhcp -q $$CN did not return any output. Retrying makedhcp -a again"; makedhcp -a; }; output=$(makedhcp -q $$CN);[ $? -ne 0 ] && exit 1;echo $output|grep $$CN 2>/dev/null && exit 0;echo "[$a] Waiting for makedhcp -q $$CN to return output"; a=$[$a+1]; sleep 1;done check:rc==0 cmd:copycds $$ISO check:rc==0 +#On SLES remove rh dependency dirs to free up disk space +cmd:if [[ "$$OS" =~ "sle" ]]; then rm -rf /xcat-dep/rh*; fi + cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir ]; then mv $rootimgdir $rootimgdir.regbak -f;fi check:rc==0 cmd:if [[ -f /test.synclist ]] ;then mv -f /test.synclist /test.synclist.bak;fi; @@ -213,4 +216,5 @@ cmd:if [ -x /usr/bin/goconserver ]; then makegocons -d $$CN; else makeconserverc 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 + end diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat_modules_and_groups b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat_modules_and_groups new file mode 100644 index 000000000..01962e149 --- /dev/null +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat_modules_and_groups @@ -0,0 +1,99 @@ +start:reg_linux_diskless_installation_flat_modules_and_groups_rh8 +description:Test provision and updatenode with yum groups and modules. Runs only on RH8 +os:rhels8 +label:flat_cn_diskless,provision +cmd:cp /opt/xcat/share/xcat/netboot/rh/compute.rhels8.__GETNODEATTR($$CN,arch)__.pkglist /opt/xcat/share/xcat/netboot/rh/compute.pkglist.modules +cmd:echo "yum" >> /opt/xcat/share/xcat/netboot/rh/compute.pkglist.modules +cmd:echo "@Security Tools" >> /opt/xcat/share/xcat/netboot/rh/compute.pkglist.modules +cmd:echo "@ruby:2.6" >> /opt/xcat/share/xcat/netboot/rh/compute.pkglist.modules +cmd:chdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute pkglist=/opt/xcat/share/xcat/netboot/rh/compute.pkglist.modules +check:rc==0 +cmd:cat /opt/xcat/share/xcat/netboot/rh/compute.pkglist.modules +cmd:rmimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +check:rc==0 +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:/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:ping $$CN -c 3 +check:rc==0 +check:output=~64 bytes from $$CN +cmd:lsdef -l $$CN | grep status +check:rc==0 +check:output=~booted +cmd:xdsh $$CN date +check:rc==0 +# Verify group and module were installed. Can not use "yum group" +# since .repo files are not setup at this point +cmd:xdsh $$CN rpm -q xml-common +check:rc==0 +check:output=~xml-common +cmd:xdsh $$CN yum module list --installed +check:output=~ruby +check:output=~2.6 +end + +# Verify group and module can be removed +cmd:cp /opt/xcat/share/xcat/netboot/rh/compute.rhels8.__GETNODEATTR($$CN,arch)__.pkglist /opt/xcat/share/xcat/netboot/rh/compute.pkglist.modules +cmd:echo "-@Security Tools" >> /opt/xcat/share/xcat/netboot/rh/compute.pkglist.modules +cmd:echo "-@ruby:2.6" >> /opt/xcat/share/xcat/netboot/rh/compute.pkglist.modules +cmd:cat /opt/xcat/share/xcat/netboot/rh/compute.pkglist.modules +cmd:updatenode $$CN -P ospkgs +check:rc==0 +cmd:xdsh $$CN yum group list installed +check:output!~Security Tools +cmd:xdsh $$CN yum module list --installed +check:output!~ruby +# Cleanup +cmd:chdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute pkglist=/opt/xcat/share/xcat/netboot/rh/compute.rhels8.__GETNODEATTR($$CN,arch)__.pkglist +cmd:rm /opt/xcat/share/xcat/netboot/rh/compute.pkglist.modules +end + +start:reg_linux_diskless_installation_flat_groups_rh7 +description:Test provision and updatenode with yum groups. Runs only on RH7 +os:rhels7 +label:flat_cn_diskless,provision +cmd:cp /opt/xcat/share/xcat/netboot/rh/compute.rhels7.__GETNODEATTR($$CN,arch)__.pkglist /opt/xcat/share/xcat/netboot/rh/compute.pkglist.modules +cmd:echo "yum" >> /opt/xcat/share/xcat/netboot/rh/compute.pkglist.modules +cmd:echo "@Security Tools" >> /opt/xcat/share/xcat/netboot/rh/compute.pkglist.modules +cmd:chdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute pkglist=/opt/xcat/share/xcat/netboot/rh/compute.pkglist.modules +check:rc==0 +cmd:cat /opt/xcat/share/xcat/netboot/rh/compute.pkglist.modules +cmd:rmimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +check:rc==0 +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:/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:ping $$CN -c 3 +check:rc==0 +check:output=~64 bytes from $$CN +cmd:lsdef -l $$CN | grep status +check:rc==0 +check:output=~booted +cmd:xdsh $$CN date +check:rc==0 +# Verify group was installed. Can not use "yum group" +# since .repo files are not setup at this point +cmd:xdsh $$CN rpm -q xml-common +check:rc==0 +check:output=~xml-common + +# Verify group can be removed +cmd:cp /opt/xcat/share/xcat/netboot/rh/compute.rhels7.__GETNODEATTR($$CN,arch)__.pkglist /opt/xcat/share/xcat/netboot/rh/compute.pkglist.modules +cmd:echo "-@Security Tools" >> /opt/xcat/share/xcat/netboot/rh/compute.pkglist.modules +cmd:cat /opt/xcat/share/xcat/netboot/rh/compute.pkglist.modules +cmd:updatenode $$CN -P ospkgs +check:rc==0 +cmd:xdsh $$CN yum group list installed +check:output!~Security Tools +# Cleanup +cmd:chdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute pkglist=/opt/xcat/share/xcat/netboot/rh/compute.rhels7.__GETNODEATTR($$CN,arch)__.pkglist +cmd:rm /opt/xcat/share/xcat/netboot/rh/compute.pkglist.modules +end 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 6d46a1921..655c56158 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy @@ -156,8 +156,8 @@ cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netb cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 -#Make sure squashfs-tools rpm is installed on RHEL, OL and Rocky -cmd:if [[ "$$OS" =~ "rhel" || "$$OS" =~ "ol" || "$$OS" =~ "rocky" ]]; then yum install -y squashfs-tools; fi +#Make sure squashfs-tools rpm is installed on RHEL, OL, Rocky and Alma +cmd:if [[ "$$OS" =~ "rhel" || "$$OS" =~ "ol" || "$$OS" =~ "rocky" || "$$OS" =~ "alma" ]]; then yum install -y squashfs-tools; fi #Make sure squashfs-tools rpm is installed on Ubuntu cmd:if [[ "$$OS" =~ "ubuntu" ]]; then apt-get install -y squashfs-tools; fi 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 57a14bc67..26e14e16d 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat @@ -24,6 +24,8 @@ check:rc==0 cmd:copycds $$ISO check:rc==0 +#On SLES remove rh dependency dirs to free up disk space +cmd:if [[ "$$OS" =~ "sle" ]]; then rm -rf /xcat-dep/rh*; fi cmd:if cat /etc/*release |grep SUSE >/dev/null; then cp /opt/xcat/share/xcat/tools/autotest/testcase/installation/litefile_sles.csv /tmp/litefile.csv;tabrestore /tmp/litefile.csv; elif cat /etc/*release |grep "Red Hat\|Rocky" >/dev/null; then tabrestore /opt/xcat/share/xcat/tools/autotest/testcase/installation/litefile.csv;fi check:rc==0 @@ -132,4 +134,5 @@ 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 602607f20..f44d14147 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 @@ -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\|Rocky" >/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 +cmd:if cat /etc/*release |grep SUSE >/dev/null;then xdsh $$SN 'service nfsserver restart'; elif cat /etc/*release |grep "Red Hat\|Rocky\|Alma" >/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' @@ -49,7 +49,7 @@ cmd:xdsh $$SN 'showmount -e' cmd:chtab node=$$CN statelite.statemnt="$$SN:/nodedata" check:rc==0 -cmd:if cat /etc/*release |grep SUSE >/dev/null; then cp /opt/xcat/share/xcat/tools/autotest/testcase/installation/litefile_sles.csv /tmp/litefile.csv; tabrestore /tmp/litefile.csv; elif cat /etc/*release |grep "Red Hat\|Rocky" >/dev/null; then tabrestore /opt/xcat/share/xcat/tools/autotest/testcase/installation/litefile.csv; fi +cmd:if cat /etc/*release |grep SUSE >/dev/null; then cp /opt/xcat/share/xcat/tools/autotest/testcase/installation/litefile_sles.csv /tmp/litefile.csv; tabrestore /tmp/litefile.csv; elif cat /etc/*release |grep "Red Hat\|Rocky\|Alma" >/dev/null; then tabrestore /opt/xcat/share/xcat/tools/autotest/testcase/installation/litefile.csv; fi check:rc==0 cmd:tabdump litefile 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 c6a002cca..4318f1e05 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 @@ -41,13 +41,13 @@ 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\|Rocky" >/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 +cmd:if cat /etc/*release |grep SUSE >/dev/null;then xdsh $$SN 'service nfsserver restart'; elif cat /etc/*release |grep "Red Hat\|Rocky\|Alma" >/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" check:rc==0 -cmd:if cat /etc/*release |grep SUSE >/dev/null; then cp /opt/xcat/share/xcat/tools/autotest/testcase/installation/litefile_sles.csv /tmp/litefile.csv; tabrestore /tmp/litefile.csv; elif cat /etc/*release |grep "Red Hat\|Rocky" >/dev/null; then tabrestore /opt/xcat/share/xcat/tools/autotest/testcase/installation/litefile.csv; fi +cmd:if cat /etc/*release |grep SUSE >/dev/null; then cp /opt/xcat/share/xcat/tools/autotest/testcase/installation/litefile_sles.csv /tmp/litefile.csv; tabrestore /tmp/litefile.csv; elif cat /etc/*release |grep "Red Hat\|Rocky\|Alma" >/dev/null; then tabrestore /opt/xcat/share/xcat/tools/autotest/testcase/installation/litefile.csv; fi check:rc==0 cmd:tabdump litefile check:rc==0 diff --git a/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump b/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump index 9cc77f6a1..b374ec095 100644 --- a/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump +++ b/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump @@ -118,4 +118,12 @@ cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/kdumpdir cmd:cat /tmp/node.stanza | chdef -z;rm -rf /tmp/node.stanza cmd:cat /tmp/osimage.stanza | chdef -z;rm -rf /tmp/osimage.stanza cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir.regbak ]; then mv $rootimgdir.regbak $rootimgdir -f;fi + +# Remove crashkernelsize and dump from the osimage definition and enablekdump from the node defintion +cmd:chdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute crashkernelsize= +check:rc==0 +cmd:chdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute dump= +check:rc==0 +cmd:chdef -t node $$CN -m postscripts=enablekdump +check:rc==0 end diff --git a/xCAT-test/autotest/testcase/makentp/cases0 b/xCAT-test/autotest/testcase/makentp/cases0 index cf5a27d64..78c96c5d5 100644 --- a/xCAT-test/autotest/testcase/makentp/cases0 +++ b/xCAT-test/autotest/testcase/makentp/cases0 @@ -46,7 +46,7 @@ cmd:lsdef -t site -o clustersite -i extntpservers -c >/tmp/extntpserver check:rc==0 cmd:chtab key=extntpservers site.value="$$extntpserversip" check:rc==0 -cmd:date | awk '{print $6}' > /tmp/currentyear +cmd:date +"%Y" > /tmp/currentyear check:rc==0 cmd:date -s 20000101 check:rc==0 diff --git a/xCAT-test/autotest/testcase/mkdef/cases1 b/xCAT-test/autotest/testcase/mkdef/cases1 index e0264c909..41c4b93c7 100644 --- a/xCAT-test/autotest/testcase/mkdef/cases1 +++ b/xCAT-test/autotest/testcase/mkdef/cases1 @@ -150,24 +150,3 @@ check:rc==0 cmd:rmdef -t group -o xcattest_tmp_group_regex check:rc==0 end - -start:mkdef_nodename_hit_groupname -cmd:mkdef -t group -o tempgroup13579 -check:rc==0 -cmd:mkdef -t node -o tempgroup13579 groups=tempgroup13579 -check:rc==1 -check:output=~A definition for a group object with the same name already exists. -check:output=~No object names were provided -cmd:mkdef -t node -o tempgroup13579 groups=all -check:rc==1 -check:output=~A definition for a group object with the same name already exists. -check:output=~No object names were provided -cmd:mkdef -t node -o tempnode02468,tempgroup13579 groups=tempgroup13579 -check:rc==1 -check:output=~A definition for a group object with the same name already exists. -check:output=~1 object definitions have been created -cmd:rmdef -t node -o tempnode02468 -check:rc==0 -cmd:rmdef -t group -o tempgroup13579 -check:rc==0 -end diff --git a/xCAT-test/autotest/testcase/passwd/case0 b/xCAT-test/autotest/testcase/passwd/case0 index 42a862d69..9b5954d68 100644 --- a/xCAT-test/autotest/testcase/passwd/case0 +++ b/xCAT-test/autotest/testcase/passwd/case0 @@ -228,15 +228,14 @@ cmd:gettab key=system passwd.cryptmethod > /tmp/tmpcryptmethod check:rc==0 cmd:gettab key=system passwd.password > /tmp/tmppassword check:rc==0 -cmd:chtab key=system passwd.username=root passwd.password=`openssl passwd -1 abc123` +cmd:chtab key=system passwd.username=root passwd.password=`openssl passwd -6 abc123` check:rc==0 cmd:gettab key=system passwd.password > /tmp/tmpcryptedpasswd check:rc==0 cmd:if grep Ubuntu /etc/*release;then if [ ! -e /install/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/install/netboot/initrd.gz ]; then copycds $$ISO;mkdir -p /install/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/install/netboot/;touch /install/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/install/netboot/initrd.gz;fi;fi cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 -cmd:if grep SUSE /etc/*release;then grep '\$1\$' /install/autoinst/$$CN | awk 'gsub(/^ *| *$/,"")'| awk -v head="" -v tail="" '{print substr($0, index($0,head)+length(head),index($0,tail)-index($0,head)-length(head))}' > /tmp/instcryptedpasswd; elif grep -E "Red Hat|CentOS|Rocky" /etc/*release;then grep '\$1\$' /install/autoinst/$$CN |awk -F " " '{print $3}' > /tmp/instcryptedpasswd; elif grep Ubuntu /etc/*release;then grep '\$1\$' /install/autoinst/$$CN |awk -F " " '{print $4}' > /tmp/instcryptedpasswd;else echo "Sorry,this is not supported os"; fi -#cmd:grep '\$1\$' /install/autoinst/$$CN |awk -F " " '{print $3}' > /tmp/instcryptedpasswd +cmd:if grep SUSE /etc/*release;then grep '\$6\$' /install/autoinst/$$CN | awk 'gsub(/^ *| *$/,"")'| awk -v head="" -v tail="" '{print substr($0, index($0,head)+length(head),index($0,tail)-index($0,head)-length(head))}' > /tmp/instcryptedpasswd; elif grep -E "Red Hat|CentOS|Rocky|Alma" /etc/*release;then grep '\$6\$' /install/autoinst/$$CN |awk -F " " '{print $3}' > /tmp/instcryptedpasswd; elif grep Ubuntu /etc/*release;then grep '\$6\$' /install/autoinst/$$CN |awk -F " " '{print $4}' > /tmp/instcryptedpasswd;else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:diff /tmp/tmpcryptedpasswd /tmp/instcryptedpasswd check:rc==0 @@ -254,9 +253,9 @@ cmd:gettab key=system passwd.cryptmethod > /tmp/tmpcryptmethod check:rc==0 cmd:gettab key=system passwd.password > /tmp/tmppassword check:rc==0 -cmd:chtab key=system passwd.username=root passwd.password=`openssl passwd -1 abc123` +cmd:chtab key=system passwd.username=root passwd.password=`openssl passwd -6 abc123` check:rc==0 -cmd:gettab key=system passwd.password |grep '\$1\$' +cmd:gettab key=system passwd.password |grep '\$6\$' check:rc==0 #config CN to do diskless provision cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN @@ -286,7 +285,7 @@ cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-net check:rc==0 cmd:if [[ "__GETNODEATTR($$CN,arch)__" =~ "ppc64" ]]; then rnetboot $$CN;elif [[ "__GETNODEATTR($$CN,arch)__" =~ "x86_64" ]];then rpower $$CN boot; fi check:rc==0 -cmd:sleep 900 +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 @@ -296,7 +295,7 @@ check:rc==0 check:output=~booted cmd:scp $$CN:/etc/shadow /tmp check:rc==0 -cmd:grep 'root:\$1\$' /tmp/shadow +cmd:grep 'root:\$6\$' /tmp/shadow check:rc==0 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 diff --git a/xCAT-test/autotest/testcase/probe/detect_dhcpd b/xCAT-test/autotest/testcase/probe/detect_dhcpd index 213f6ab0d..773f25a60 100644 --- a/xCAT-test/autotest/testcase/probe/detect_dhcpd +++ b/xCAT-test/autotest/testcase/probe/detect_dhcpd @@ -12,7 +12,7 @@ if [ -e "/etc/redhat-release" ]; then if [ "$?" != "0" ] ;then yum install -y tcpdump fi -elif [ -e "/etc/SuSE-release" ]; then +elif [ -e "/etc/SuSE-release" ] || [ -e "/etc/SUSE-brand" ]; then rpm -qa |grep tcpdump if [ "$?" != "0" ] ;then zypper -n install tcpdump diff --git a/xCAT-test/autotest/testcase/pythonsupport/cases0 b/xCAT-test/autotest/testcase/pythonsupport/cases0 index 9d820857c..0e496120e 100644 --- a/xCAT-test/autotest/testcase/pythonsupport/cases0 +++ b/xCAT-test/autotest/testcase/pythonsupport/cases0 @@ -33,6 +33,7 @@ check:rc==0 cmd:cat /etc/yum.repos.d/xcat-dep-python-local.repo check:rc==0 cmd:wget https://xcat.org/files/xcat/xcat-dep/2.x_Linux/beta/xCAT-openbmc-py-RH7-2.14.6-snap202204090016.noarch.rpm --no-check-certificate -O /tmp/xCAT-openbmc-py-RH7.noarch.rpm +check:rc==0 cmd:ls -l /tmp/xCAT-openbmc-py-RH7.noarch.rpm check:rc==0 cmd:yum install -y /tmp/xCAT-openbmc-py-RH7.noarch.rpm diff --git a/xCAT-test/autotest/testcase/restapi/cases0 b/xCAT-test/autotest/testcase/restapi/cases0 index 24cb18239..8afc981a3 100644 --- a/xCAT-test/autotest/testcase/restapi/cases0 +++ b/xCAT-test/autotest/testcase/restapi/cases0 @@ -1,13 +1,13 @@ start:restapi_setup_on_MN_CN description: Set up the REST API on MN and CN label:restapi -#Install the mod_ssl package on Red Hat and Rocky -cmd:if cat /etc/*release | grep "Red Hat\|Rocky" >/dev/null; then yum install mod_ssl -y; rpm -qa | grep mod_ssl; fi +#Install the mod_ssl package on Red Hat, Rocky and AlmaLinux +cmd:if cat /etc/*release | grep "Red Hat\|Rocky\|AlmaLinux" >/dev/null; then yum install mod_ssl -y; rpm -qa | grep mod_ssl; fi check:rc==0 -cmd:if cat /etc/*release | grep "Red Hat\|Rocky" >/dev/null; then sed -i 's/^\(\s*\)SSLCertificateFile.*$/\1SSLCertificateFile \/etc\/xcat\/cert\/server-cred.pem/' /etc/httpd/conf.d/ssl.conf; fi -cmd:if cat /etc/*release | grep "Red Hat\|Rocky" >/dev/null; then sed -i 's/^\(\s*SSLCertificateKeyFile.*\)$/#\1/' /etc/httpd/conf.d/ssl.conf; fi +cmd:if cat /etc/*release | grep "Red Hat\|Rocky\|AlmaLinux" >/dev/null; then sed -i 's/^\(\s*\)SSLCertificateFile.*$/\1SSLCertificateFile \/etc\/xcat\/cert\/server-cred.pem/' /etc/httpd/conf.d/ssl.conf; fi +cmd:if cat /etc/*release | grep "Red Hat\|Rocky\|AlmaLinux" >/dev/null; then sed -i 's/^\(\s*SSLCertificateKeyFile.*\)$/#\1/' /etc/httpd/conf.d/ssl.conf; fi check:rc==0 -cmd:if cat /etc/*release | grep "Red Hat\|Rocky" >/dev/null; then service httpd restart; fi +cmd:if cat /etc/*release | grep "Red Hat\|Rocky\|AlmaLinux" >/dev/null; then service httpd restart; fi check:rc==0 #Configure the SLES environment cmd:if cat /etc/*release | grep "SLES" >/dev/null; then a2enmod ssl; a2enflag SSL; cp /etc/apache2/vhosts.d/vhost-ssl.template /etc/apache2/vhosts.d/vhost-ssl.conf; fi @@ -30,8 +30,8 @@ cmd:xdsh $$CN "rm /root/ca-cert.pem" check:rc==0 cmd:tabch -d key=xcat passwd check:rc==0 -#Remove the mod_ssl package on Red Hat and Rocky -cmd:if cat /etc/*release | grep "Red Hat\|Rocky" >/dev/null; then yum remove mod_ssl -y; service httpd restart; fi +#Remove the mod_ssl package on Red Hat, Rocky and AlmaLinux +cmd:if cat /etc/*release | grep "Red Hat\|Rocky\|AlmaLinux" >/dev/null; then yum remove mod_ssl -y; service httpd restart; fi check:rc==0 #Clean up the SLES environment cmd:if cat /etc/*release | grep "SLES" >/dev/null; then rm /etc/apache2/vhosts.d/vhost-ssl.conf; service apache2 restart; fi diff --git a/xCAT-test/autotest/testcase/xdsh/cases0 b/xCAT-test/autotest/testcase/xdsh/cases0 index 767c79d44..a0c4b933e 100644 --- a/xCAT-test/autotest/testcase/xdsh/cases0 +++ b/xCAT-test/autotest/testcase/xdsh/cases0 @@ -89,6 +89,7 @@ cmd: copycds $$ISO check:rc==0 cmd: genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 +check:output!~WARNING cmd: xdsh -i /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg "rpm -qa|grep uuid" check:rc==0 check:output=~libuuid diff --git a/xCAT-test/pods/man1/xcattest.1.pod b/xCAT-test/pods/man1/xcattest.1.pod index ce3bf1401..535b01980 100644 --- a/xCAT-test/pods/man1/xcattest.1.pod +++ b/xCAT-test/pods/man1/xcattest.1.pod @@ -80,15 +80,15 @@ The xCAT-test test cases are in flat text format, the testing framework will par #optional, description of the test case description: what the test case is for? #optional, environment requirements - os:AIX/Linux + os:AIX/Linux/sles/ubuntu/rhels/rhels7/rhels8 #optional, environment requirements - arch:ppc/x86 + arch:ppc/ppc64/ppc64le/x86_64 #optional, environment requirements - hcp:hmc/mm/bmc/fsp + hcp:hmc/mm/bmc/fsp/ipmi/openbmc #optional, label label:label1 #required, command need to run - cmd:comand + cmd:command #optional, check return code of last executed command check:rc == or != return code #optional, check output of last executed command @@ -103,13 +103,13 @@ B: Each test case can have more than one I sections and each I s =item 1. -To run all test cases related command rpower: +To run all test cases related to command B: xcattest -f /tmp/config -c rpower =item 2. -To run customized bundle with /tmp/config file: +To run customized bundle with I file: xcattest -c lsdef -l > /opt/xcat/share/xcat/tools/autotest/bundle/custom.bundle Modify custom.bundle @@ -117,13 +117,13 @@ To run customized bundle with /tmp/config file: =item 3. -To run specified test cases with /tmp/config file: +To run specified test cases with I file: xcattest -f /tmp/config -t lsdef_t_o_l_z =item 4. -To add a new case to test B. In the example, we assume that the min_mem should not be equal to 16 in the lpar profile of computenode. The case name is chvm_custom. It create a test lpar named testnode firstly, that change the min_mem of the lpar to 16 using chvm, then check if min_mem have changed correctly. At last, the testnode be remove to ensure no garbage produced in the cases. +To add a new test case to test B. In this example, we assume that the B should not be equal to 16 in the lpar profile of computenode. The case name is B. It creates a test lpar named B first, then changes the B of the lpar to 16 using B, then checks if B have changed correctly. Finally, the B is removed. add a new test case file in /opt/xcat/share/xcat/tools/autotest/chvm edit filename diff --git a/xCAT-test/xcattest b/xCAT-test/xcattest index f6b55c3c0..cae71da3b 100755 --- a/xCAT-test/xcattest +++ b/xCAT-test/xcattest @@ -178,7 +178,7 @@ if($search_expression){ print "------The total labels are:---------\n"; print Dumper \@total_label_set; print "------The case and its labels:-------\n"; - print Dumper \%case_label_map + print Dumper \%case_label_map; } } @@ -205,7 +205,7 @@ if (defined $list) { log_this($running_log_fd, "$_"); } } elsif (!@cases_to_be_run && $search_expression){ - log_this($running_log_fd, "There is no cases match search expression $search_expression"); + log_this($running_log_fd, "There are no cases match search expression $search_expression"); } else { #list the cases shipped by xcat test package @@ -219,7 +219,7 @@ if (defined $list) { } } elsif ($list eq "caseinfo") { if (!@cases_to_be_run && $search_expression){ - log_this($running_log_fd, "There is no cases match search expression $search_expression"); + log_this($running_log_fd, "There are no cases match search expression $search_expression"); } else { $rst = show_case_info(\@cases_to_be_run, \$error); if ($rst) { @@ -258,7 +258,7 @@ if (defined $list) { print "------The total labels are:---------\n"; print Dumper \@total_label_set; print "------The case and its labels:-------\n"; - print Dumper \%case_label_map + print Dumper \%case_label_map; } my %label_conut; my %case_label_str_map; @@ -436,7 +436,7 @@ if ($stop_to_keep_env) { # Description: print message to log file and STDOUT. # Set '-q' option in command line, just print message to log file # Atrributes: $logdf: the file description of openning log file -# Retrun code: 0 Success 1 Failed +# Return code: 0 Success 1 Failed #-------------------------------------------------------- sub log_this { my $logdf = shift; @@ -463,7 +463,7 @@ sub log_this { # Fuction name: pro_init # Description: Do program initialization # Atrributes: -# Retrun code: 0 Success 1 Failed +# Return code: 0 Success 1 Failed #-------------------------------------------------------- sub pro_init { mkpath("$resultdir") unless (-d "$resultdir"); @@ -489,7 +489,7 @@ sub pro_init { # The reference of array to save the cases to be handled # $error_ref (output attribe) # The reference of scalar to save the error message generated during running current function -# Retrun code: 0 Success 1 Failed +# Return code: 0 Success 1 Failed #------------------------------------------------------- sub calculate_cases_to_be_run { my $cases_to_be_run_ref = shift; @@ -596,7 +596,7 @@ sub calculate_cases_to_be_run { # Fuction name: expend_include_file # Description: To support '#INCLUDE" label in bundle file, to expend the include file # Atrributes: $bundle (input attribute): the name of bundle -# Retrun code: 0 Success 1 Failed +# Return code: 0 Success 1 Failed #-------------------------------------------------------- sub expend_include_file { my $bundle = shift; @@ -629,7 +629,7 @@ sub expend_include_file { # Fuction name: to_exit # Description: customize exit function, include clean up environment # Atrributes: -# Retrun code: +# Return code: #-------------------------------------------------------- sub to_exit { my $exit_code = shift; @@ -645,7 +645,7 @@ sub to_exit { # Atrributes: # $error_ref (output attribe) # The reference of scalar to save the error message generated during running current function -# Retrun code: 0 Success 1 Failed +# Return code: 0 Success 1 Failed #-------------------------------------------------------- sub check_option_validity { my $error_ref = shift; @@ -675,7 +675,7 @@ sub check_option_validity { # The reference of array to save the cases to be handled # $error_ref (output attribe) # The reference of scalar to save the error message generated during running current function -# Retrun code: 0 Success 1 Failed +# Return code: 0 Success 1 Failed #-------------------------------------------------------- sub show_case_info { my $cases_to_be_run_ref = shift; @@ -715,7 +715,7 @@ sub show_case_info { # Atrributes: # $error_ref (output attribe) # The reference of scalar to save the error message generated during running current function -# Retrun code: 0 Success 1 Failed +# Return code: 0 Success 1 Failed #-------------------------------------------------------- sub show_bundle_info { my $error_ref = shift; @@ -775,7 +775,7 @@ sub show_bundle_info { # config{var}{varname} # $error_ref (output attribe) # The reference of scalar to save the error message generated during running current function -# Retrun code: 0 Success 1 Failed +# Return code: 0 Success 1 Failed #-------------------------------------------------------- sub load_config_file { my $configfile = shift; @@ -932,7 +932,7 @@ sub load_config_file { # The flag of whether run these case nex. # 0 means no, just load case basic information, used by "searching informaiotn funtion of xcattest" # 1 means yes, load case basic information and parse the attribure at the sametime. used by "run case funtion of xcattest" -# Retrun code: 0 Success 1 Failed +# Return code: 0 Success 1 Failed #-------------------------------------------------------- sub load_case { my $cases_to_be_run_ref = shift; @@ -1280,7 +1280,7 @@ sub load_case { } } if (@unexisted_cases) { - log_this($running_log_fd, "Not existed:", @unexisted_cases); + log_this($running_log_fd, "Does not exist:", @unexisted_cases); push @wrong_cases, @unexisted_cases; $caseerror = 2; } @@ -1310,7 +1310,7 @@ sub load_case { # Atrributes: # $error_ref (output attribe) # The reference of scalar to save the error message generated during running current function -# Retrun code: 0 Success 1 Failed +# Return code: 0 Success 1 Failed #-------------------------------------------------------- sub bakup_current_env { my $error_ref = shift; @@ -1330,7 +1330,7 @@ sub bakup_current_env { # Atrributes: # $error_ref (output attribe) # The reference of scalar to save the error message generated during running current function -# Retrun code: 0 Success 1 Failed +# Return code: 0 Success 1 Failed #-------------------------------------------------------- sub restore_current_env { my $error_ref = shift; @@ -1354,7 +1354,7 @@ sub restore_current_env { # Due to there maybe is more than one implementation for one case # $error_ref (output attribe) # The reference of scalar to save the error message generated during running current function -# Retrun code: 0 Success 1 Failed +# Return code: 0 Success 1 Failed #-------------------------------------------------------- sub run_case { my $cases_to_be_run_ref = shift; @@ -1556,7 +1556,7 @@ sub run_case { # The structure of %config please refer to the comment of function load_config_file # $error_ref (output attribe) # The reference of scalar to save the error message generated during running current function -# Retrun code: 0 Success 1 Failed +# Return code: 0 Success 1 Failed #-------------------------------------------------------- sub setup_env_by_configure_file { my $config_ref = shift; @@ -1567,7 +1567,7 @@ sub setup_env_by_configure_file { log_this($running_log_fd, "$cmd"); &runcmd($cmd); if ($::RUNCMD_RC != 0) { - $$error_ref = "Fail to run $cmd"; + $$error_ref = "Failed to run $cmd"; return 1; } } @@ -1582,7 +1582,7 @@ sub setup_env_by_configure_file { log_this($running_log_fd, "$cmd"); runcmd($cmd); if ($::RUNCMD_RC != 0) { - $$error_ref = "Fail to run $cmd"; + $$error_ref = "Failed to run $cmd"; return 1; } } @@ -1601,7 +1601,7 @@ sub setup_env_by_configure_file { log_this($running_log_fd, "$cmd"); &runcmd($cmd); if ($::RUNCMD_RC != 0) { - $$error_ref = "Fail to run $cmd"; + $$error_ref = "Failed to run $cmd"; return 1; } } @@ -1620,7 +1620,7 @@ sub setup_env_by_configure_file { # The structure of %config please refer to the comment of function load_config_file # $error_ref (output attribe) # The reference of scalar to save the error message generated during running current function -# Retrun code: 0 Success 1 Failed +# Return code: 0 Success 1 Failed #-------------------------------------------------------- sub detect_current_env { my $config_ref = shift; @@ -1672,7 +1672,7 @@ sub detect_current_env { # Fuction name: runcmd # Description: run a command after 'cmd' label in one case # Atrributes: -# Retrun code: +# Return code: # $::RUNCMD_RC : the return code of command # @$outref : the output of command #-------------------------------------------------------- @@ -1701,7 +1701,7 @@ sub runcmd # Atrributes: # $script_ref (input attribute) # the reference of array where save every line of script -# Retrun code: +# Return code: # $::RUNCMD_RC : the return code of command # @$outref : the output of command #-------------------------------------------------------- @@ -1730,7 +1730,7 @@ sub runscript { # Fuction name: getnodeattr # Description: get the value of node attribute from current environment # Atrributes: -# Retrun code: +# Return code: #-------------------------------------------------------- sub getnodeattr { my $node = shift; @@ -1743,7 +1743,7 @@ sub getnodeattr { # Fuction name: getobjectattr # Description: get the value of object attribute from current DB # Atrributes: -# Retrun code: +# Return code: #-------------------------------------------------------- sub getobjectattr { my $objtype = shift; @@ -1772,7 +1772,7 @@ sub getobjectattr { # The target scan directory # $files_path_ref (output attribute) # the reference of array where save all vaild files under $dir -# Retrun code: +# Return code: #-------------------------------------------------------- sub get_files_recursive { @@ -1804,7 +1804,7 @@ sub get_files_recursive # Fuction name: is_valid_case_name # Description: to check if a case name is valid # Atrributes: $casename (input atrribute): the target case name -# Retrun code: 0 Success 1 Failed +# Return code: 0 Success 1 Failed #-------------------------------------------------------- sub is_valid_case_name { my $casename = shift; @@ -1817,13 +1817,20 @@ sub is_valid_case_name { #------------------------------------------------------- # Fuction name: get_current_os -# Description: +# Description: Return name of current OS. For rhels, also return major number # Atrributes: -# Retrun code: +# Return code: #-------------------------------------------------------- sub get_current_os { if (-f "/etc/redhat-release") { - return "rhels"; + # Try to return "rhels" + major version, if can not get it, just return "rhels" + my $major_version = ""; + my @output = &runcmd("cat /etc/redhat-release"); + my $out_line = $output[0]; + if ($out_line =~ (/(\d+)\.(\d*)/)) { + $major_version = $1; + } + return "rhels".$major_version; } elsif (-f "/etc/lsb-release") { return "ubuntu"; } elsif (-f "/etc/os-release") { @@ -1844,7 +1851,7 @@ sub get_current_os { # Fuction name: generate_performance_report # Description: # Atrributes: -# Retrun code: +# Return code: #-------------------------------------------------------- sub generate_performance_report { my $runninglog = shift; @@ -1889,7 +1896,7 @@ sub generate_performance_report { # Fuction name: getvar # Description: replace specific attribute in case definition by the value set in config file # Atrributes: -# Retrun code: +# Return code: #-------------------------------------------------------- sub getvar { @@ -1913,7 +1920,7 @@ sub getvar # Fuction name: getfunc # Description: replace specific funciton in case definition # Atrributes: -# Retrun code: +# Return code: #-------------------------------------------------------- sub getfunc { @@ -1952,7 +1959,7 @@ sub getfunc # Fuction name: gettablevalue # Description: get specific table value from current environment # Atrributes: -# Retrun code: +# Return code: #-------------------------------------------------------- sub gettablevalue { @@ -1965,7 +1972,7 @@ sub gettablevalue # Fuction name: print_table # Description: print a hash table in good format # Atrributes: -# Retrun code: +# Return code: #-------------------------------------------------------- sub print_table { my $msg_ref = shift; @@ -2116,7 +2123,7 @@ sub scan_existed_labels { my @labels = (); if ($line =~ /^start\s*:\s*(.*)/) { - $current_case_name = $1; + $current_case_name = $1; if ($cmd_cases_belong_to){ $case_label_map_ref->{$current_case_name}->{labels} = [$cmd_cases_belong_to]; push @$total_label_set_ref, $cmd_cases_belong_to unless(inarray($total_label_set_ref, $cmd_cases_belong_to)); diff --git a/xCAT-vlan/install/postscripts/configvlan b/xCAT-vlan/install/postscripts/configvlan index ec7bd025c..76ac1117f 100755 --- a/xCAT-vlan/install/postscripts/configvlan +++ b/xCAT-vlan/install/postscripts/configvlan @@ -21,7 +21,7 @@ if [[ -z $VLANMAXINDEX ]] || [[ $VLANMAXINDEX -eq 0 ]]; then fi if [[ $OSTYPE = linux* ]]; then - if [[ $OSVER = sles* ]] || [[ $OSVER = suse* ]] || [[ -f /etc/SuSE-release ]]; then + if [[ $OSVER = sles* ]] || [[ $OSVER = suse* ]] || [[ -f /etc/SuSE-release ]] || [[ -f /etc/SUSE-brand ]]; then nwdir="/etc/sysconfig/network" isSLES=1 else @@ -260,7 +260,7 @@ EOF hostname $VLANHOSTNAME #change the hostname permanently - if [ -f /etc/SuSE-release ] + if [ -f /etc/SuSE-release ] || [ -f /etc/SUSE-brand ] then #SLES x echo $VLANHOSTNAME > /etc/HOSTNAME diff --git a/xCAT-vlan/install/postscripts/deconfigvlan b/xCAT-vlan/install/postscripts/deconfigvlan index 062ce2b51..11458c85f 100755 --- a/xCAT-vlan/install/postscripts/deconfigvlan +++ b/xCAT-vlan/install/postscripts/deconfigvlan @@ -15,7 +15,7 @@ if [[ -z $VLANMAXINDEX ]] || [[ $VLANMAXINDEX -eq 0 ]]; then fi if [[ $OSTYPE = linux* ]]; then - if [[ $OSVER = sles* ]] || [[ $OSVER = suse* ]] || [[ -f /etc/SuSE-release ]]; then + if [[ $OSVER = sles* ]] || [[ $OSVER = suse* ]] || [[ -f /etc/SuSE-release ]] || [[ -f /etc/SUSE-brand ]]; then nwdir="/etc/sysconfig/network" isSLES=1 else @@ -206,7 +206,7 @@ while [ $index -le $VLANMAXINDEX ]; do hostname $NODE #change the hostname permanently - if [ -f /etc/SuSE-release ] + if [ -f /etc/SuSE-release ] || [ -f /etc/SUSE-brand ] then #SLES x echo $NODE > /etc/HOSTNAME diff --git a/xCAT/debian/control b/xCAT/debian/control index 8df6baa78..3e614d210 100644 --- a/xCAT/debian/control +++ b/xCAT/debian/control @@ -10,7 +10,7 @@ Homepage: https://xcat.org/ Package: xcat Architecture: amd64 ppc64el Depends: ${perl:Depends}, goconserver(>= 0.3.3-snap000000000000), xcat-server (>= 2.13-snap000000000000), xcat-client (>= 2.13-snap000000000000), libdbd-sqlite3-perl, isc-dhcp-server, apache2, nfs-kernel-server, libxml-parser-perl, rsync, tftpd-hpa, libnet-telnet-perl, xcat-genesis-scripts-ppc64 (>= 2.13-snap000000000000), xcat-genesis-scripts-amd64 (>= 2.13-snap000000000000) -Recommends: bind9, nmap, tftp-hpa, ipmitool-xcat (>= 1.8.17-1), syslinux[any-amd64], libsys-virt-perl, syslinux-xcat, xnba-undi, elilo-xcat, xcat-buildkit (>= 2.13-snap000000000000), xcat-probe (>= 2.13-snap000000000000) +Recommends: bind9, net-tools, nmap, tftp-hpa, ipmitool-xcat (>= 1.8.17-1), syslinux[any-amd64], libsys-virt-perl, syslinux-xcat, xnba-undi, elilo-xcat, xcat-buildkit (>= 2.13-snap000000000000), xcat-probe (>= 2.13-snap000000000000) Suggests: yaboot-xcat Description: Metapackage for a common, default xCAT setup xCAT is Extreme Cluster/Cloud Administration Toolkit. xCAT offers complete diff --git a/xCAT/postscripts/configeth b/xCAT/postscripts/configeth index 6644600e7..47a2c6714 100755 --- a/xCAT/postscripts/configeth +++ b/xCAT/postscripts/configeth @@ -702,6 +702,15 @@ elif [ "$1" = "-s" ];then hostname $NODE echo $NODE > /etc/HOSTNAME else + # Extract the first numeric part of the VERSION_ID, ignoring any non-numeric characters. + os_major_version=`cat /etc/os* | grep VERSION_ID | cut -d '=' -f2 | sed s/\"//g | cut -d "." -f1` + + if [[ -z "${os_major_version}" ]] ; then + logger -t xcat -p local4.err "configeth: Could not determine the OS version, defaulting to the RHEL 7 behavior" + log_warn "configeth on $NODE: Could not determine the OS version, defaulting to the RHEL 7 behavior" + os_major_version=7 + fi + #write ifcfg-* file for redhat con_name="xcat-"${str_inst_nic} str_inst_prefix=$(v4mask2prefix ${str_inst_mask}) @@ -715,7 +724,7 @@ elif [ "$1" = "-s" ];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 + 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 gw4 ${str_inst_gateway} str_conf_file_1="/etc/sysconfig/network-scripts/ifcfg-xcat-${str_inst_nic}-1" if [ -f $str_conf_file_1 ]; then grep $con_name $str_conf_file_1 >/dev/null 2>/dev/null @@ -732,6 +741,11 @@ elif [ "$1" = "-s" ];then echo "ONBOOT=yes" >> $str_conf_file echo "NAME=${con_name}" >> $str_conf_file echo "HWADDR=${str_inst_mac}" >> $str_conf_file + + # Add GATEWAY to $str_conf_file only if the OS version is above RHEL 7.x. + if (( $os_major_version > 7 )) ; then + echo "GATEWAY=${str_inst_gateway}" >> $str_conf_file + fi fi if [ $networkmanager_active -eq 2 ]; then echo "AUTOCONNECT_PRIORITY=9" >> $str_conf_file @@ -748,13 +762,17 @@ elif [ "$1" = "-s" ];then echo "MTU=${str_inst_mtu}" >> $str_conf_file fi fi - if [ -n "$str_inst_gateway" ];then - grep -i "GATEWAY" /etc/sysconfig/network - if [ $? -eq 0 ];then - sed -i "s/.*GATEWAY.*/GATEWAY=${str_inst_gateway}/i" /etc/sysconfig/network - else - echo "GATEWAY=${str_inst_gateway}" >> /etc/sysconfig/network - fi + + # Add GATEWAY to the network file only if the OS version is RHEL 7.x or below. + if (( $os_major_version < 8 )) ; then + if [ -n "$str_inst_gateway" ];then + grep -i "GATEWAY" /etc/sysconfig/network + if [ $? -eq 0 ];then + sed -i "s/.*GATEWAY.*/GATEWAY=${str_inst_gateway}/i" /etc/sysconfig/network + else + echo "GATEWAY=${str_inst_gateway}" >> /etc/sysconfig/network + fi + fi fi #add extra params i=0 diff --git a/xCAT/postscripts/configfirewall b/xCAT/postscripts/configfirewall index 800127378..5da659efc 100755 --- a/xCAT/postscripts/configfirewall +++ b/xCAT/postscripts/configfirewall @@ -143,7 +143,7 @@ if (-f "/etc/redhat-release") #system($cmd); xCAT::Utils->enableservice("iptables"); } -elsif (-f "/etc/SuSE-release") +elsif ((-f "/etc/SuSE-release") || (-f "/etc/SUSE-brand")) { my $conffile; my $conf; diff --git a/xCAT/postscripts/configib b/xCAT/postscripts/configib index 9f06b4769..b6ecac289 100755 --- a/xCAT/postscripts/configib +++ b/xCAT/postscripts/configib @@ -165,7 +165,7 @@ then if [ -f /etc/redhat-release ] then OS_name="redhat" - elif [ -f /etc/SuSE-release ] + elif [ -f /etc/SuSE-release ] || [ -f /etc/SUSE-brand ] then OS_name="suse" elif [ -f /etc/os-release ] && cat /etc/os-release |grep NAME|grep Ubuntu>/dev/null diff --git a/xCAT/postscripts/enablekdump b/xCAT/postscripts/enablekdump index 7c1282240..55ca75d7d 100755 --- a/xCAT/postscripts/enablekdump +++ b/xCAT/postscripts/enablekdump @@ -40,7 +40,7 @@ for i in `/bin/cat /proc/cmdline`; do done if [ ! -z "$MACX" ] && [ ! -z "$ETHX" ]; then - if (pmatch $OSVER "sle*") || (pmatch $OSVER "suse*") || [ -f /etc/SuSE-release ]; then + if (pmatch $OSVER "sle*") || (pmatch $OSVER "suse*") || [ -f /etc/SuSE-release ] || [ -f /etc/SUSE-brand ]; then CONFFILE=$MNTDIR/etc/sysconfig/network/ifcfg-$ETHX fi if (pmatch $OSVER "fedora*") || (pmatch $OSVER "rhel6*") || (pmatch $OSVER "rhels6*") || [ -f /etc/fedora-release ] || [ -f /etc/redhat-release ];then @@ -104,7 +104,7 @@ if [ ! -z "$DUMP" ]; then fi if [ "$KDPROTO" = "nfs" ]; then - if (pmatch $OSVER "sle*") || (pmatch $OSVER "suse*") || [ -f /etc/SuSE-release ]; then + if (pmatch $OSVER "sle*") || (pmatch $OSVER "suse*") || [ -f /etc/SuSE-release ] || [ -f /etc/SUSE-brand ]; then if (pmatch $OSVER "*10*"); then #run mkinitrd to generater the kdump-init base if (pmatch $ARCH "x86*"); then diff --git a/xCAT/postscripts/killsyslog b/xCAT/postscripts/killsyslog index e6f6d4545..5be4710e3 100755 --- a/xCAT/postscripts/killsyslog +++ b/xCAT/postscripts/killsyslog @@ -5,7 +5,7 @@ # (so /a can be umounted cleanly) # SI post-install scripts run in a chroot environment of the final OS image -if [ -f "/etc/SuSE-release" ];then +if [ -f "/etc/SuSE-release" ] || [ -f "/etc/SUSE-brand" ] ;then str_out=`ps -ef | grep -v grep | grep syslog-ng` if [ $? -eq 0 ];then str_id=`echo $str_out | awk '{print $2}'` diff --git a/xCAT/postscripts/ospkgs b/xCAT/postscripts/ospkgs index 83451061c..a824e7222 100755 --- a/xCAT/postscripts/ospkgs +++ b/xCAT/postscripts/ospkgs @@ -261,7 +261,7 @@ do # (1)for rhels6, there is one repodata in the os base dir; so keep it here, and handle the other cases below # (2)for sles, we should specified the baseurl should be ./install/sles11/ppc64/1 # (3)for SL5, we should append the /SL - # (4)for rhels8, centos8, ol8 and rocky8 we should append /BaseOS and /AppStream to base directory + # (4)for rhels8/9, centos8/9, ol8/9, alma8/9 and rocky8/9 we should append /BaseOS and /AppStream to base directory # (5) for other os, we just keep it here. # For other pkg paths, we just keep it here. if [ $dir == $default_pkgdir ] || [ $dir == "$default_pkgdir/" ]; then @@ -273,11 +273,12 @@ do ospkgdir="$ospkgdir/SL" fi fi - if ( ! pmatch "$OSVER" "rhels8*" && - ! pmatch "$OSVER" "centos8*" && - ! pmatch "$OSVER" "rocky8*" && - ! pmatch "$OSVER" "ol8*"); then - # For rhels8, centos8, ol8 and rocky8 do not put $ospkgdir by itself + if ( ! pmatch "$OSVER" "rhels[89]*" && + ! pmatch "$OSVER" "centos[89]*" && + ! pmatch "$OSVER" "rocky[89]*" && + ! pmatch "$OSVER" "alma[89]*" && + ! pmatch "$OSVER" "ol[89]*"); then + # For rhels8/9, centos8/9, ol8/9, alma8/9 and rocky8 do not put $ospkgdir by itself array_set_element os_path $index $ospkgdir fi array_set_element os_path $index $ospkgdir @@ -310,6 +311,7 @@ do if ( pmatch "$OSVER" "rhel*" || pmatch "$OSVER" "centos*" || pmatch "$OSVER" "rocky*" || + pmatch "$OSVER" "alma*" || pmatch "$OSVER" "ol*"); then #default_pkgdir="$INSTALLDIR/$OSVER/$ARCH" if [ $dir == $default_pkgdir ] || [ $dir == "$default_pkgdir/" ]; then @@ -343,11 +345,12 @@ do array_set_element os_path $index $ospkgdir_ok done fi # x86_64 - elif ( pmatch "$OSVER" "rhels8*" || - pmatch "$OSVER" "centos8*" || - pmatch "$OSVER" "rocky8*" || - pmatch "$OSVER" "ol8*"); then - # for rhels8, centos8, ol8 and rocky8 the repodata is in ./BaseOS, ./AppStream, not in ./ + elif ( pmatch "$OSVER" "rhels[89]*" || + pmatch "$OSVER" "centos[89]*" || + pmatch "$OSVER" "rocky[89]*" || + pmatch "$OSVER" "alma[89]*" || + pmatch "$OSVER" "ol[89]*"); then + # for rhels8/9, centos8/9, ol8/9, alma8/9 and rocky8/9 the repodata is in ./BaseOS, ./AppStream, not in ./ for arg in "BaseOS" "AppStream" do ospkgdir_ok="$ospkgdir/$arg" @@ -436,9 +439,9 @@ do #categorize the groups according to the action(install/remove) if [ $remove -eq 0 ]; then - groups="$groups $tmp" + groups="$groups @$tmp" else - groups_d="$groups_d $tmp" + groups_d="$groups_d @$tmp" fi else if ( pmatch "$x" "cuda*" ); then @@ -945,8 +948,8 @@ else #install new groups if any if [ -n "$groups" ]; then - #cmd="echo $groups| $ENVLIST xargs yum -y groupinstall" - cmd="$ENVLIST yum -y groupinstall $groups" + #cmd="$ENVLIST yum -y groupinstall $groups" + cmd="$ENVLIST yum -y install $groups" result=`eval $cmd 2>&1` R=$? if [ $R -ne 0 ]; then @@ -1005,7 +1008,8 @@ else #remove some groups if specified if [ -n "$groups_d" ]; then - cmd="$ENVLIST yum -y groupremove $groups_d" + #cmd="$ENVLIST yum -y groupremove $groups_d" + cmd="$ENVLIST yum -y remove $groups_d" result=`eval $cmd 2>&1` R=$? if [ $R -ne 0 ]; then diff --git a/xCAT/postscripts/otherpkgs b/xCAT/postscripts/otherpkgs index 1cba3d1ea..301174e11 100755 --- a/xCAT/postscripts/otherpkgs +++ b/xCAT/postscripts/otherpkgs @@ -340,7 +340,7 @@ fi # (1)for rhels6, there is one repodata in the os base dir; so keep it here, and handle the other cases below # (2)for sles, we should specified the baseurl should be ./install/sles11/ppc64/1 # (3)for SL5, we should append the /SL - # (4)for rhels8, centos8, ol8, and rocky8 we should append /BaseOS and /AppStream to base directory + # (4)for rhels8/9, centos8/9, ol8/9, alma8/9 and rocky8/9 we should append /BaseOS and /AppStream to base directory # (5) for other os, we just keep it here. # For other pkg paths, we just keep it here. if [ $dir == $default_pkgdir ] || [ $dir == "$default_pkgdir/" ]; then @@ -352,17 +352,19 @@ fi ospkgdir="$ospkgdir/SL" fi fi - if ( ! pmatch "$OSVER" "rhels8*" && - ! pmatch "$OSVER" "centos8*" && - ! pmatch "$OSVER" "rocky8*" && - ! pmatch "$OSVER" "ol8*"); then - # For rhels8, centos8, ol8, and rocky8 do not put $ospkgdir by itself + if ( ! pmatch "$OSVER" "rhels[89]*" && + ! pmatch "$OSVER" "centos[89]*" && + ! pmatch "$OSVER" "rocky[89]*" && + ! pmatch "$OSVER" "alma[89]*" && + ! pmatch "$OSVER" "ol[89]*"); then + # For rhels8/9, centos8/9, ol8/9, and rocky8/9 do not put $ospkgdir by itself array_set_element os_path $index $ospkgdir fi if ( pmatch "$OSVER" "rhel*" || pmatch "$OSVER" "centos*" || pmatch "$OSVER" "rocky*" || + pmatch "$OSVER" "alma*" || pmatch "$OSVER" "ol*"); then #default_pkgdir="$INSTALLDIR/$OSVER/$ARCH" if [ $dir == $default_pkgdir ] || [ $dir == "$default_pkgdir/" ]; then @@ -396,11 +398,12 @@ fi array_set_element os_path $index $ospkgdir_ok done fi # x86_64 - elif ( pmatch "$OSVER" "rhels8*" || - pmatch "$OSVER" "centos8*" || - pmatch "$OSVER" "rocky8*" || - pmatch "$OSVER" "ol8*"); then - # for rhels8, centos8 and rocky8 the repodata is in ./BaseOS, ./AppStream, not in ./ + elif ( pmatch "$OSVER" "rhels[89]*" || + pmatch "$OSVER" "centos[89]*" || + pmatch "$OSVER" "rocky[89]*" || + pmatch "$OSVER" "alma[89]*" || + pmatch "$OSVER" "ol[89]*"); then + # for rhels8/9, centos8/9, ol8/9, alma8/9 and rocky8/9 the repodata is in ./BaseOS, ./AppStream, not in ./ for arg in "BaseOS" "AppStream" do ospkgdir_ok="$ospkgdir/$arg" diff --git a/xCAT/postscripts/routeop b/xCAT/postscripts/routeop index fbded3f97..1ce7592e6 100755 --- a/xCAT/postscripts/routeop +++ b/xCAT/postscripts/routeop @@ -206,7 +206,7 @@ replace_persistent_route() if [ -f /etc/redhat-release ] then OS_name="redhat" #it can be RedHatFerdora or CentOS - elif [ -f /etc/SuSE-release ] + elif [ -f /etc/SuSE-release ] || [ -f /etc/SUSE-brand ] then OS_name="sles" else @@ -407,7 +407,7 @@ add_persistent_route() if [ -f /etc/redhat-release ] then OS_name="redhat" #it can be RedHatFerdora or CentOS - elif [ -f /etc/SuSE-release ] + elif [ -f /etc/SuSE-release ] || [ -f /etc/SUSE-brand ] then OS_name="sles" else @@ -647,7 +647,7 @@ rm_persistent_route() if [ -f /etc/redhat-release ] then OS_name="redhat" #it can be RedHatFerdora or CentOS - elif [ -f /etc/SuSE-release ] + elif [ -f /etc/SuSE-release ] || [ -f /etc/SUSE-brand ] then OS_name="sles" else diff --git a/xCAT/postscripts/setupesx b/xCAT/postscripts/setupesx index 81b94f4d0..6a8a49d2a 100755 --- a/xCAT/postscripts/setupesx +++ b/xCAT/postscripts/setupesx @@ -1,3 +1,4 @@ +#!/bin/sh # esx setup # example on how to set up ESX. We setup ssh and also add a basic # VLAN configuration diff --git a/xCAT/postscripts/setupntp.traditional b/xCAT/postscripts/setupntp.traditional index 51fb23e73..4f756df32 100755 --- a/xCAT/postscripts/setupntp.traditional +++ b/xCAT/postscripts/setupntp.traditional @@ -94,7 +94,7 @@ if [ $OS_TYPE = Linux ]; then mkdir -p /var/lib/ntp chown ntp /var/lib/ntp - if ( pmatch $OSVER "sle*" ) || ( pmatch $OSVER "suse*" ) || [ -f /etc/SuSE-release ];then + if ( pmatch $OSVER "sle*" ) || ( pmatch $OSVER "suse*" ) || [ -f /etc/SuSE-release ] || [ -f /etc/SUSE-brand ];then echo "driftfile /var/lib/ntp/drift/ntp.drift" >>$conf_file else echo "driftfile /var/lib/ntp/drift" >>$conf_file @@ -135,7 +135,7 @@ if [ $OS_TYPE = Linux ]; then hwclock --systohc --utc #setup the RTC is UTC format, which will be used by os - if ( pmatch $OSVER "sle*" ) || ( pmatch $OSVER "suse*" ) || [ -f /etc/SuSE-release ];then + if ( pmatch $OSVER "sle*" ) || ( pmatch $OSVER "suse*" ) || [ -f /etc/SuSE-release ] || [ -f /etc/SUSE-brand ];then grep -i -q "HWCLOCK" /etc/sysconfig/clock if [ $? -eq 0 ];then sed -i 's/.*HWCLOCK.*/HWCLOCK=\"-u\"/' /etc/sysconfig/clock diff --git a/xCAT/postscripts/sudoer b/xCAT/postscripts/sudoer index 45f90b1bb..f2f42e21d 100755 --- a/xCAT/postscripts/sudoer +++ b/xCAT/postscripts/sudoer @@ -43,7 +43,7 @@ sleep 1 rm -rf $HOME/.ssh/authorized_keys #----------------- -# Retrieve DSA key +# Retrieve RSA key #----------------- KEY=`cat /xcatpost/hostkeys/ssh_host_rsa_key.pub` @@ -52,7 +52,7 @@ echo -e $KEY >> $HOME/.ssh/authorized_keys #----------------- -# Retrieve RSA key +# Retrieve DSA key #----------------- KEY=`cat /xcatpost/hostkeys/ssh_host_dsa_key.pub` diff --git a/xCAT/postscripts/syslog b/xCAT/postscripts/syslog index 69be5579b..eaa08ff73 100755 --- a/xCAT/postscripts/syslog +++ b/xCAT/postscripts/syslog @@ -336,7 +336,7 @@ if [ "$(uname -s)" = "Linux" ]; then fi fi else - if ( pmatch $OSVER "sle*" ) || ( pmatch $OSVER "suse*" ) || [ -f /etc/SuSE-release ]; then + if ( pmatch $OSVER "sle*" ) || ( pmatch $OSVER "suse*" ) || [ -f /etc/SuSE-release ] || [ -f /etc/SUSE-brand ]; then #find out which syslog is used for SLES, syslog or syslog-ng result=`grep "^SYSLOG_DAEMON=" $sysconfig 2>&1` if ( pmatch $result "*syslog-ng*" ); then diff --git a/xCAT/postscripts/update_mlnx_adapter_firmware b/xCAT/postscripts/update_mlnx_adapter_firmware index faa618963..bc8f51913 100755 --- a/xCAT/postscripts/update_mlnx_adapter_firmware +++ b/xCAT/postscripts/update_mlnx_adapter_firmware @@ -3,7 +3,8 @@ # Sample postscript that can be executed to help update the firmware level on # Mellanox hardware adapters on the target nodes # -# This script requires passing in the path of the Mellanox OFED ISO +# This script requires passing in an optional force (-f) flag and +# the path of the Mellanox OFED ISO # located on the xCAT Management node under the /install directory. # # If OFED file is located here: @@ -11,10 +12,24 @@ # # Call the script as follows: # updatenode -P "update_mlnx_adapter_firmware /install/mlnxofed/MLNX_OFED_LINUX-4.1-4.0.7.1-rhel7.4alternate-ppc64le.iso" +# or +# updatenode -P "update_mlnx_adapter_firmware -f /install/mlnxofed/MLNX_OFED_LINUX-4.1-4.0.7.1-rhel7.4alternate-ppc64le.iso" # + +FORCE="" +while getopts "f" option +do + case "${option}" in + f) FORCE="--force-fw-update" + shift;; + *) echo "Usage: ${0} [-f] " + exit 1;; + esac +done + MLNX_OFED_PATH=${1} -if [[ -z ${1} ]]; then +if [[ -z ${MLNX_OFED_PATH} ]]; then echo "Error: you must provide the path of the MLNX OFED ISO file" exit 1 fi @@ -41,7 +56,7 @@ mkdir -p ${MOUNT_DIR} mount -o ro,loop ${TARGET_ISO_FILE} ${MOUNT_DIR} ls -ltr ${MOUNT_DIR} -${MOUNT_DIR}/mlnxofedinstall --fw-update-only +${MOUNT_DIR}/mlnxofedinstall --fw-update-only ${FORCE} # # Clean up diff --git a/xCAT/postscripts/xcatdsklspost b/xCAT/postscripts/xcatdsklspost index 98abeff80..4ffb02f77 100755 --- a/xCAT/postscripts/xcatdsklspost +++ b/xCAT/postscripts/xcatdsklspost @@ -537,10 +537,14 @@ else # for common mode MODE=1,2,3,5 (updatenode,moncfg,node deployment) # download poscripts has not worked yet #try the dhcp server, this is used for initial boot for the node. if [ $downloaded -eq 0 ]; then - #setup $OSVER ,for SLES11 + #setup $OSVER ,for SLES12 and earlier if [ -e '/etc/SuSE-release' ]; then OSVER=`grep -h VERSION /etc/SuSE-release |awk '{print $3}'` fi + #setup $OSVER ,for SLES15 and later + if [ -e '/etc/SUSE-brand' ]; then + OSVER=`grep -h VERSION /etc/SUSE-brand |awk '{print $3}'` + fi SIPS=`grep -h dhcp-server-identifier /var/lib/dhclient/dhclient*eth*.leases 2> /dev/null|awk '{print $3}'|sed -e 's/;//'` if [ -z "$SIPS" ]; then SIPS=`grep -h dhcp-server-identifier /var/lib/dhclient/dhclient*hf*.leases 2> /dev/null|awk '{print $3}'|sed -e 's/;//'` diff --git a/xCAT/postscripts/xcatlib.sh b/xCAT/postscripts/xcatlib.sh index 5ea888fcb..c4c8b4bea 100755 --- a/xCAT/postscripts/xcatlib.sh +++ b/xCAT/postscripts/xcatlib.sh @@ -430,7 +430,7 @@ function startservice { local retmsg retmsg=`$cmd 2>&1` retval=$? - [ "$retval" = "0" ] && (echo "$retmsg" | grep -i "Running in chroot,\s*ignoring request.*" >/dev/null 2>&1) && retval=1 + [ "$retval" = "0" ] && (echo "$retmsg" | grep -i "Running in chroot,\s*ignoring .*" >/dev/null 2>&1) && retval=1 return $retval } @@ -474,7 +474,7 @@ function stopservice { local retmsg retmsg=`$cmd 2>&1` retval=$? - [ "$retval" = "0" ] && (echo "$retmsg" | grep -i "Running in chroot,\s*ignoring request.*" >/dev/null 2>&1) && retval=1 + [ "$retval" = "0" ] && (echo "$retmsg" | grep -i "Running in chroot,\s*ignoring .*" >/dev/null 2>&1) && retval=1 return $retval } @@ -522,7 +522,7 @@ function restartservice { #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 - [ "$retval" = "0" ] && (echo "$retmsg" | grep -i "Running in chroot,\s*ignoring request.*" >/dev/null 2>&1) && retval=1 + [ "$retval" = "0" ] && (echo "$retmsg" | grep -i "Running in chroot,\s*ignoring .*" >/dev/null 2>&1) && retval=1 return $retval } diff --git a/xCAT/postscripts/xcatpostinit.service b/xCAT/postscripts/xcatpostinit.service old mode 100755 new mode 100644 diff --git a/xCATsn/debian/control b/xCATsn/debian/control index f93b9ac19..933b94862 100644 --- a/xCATsn/debian/control +++ b/xCATsn/debian/control @@ -9,7 +9,7 @@ Homepage: https://xcat.org/ Package: xcatsn Architecture: amd64 ppc64el Depends: ${perl:Depends}, goconserver (>=0.3.3-snap000000000000), xcat-server (>= 2.13-snap000000000000), xcat-client (>= 2.13-snap000000000000), libdbd-sqlite3-perl, libxml-parser-perl, tftpd-hpa, libnet-telnet-perl, isc-dhcp-server, apache2, nfs-kernel-server, xcat-genesis-scripts-ppc64 (>= 2.13-snap000000000000), xcat-genesis-scripts-amd64 (>= 2.13-snap000000000000) -Recommends: bind9, nmap, tftp-hpa, ipmitool-xcat (>= 1.8.17-1), syslinux[any-amd64], libsys-virt-perl, syslinux-xcat, xnba-undi, elilo-xcat, xcat-buildkit (>= 2.13-snap000000000000), xcat-probe (>= 2.13-snap000000000000) +Recommends: bind9, net-tools, nmap, tftp-hpa, ipmitool-xcat (>= 1.8.17-1), syslinux[any-amd64], libsys-virt-perl, syslinux-xcat, xnba-undi, elilo-xcat, xcat-buildkit (>= 2.13-snap000000000000), xcat-probe (>= 2.13-snap000000000000) Suggests: yaboot-xcat Description: Metapackage for a common, default xCAT service node setup xCATsn is a service node management package intended for at-scale