Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpTestInterrupt.py: This patch validates interrupt controller mechanism #580

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

shirishaganta
Copy link

It checks system reboot with xive on and off and
it also validates interrupts handled by CPU's

Signed-off-by: shirisha Ganta [email protected]

@ruscur
Copy link
Collaborator

ruscur commented Mar 8, 2020

Can one of the admins verify this patch?

@shirishaganta shirishaganta force-pushed the interrupt_controller branch from 2d61665 to 99a130a Compare March 9, 2020 05:55
#
# OpenPOWER Automated Test Project
#
# Contributors Listed Below - COPYRIGHT 2017

Choose a reason for hiding this comment

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

2020?

from common.OpTestSSH import ConsoleState as SSHConnectionState
from common.OpTestConstants import OpTestConstants as BMC_CONST
from common.Exceptions import KernelOOPS, KernelKdump

Choose a reason for hiding this comment

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

DO you really need to import all these imports?

This module contain testcases related to XIVE.

1.Enable kernel logging, basically generate traffic
2.Enable console traffic by printing the

Choose a reason for hiding this comment

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

Unnecessary new line. Generally sentence can go up to 80 chars.

Also I see unecessary spaces, trailing spaces in multiple places . Please fix them.


This module contain testcases related to XIVE.

1.Enable kernel logging, basically generate traffic

Choose a reason for hiding this comment

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

Generate what traffic ?

Also may be its worth to expand description little bit . .so that its easy for review.

self.util = self.cv_SYSTEM.util
self.c = self.cv_SYSTEM.console
self.con = self.cv_SYSTEM.cv_HOST.get_ssh_connection()

Choose a reason for hiding this comment

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

Looks like some of the variables are just assigned but not used.

'''
This function will validate interrupts handled by CPU's.
Make sure while running this function xive should be on
'''

Choose a reason for hiding this comment

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

Where are you making sure xive is on?

'''
self.con = self.cv_SYSTEM.cv_HOST.get_ssh_connection()
res = self.con.run_command("ip route list | grep default | awk '{print $5}'")
inter = "cat /proc/interrupts | grep %s | head -1" % res[0]

Choose a reason for hiding this comment

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

replace inter with some name. which reflects usage (may be interrupt)?

self.interrupt_cpu_check()


def crash_suite():

Choose a reason for hiding this comment

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

Why do you need crash_suite here? Also name doesn't reflect what you are doing here.

IIUC _suite for meant for grouping multiple tests into one test bucket and run.

smp = "%s | awk '{print $1}'" % inter
result = self.con.run_command(smp)
self.con.run_command("cd /proc/irq/%s" % result[0].lstrip().split(':')[0])
self.con.run_command("cat smp_affinity_list")

Choose a reason for hiding this comment

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

Can't you use absolute path and run cat instead of switching to that directory?

result = self.con.run_command(smp)
self.con.run_command("cd /proc/irq/%s" % result[0].lstrip().split(':')[0])
self.con.run_command("cat smp_affinity_list")
log.info("setting smp_affinity_list to CPU2")

Choose a reason for hiding this comment

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

Are you sure it will be always CPU2?

Copy link
Author

Choose a reason for hiding this comment

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

randomly we selected the cpu number as atleast 4 cpus we will have in smt8

It checks system reboot with xive on and off and
it also validates interrupts handled by CPU's

Signed-off-by: shirisha Ganta <[email protected]>
@shirishaganta
Copy link
Author

After addressing the above comments, Changed the testcase according to that

@PraveenPenguin PraveenPenguin force-pushed the master branch 2 times, most recently from 4d0cb14 to b976629 Compare October 6, 2023 07:38
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.

3 participants