Skip to content

Conversation

@saijanani-c
Copy link

  • Integrated '-v -p spyre' and '-r -p spyre' (repair) flows.
  • Implemented automatic repair if validation fails, followed by re-validation.
  • Added non-root user execution.
  • Validates '/dev/vfio' population before and after ServiceReport execution.

@abdhaleegit abdhaleegit self-assigned this Dec 24, 2025
@abdhaleegit abdhaleegit self-requested a review December 24, 2025 07:20
Copy link
Collaborator

@abdhaleegit abdhaleegit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please look into comments and also upload logs

return True
except Exception:
pass
return False
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the whole code can be replaced by reusing get_pci_class () utils method.. please reuse the funciton

os.chdir(self.sourcedir)

if not self.spyrePresent():
self.cancel("Spyre Accelerator not present on this system")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test will be used for non spyre use case... so do not cancel instead move all spyre related options/test inside the if spyrePresent() block

if process.system(cmd, ignore_status=True, sudo=True, shell=True):
self.fail("ServiceReport: Failed command is: %s" % cmd)

spyreVerboseCmd = "./servicereport -v -p spyre"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove ./ as the servicereport is already installed and in the /bin executable path..

self.sourcedir = os.path.join(self.workdir, 'ServiceReport-master')
build.make(self.sourcedir)

def spyrePresent(self):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isAccelarator will be better name

if 'FAIL' in output:
self.log.info("FAIL detected in -v -p spyre")
spyreRepairCmd = "./servicereport -r -p spyre"
process.system(spyreRepairCmd, ignore_status=True, sudo=True, shell=True)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

process.system or process.run ?

if not os.path.exists('/dev/vfio') or not os.listdir('/dev/vfio'):
self.fail("/dev/vfio not populated after servicereport")

user = 'new_sentient_user'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep user name as senuser


process.run(f"useradd {user}", ignore_status=True, sudo=True, shell=True)
process.run(f"echo '{user}:{user}' | chpasswd", ignore_status=True, sudo=True, shell=True)
process.run(f"usermod -aG {group} {user}", ignore_status=True, sudo=True, shell=True)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove ignore_status .. it ignores even if command fails

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants