Skip to content

Commit

Permalink
rfe: Introduce codespell hook
Browse files Browse the repository at this point in the history
codespell can help us identify typos, and fix common misspellings in
text files.

Signed-off-by: Yihuang Yu <[email protected]>
  • Loading branch information
PaulYuuu committed Jun 27, 2024
1 parent 38c2b0b commit 14e6a6f
Show file tree
Hide file tree
Showing 284 changed files with 540 additions and 503 deletions.
4 changes: 4 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[codespell]
builtin = clear,code,rare
ignore-words = codespell.ignore
skip = ./.git
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@ repos:
hooks:
- id: pyupgrade
args: ["--py36-plus"]
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
27 changes: 27 additions & 0 deletions codespell.ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
3Rt
addin
assertIn
bootup
CAS
creat
deque
ErrorString
FO
hda
Infor
isnt
MOR
msdos
parm
parms
ro
rw
snd
stap
stdio
treshold
te
thn
threshold
uint
ulimited
4 changes: 2 additions & 2 deletions deps/hlk/hlk_studio.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ function setmachinestate {
if (-Not $WntdMachine.SetMachineStatus([Microsoft.Windows.Kits.Hardware.ObjectModel.MachineStatus]::NotReady, $timeout)) { throw "Unable to change machine state, timed out." }
}
default {
throw "Provided desired machines's sate is not valid, aborting..."
throw "Provided desired machines's state is not valid, aborting..."
}
}
}
Expand Down Expand Up @@ -2213,7 +2213,7 @@ function Usage {
Write-Output ""
Write-Output " createprojectpackage : Creates a project's package."
Write-Output ""
Write-Output "NOTE: For more infromation about every action use action's -help parameter!"
Write-Output "NOTE: For more information about every action use action's -help parameter!"
Write-Output "NOTE: Windows HLK Studio should be installed on the machine running the script!"
}

Expand Down
2 changes: 1 addition & 1 deletion generic/deps/monotonic_time/threads.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ int create_threads(int nthreads, thread_func_t func, void *arg)


/*
* Join with the set of previsouly created threads.
* Join with the set of previously created threads.
*/
void join_threads(void)
{
Expand Down
2 changes: 1 addition & 1 deletion generic/tests/autotest_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def run_autotest_control_background(test, params, env, test_control_file="contro
3) Fork the process and let the run() run in the child
4) Catch the exception raise by run() and exit the child with
non-zero return code.
5) If no exception catched, return 0
5) If no exception caught, return 0
:param test: QEMU test object
:param params: Dictionary with the test parameters
Expand Down
4 changes: 2 additions & 2 deletions generic/tests/boot_savevm.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def run(test, params, env):
libvirt boot savevm test:
1) Start guest booting
2) Record origin informations of snapshot list for floppy(optional).
2) Record origin information of snapshot list for floppy(optional).
3) Periodically savevm/loadvm while guest booting
4) Stop test when able to login, or fail after timeout seconds.
5) Check snapshot list for floppy and compare with the origin
Expand Down Expand Up @@ -55,7 +55,7 @@ def run(test, params, env):
time.sleep(savevm_delay)
vm.pause()
if params["save_method"] == "save_to_file":
vm.save_to_file(savevm_statefile) # Re-use same filename
vm.save_to_file(savevm_statefile) # Reuse same filename
vm.restore_from_file(savevm_statefile)
else:
vm.savevm("1")
Expand Down
8 changes: 4 additions & 4 deletions generic/tests/cfg/autotest.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
only Linux
type = autotest_control
# Notes:
# Uncomment below 'network_proxies' to vist github websit via
# Uncomment below 'network_proxies' to visit github websit via
# network proxy server, or update 'client_tests_url' to a private
# url to speed up download speed, if it's necessary.
#client_tests_url = https://codeload.github.com/autotest/autotest-client-tests/tar.gz/master
Expand Down Expand Up @@ -67,7 +67,7 @@
- ltp:
# This timeout has to be set inaccordance with timeout
# argument in ltp.control (-t 1h)file.
# Currently it is set to 1 hour and correspodingly this time
# Currently it is set to 1 hour and correspondingly this time
# has been kept (3600+1000) 4600 seconds.
# Inorder to run ltp for more time change the timeout here and
# ltp.control file appropriately.
Expand All @@ -94,7 +94,7 @@
- scsi-disk:
drive_format_asd = scsi-disk
- xfstests:
# Below packages requried to installed in guest before start test:
# Below packages required to installed in guest before start test:
# xfsdump, xfsprogs xfsprogs-devel
no RHEL.3 RHEL.4 RHEL.5 RHEL.6
kill_vm = yes
Expand All @@ -119,7 +119,7 @@
image_size_stg = 10G
force_create_image_stg = yes
test_control_file = parallel_dd.control
- compliebench:
- compilebench:
test_control_file = compilebench.control
- fsstress:
test_timeout = 36000
Expand Down
6 changes: 3 additions & 3 deletions generic/tests/cfg/netperf.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@
# physical_nic =
# bridge_force_create=yes
# bridge_nic1 =
#numa configration
#numa configuration
numa_node = -1
netperf_with_numa = yes
# configure netperf test parameters, some seconds will be took to
# wait all the clients work, this wait time should be less than
# 0.5 * l, the wait time will augments if you have move
# threads. So experientially suggest l should be not less than 60.
l = 60
#Test protocol and test data configration
#Test protocol and test data configuration
protocols = "TCP_STREAM TCP_MAERTS TCP_RR"
sessions = "1 2 4 8"
sessions_rr = "1 25 50"
Expand All @@ -59,7 +59,7 @@
os_type_client = linux
os_type_host = linux
shell_prompt_host = \[root@.{0,50}][\#\$]
#Test base env configration
#Test base env configuration
ver_cmd = rpm -q qemu-kvm
netperf_version = 2.7.1
netperf_pkg = netperf/netperf-2.7.1.tar.bz2
Expand Down
2 changes: 1 addition & 1 deletion generic/tests/cfg/pxe_boot.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
extra_params += " -no-shutdown"
# pxe_boot does not work for macvtap backend, as pxe can't
# capture the packet from the macvtap tap port, disable it
# for macvtap temporarily, will fix it in the furture.
# for macvtap temporarily, will fix it in the future.
no macvtap
no igb
cdroms = ""
Expand Down
2 changes: 1 addition & 1 deletion generic/tests/dd_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def run(test, params, env):
Test steps:
1). wait guest boot up
2). run dd command in guest with special params(eg. oflag, bs and so on)
3). check command exit stauts and output
3). check command exit status and output
"""

def _get_file(filename, select, test=test):
Expand Down
2 changes: 1 addition & 1 deletion generic/tests/guest_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def run(test, params, env):
script_params = params.get("script_params", "")
test_timeout = float(params.get("test_timeout", 600))

test.log.debug("Starting preparing resouce files...")
test.log.debug("Starting preparing resource files...")
# Download the script resource from a remote server, or
# prepare the script using rss?
if params.get("download") == "yes":
Expand Down
2 changes: 1 addition & 1 deletion generic/tests/iofuzz.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def run(test, params, env):

def qemu_img_check():
"""
Check guest disk image, and backup image when error occured
Check guest disk image, and backup image when error occurred
"""
params["backup_image_on_check_error"] = "yes"
base_dir = data_dir.get_data_dir()
Expand Down
2 changes: 1 addition & 1 deletion generic/tests/iometer_windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def run(test, params, env):
1) Boot guest with additional disk
2) Format the additional disk
3) Install and register Iometer
4) Perpare icf to Iometer.exe
4) Prepare icf to Iometer.exe
5) Run Iometer.exe with icf
6) Copy result to host
Expand Down
2 changes: 1 addition & 1 deletion generic/tests/jumbo.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def get_ovs_ports(ovs):
session_serial, connection_id, mode=mode
)

error_context.context("Chaning the MTU of host tap ...", test.log.info)
error_context.context("Changing the MTU of host tap ...", test.log.info)
host_mtu_cmd = "ifconfig %s mtu %s"
# Before change macvtap mtu, must set the base interface mtu
if params.get("nettype") == "macvtap":
Expand Down
2 changes: 1 addition & 1 deletion generic/tests/module_probe.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def run(test, params, env):
This tests the kernel pre-installed kernel modules
"""
# Destory all vms for unload/load module kvm_intel/kvm_amd
# Destroy all vms for unload/load module kvm_intel/kvm_amd
for vm in env.get_all_vms():
if vm:
vm.destroy()
Expand Down
4 changes: 2 additions & 2 deletions generic/tests/netperf.py
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ def launch_client(

def count_interrupt(name):
"""
Get a list of interrut number for each queue
Get a list of interrupt number for each queue
@param name: the name of interrupt, such as "virtio0-input"
"""
Expand Down Expand Up @@ -789,7 +789,7 @@ def parse_demo_result(fname, sessions):
nresult = i - 1
if nresult < int(sessions):
test.error(
f"We couldn't expect this parallism, expect {sessions} get {nresult}"
f"We couldn't expect this parallelism, expect {sessions} get {nresult}"
)

niteration = nresult // sessions
Expand Down
2 changes: 1 addition & 1 deletion generic/tests/nfs_corrupt.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def run(test, params, env):

def get_nfs_devname(params, session):
"""
Get the possbile name of nfs storage dev name in guest.
Get the possible name of nfs storage dev name in guest.
:param params: Test params dictionary.
:param session: An SSH session object.
Expand Down
4 changes: 2 additions & 2 deletions generic/tests/ntpd.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def close_session(self):
# Server configuration
def server_config(self):
"""
configuer the ntp server:
configure the ntp server:
1.ZONE = American/New_York;
2.start ntpd service;
3.restrict the host and guest
Expand Down Expand Up @@ -101,7 +101,7 @@ def server_config(self):
# Host configuration
def host_config(self):
"""
configuer the host :
configure the host :
1.ZONE = American/New_York;
2.check cpuinfo;
3.add ntp server ip;
Expand Down
4 changes: 2 additions & 2 deletions generic/tests/ntttcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def _wait():

def sender():
"""Send side"""
test.log.info("Sarting sender process ...")
test.log.info("Starting sender process ...")
session = vm_sender.wait_for_serial_login(timeout=login_timeout)
install_ntttcp(session)
ntttcp_sender_cmd = params.get("ntttcp_sender_cmd")
Expand Down Expand Up @@ -174,7 +174,7 @@ def parse_file(resultfile):
sender()
bg.join(suppress_exception=True)
else:
test.error("Can't start backgroud receiver thread")
test.error("Can't start background receiver thread")
finally:
for i in glob.glob(f"{results_path}.receiver"):
f = open(f"{results_path}.RHS", "w")
Expand Down
2 changes: 1 addition & 1 deletion generic/tests/pktgen_perf.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def run(test, params, env):

def _pin_vm_threads(node):
"""
pin guest vcpu and vhost threads to cpus of a numa node repectively
pin guest vcpu and vhost threads to cpus of a numa node respectively
:param node: which numa node to pin
"""
Expand Down
10 changes: 5 additions & 5 deletions generic/tests/save_restore.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def get_save_filename(path="", file_pfx=""):
"""
Generate a guaranteed not to clash filename.
@oaram: path: Optional base path to place file
@param: path: Optional base path to place file
:param file_pfxx: Optional prefix to filename
:return: absolute path to new non-clashing filename
"""
Expand Down Expand Up @@ -115,24 +115,24 @@ def check_system(test, vm, timeout):
finally:
if save_file:
nuke_filename(save_file) # make sure these are cleaned up
# Prepare/check next loop itteration
# Prepare/check next loop iteration
repeat -= 1
# TODO: or BG test status==foo
if (now >= time_to_stop) or (repeat <= 0):
break
save_file = get_save_filename(path, file_pfx)
# Check the final save/restore cycle
check_system(test, vm, 120) # networking needs time to recover
test.log.info("Save/Restore itteration(s) complete.")
test.log.info("Save/Restore iteration(s) complete.")
if save_restore_bg_command and bg_command_pid:
session = vm.wait_for_login(timeout=120)
status = session.cmd_status("kill %d" % bg_command_pid)
if status != 0:
test.log.warning("Background guest command kill %d failed", bg_command_pid)
del session
if repeat > 0: # time_to_stop reached but itterations didn't complete
if repeat > 0: # time_to_stop reached but iterations didn't complete
test.fail(
"Save/Restore save_restore_duration"
" exceeded by %0.4f seconds with %d itterations"
" exceeded by %0.4f seconds with %d iterations"
" remaining." % (now - time_to_stop, repeat + 1)
)
4 changes: 2 additions & 2 deletions generic/tests/syzkaller.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def run(test, params, env):
3. Prepare and compile Guest kernel
4. Prepare syzkaller config with qemu params and guest params
5. Start sykaller with above config and run for specified time(test_timeout)
6. Test fails out incase of any host issues
6. Test fails out in case of any host issues
"""
start_time = time.time()
# Step 1: Install/Setup syzkaller in host
Expand Down Expand Up @@ -107,6 +107,6 @@ def run(test, params, env):
process.run(cmd, timeout=testtimeout, ignore_status=True, shell=True)
# Let's delete linux kernel folder from test-results as it would
# consume lot of space and test log have all the information about
# it incase to retrieve it back.
# it in case to retrieve it back.
if os.path.isdir(guest_kernel_build_path):
shutil.rmtree(guest_kernel_build_path)
2 changes: 1 addition & 1 deletion generic/tests/trans_hugepage_defrag.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def change_feature_status(status, feature_path, test_config):
off_action = "0"
else:
raise ValueError(
f"Uknown possible values for file {test_config.thp_path}: {possible_values}"
f"Unknown possible values for file {test_config.thp_path}: {possible_values}"
)

if status == "on":
Expand Down
2 changes: 1 addition & 1 deletion generic/tests/trans_hugepage_relocated.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
def run(test, params, env):
"""
Transparent hugepage relocated test with quantification.
The pages thp deamon will scan for one round set to 4096, and the sleep
The pages thp daemon will scan for one round set to 4096, and the sleep
time will be set to 10 seconds. And alloc sleep time is set to 1 minute.
So the hugepage size should increase 16M every 10 seconds, and when system
is busy and it failed to allocate hugepage for guest, the value will keep
Expand Down
2 changes: 1 addition & 1 deletion generic/tests/whql_env_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,4 @@ def run(test, params, env):
utils_misc.log_line(error_log, o)

if failed_flag != 0:
test.fail(f"Have {failed_flag} setup fialed. Please check the log.")
test.fail(f"Have {failed_flag} setup failed. Please check the log.")
4 changes: 2 additions & 2 deletions multi_host_migration/tests/cfg/multi_host.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- @multi_host:
# params which ends with hostx will be sended only to machinex in autoserv
# test command ./autoserv -m machine1,machine2 multi_host.srv
# this mean host1 parmas will be send to machine1
# this mean host1 params will be send to machine1
# host2 params will be send to machine2 etc..

remove_image_on_check_error = yes
Expand Down Expand Up @@ -175,7 +175,7 @@
# amount of memory shouldn't be too high otherwise
# migration will never end
type = migration_multi_host_ping_pong
# stress_memory should be less than troughput of
# stress_memory should be less than throughput of
# migration
stress_memory = 50
migrate_count = 3
Expand Down
Loading

0 comments on commit 14e6a6f

Please sign in to comment.