-
Notifications
You must be signed in to change notification settings - Fork 212
Add and fix hyperv modules test #3853
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
base: main
Are you sure you want to change the base?
Conversation
1cdd16f
to
6b9ac2e
Compare
6b9ac2e
to
14d92fc
Compare
14d92fc
to
747ca1b
Compare
bdc9e3e
to
df80e7a
Compare
[ | ||
# Modules which dont have "=y" in the kernel config | ||
# and therefore are not built into the kernel. | ||
"NOT_BUILT_IN", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be
BUILT_IN
=yMODULE
=mNOT_BUILD
=n
lisa/tools/dhclient.py
Outdated
@@ -42,6 +42,15 @@ def _freebsd_tool(cls) -> Optional[Type[Tool]]: | |||
def can_install(self) -> bool: | |||
return False | |||
|
|||
def generate_renew_command(self, interface: str = "eth0") -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also reuse it inside of the dhclient
to reduce duplicate code.
df80e7a
to
ee2c759
Compare
ee2c759
to
d0fefcc
Compare
lisa/tools/modprobe.py
Outdated
).stdout.strip() | ||
) | ||
|
||
# self.node.execute( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove unused code, instead of comment out.
lisa/tools/modprobe.py
Outdated
Path(__file__).parent.joinpath("scripts"), ["modprobe_reloader.sh"] | ||
) | ||
|
||
parameters = f'{nohup_output_log_file_name} {loop_process_pid_file_name} {mod_name} {times} {verbose_flag} "{dhclient_renew_command}"' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add comments above to explain them.
pid_file="$2" | ||
module_name="$3" | ||
times="$4" # 100 | ||
verbose="$5" # true/false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can they have a default value?
sleep 1 | ||
ip link set eth0 down >> $log_file 2>&1 | ||
ip link set eth0 up >> $log_file 2>&1 | ||
dhcpcd -k eth0 >> $log_file 2>&1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it use dhclient_renew_command
?
' | ||
fi | ||
|
||
# sudo sh -c '(for i in \$(seq 1 $times); do modprobe -r $verbose $mod_name >> $nohup_output_log_file_name 2>&1; modprobe $verbose $mod_name >> $nohup_output_log_file_name 2>&1; done; sleep 1; ip link set eth0 down; ip link set eth0 up; $renew_command)' & echo \$! > $loop_process_pid_file_name" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove it.
echo \$! > $pid_file'" | ||
|
||
|
||
sudo nohup sh -c ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about moving sudo, nohup, sh, and log file redirection outside the script? It could simplify the script by handling logging externally.
) | ||
failed_modules[module] = failure_message | ||
|
||
result_message = "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line shouldn't be followed by the next line. Use either += without this line, or = to set the value of result_message.
f"Expected {module} to be inserted {loop_count} times" | ||
).is_equal_to(loop_count) | ||
if failed_modules: | ||
raise AssertionError(result_message) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
raise LISAException(...
lisa/tools/modprobe.py
Outdated
"\nTrying to reconnect to the remote node in 10 sec..." | ||
) | ||
|
||
time.sleep(10) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make it shorter like 2 seconds.
5412db8
to
0a0b061
Compare
0a0b061
to
d1ae631
Compare
This PR contains the changes: