Bug 1889971

Summary: redhat-certification-backend checks wrong service name "rpcbindd.service"
Product: Red Hat Certification Program Reporter: Frank Liang <xiliang>
Component: redhat-certification-cloudAssignee: Greg Nichols <gnichols>
Status: NEW --- QA Contact: rhcert qe <rhcert-qe>
Severity: low Docs Contact:
Priority: low    
Version: 1.0CC: leiwang, linl, tumeya, vkuznets, ymao
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Frank Liang 2020-10-21 06:44:42 UTC
rhcert suite(redhat-certification-backend-7.18-20201006.1.el8.noarch.rpm) is trying to find a wrong service name "rpcbindd.service", it should be "rpcbind.service"

Below is error log:
Enter the choice number or the choice value: 1
response: 10.22.1.60
Picked 10.22.1.60
error: file /usr/lib/systemd/system/rpcbindd.service: No such file or directory
Displaying Open Ports Information:
NOTE: Allowed Open Ports: ['80', '8009', '22', '443']

The code logic is as below, it is not accurate to append 'd' to the service name from 'nmap' output.

def get_service_source_package(self, service):

        if self.release == 6:
            service_dir = self.rhel6_service_dir + service
        elif self.release == 7:
            service_dir = self.rhel7_service_dir + service + "d.service"
        elif self.release == 8:
            service_dir = self.rhel8_service_dir + service + "d.service"

Below is manually check:
# nmap -Pn 10.22.1.60
Starting Nmap 7.70 ( https://nmap.org ) at 2020-10-21 06:29 UTC
Nmap scan report for ip-10-22-1-60.us-west-2.compute.internal (10.22.1.60)
Host is up (0.0000070s latency).
Not shown: 998 closed ports
PORT    STATE SERVICE
22/tcp  open  ssh
111/tcp open  rpcbind
[root@ip-10-22-1-60 rhcert]# ls -l /usr/lib/systemd/system/rpcbindd.service
ls: cannot access '/usr/lib/systemd/system/rpcbindd.service': No such file or directory
[root@ip-10-22-1-60 rhcert]# ls -l /usr/lib/systemd/system/rpcbind.service
-rw-r--r--. 1 root root 544 Feb  6  2020 /usr/lib/systemd/system/rpcbind.service
[root@ip-10-22-1-60 rhcert]# systemctl status rpcbind.service
● rpcbind.service - RPC Bind
   Loaded: loaded (/usr/lib/systemd/system/rpcbind.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2020-10-21 05:32:31 UTC; 59min ago
     Docs: man:rpcbind(8)
 Main PID: 826 (rpcbind)
    Tasks: 1 (limit: 48940)
   Memory: 2.1M
   CGroup: /system.slice/rpcbind.service
           └─826 /usr/bin/rpcbind -w -f

Oct 21 05:32:31 ip-10-22-1-60.us-west-2.compute.internal systemd[1]: Starting RPC Bind...
Oct 21 05:32:31 ip-10-22-1-60.us-west-2.compute.internal systemd[1]: Started RPC Bind.

Version-Release number of selected components (if applicable):

RHEL Version:
RHEL-8.4(4.18.0-193.28.1.el8_2.x86_64)

How reproducible:
100%

Steps to Reproduce:
1. Start a RHEL-8.2 instance
2. Install redhat-certification-cloud and other required pkgs.
3. Run cert test.

Actual results:
Wrong service name detected.

Expected results:
Correct service name detected.

Additional info:
- N/A