Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,19 @@ on:
# chmod /dev/kvm to allow non-root QEMU to use it
# if building distro config install: libdw-dev libssl-dev
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install shellcheck
run: sudo apt-get update -y && sudo apt-get install -y shellcheck
- name: Run shellcheck
run: shellcheck --severity=error autorun/*.sh cut/*.sh selftest/*.sh rapido
Comment thread
thackara marked this conversation as resolved.
- name: Run Rust format check and clippy lint
run: |
cargo --version
cargo fmt --check --all

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This differs slightly from c1e3994 in that you don't filter out third_party files. Is there any reason why?

cargo clippy --offline -- -A warnings -A clippy::byte_char_slices
test:
# aarch64 github runners don't provide kvm
runs-on: ubuntu-latest
Expand Down
8 changes: 6 additions & 2 deletions autorun/fcoe_local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,11 @@ create_acl() {
}

find_fcoedev() {
while [ ! -d /sys/class/fc_remote_ports/rport-* ]; do
while true; do
rports=(/sys/class/fc_remote_ports/rport-*/)
if [ -d "${rports[0]}" ]; then
break
fi
sleep 1
done
for rport in /sys/class/fc_remote_ports/rport-*; do
Expand All @@ -130,7 +134,7 @@ find_fcoedev() {
-o ${hctl} = "subsystem" ]; then
continue;
fi
for b in "${target}/${hctl}/block/*"; do
for b in "${target}/${hctl}/block/"*; do
bdev="$(basename ${b})"
if readlink -f /sys/block/${bdev} | grep -q "${hctl}"; then
echo $bdev
Expand Down
2 changes: 1 addition & 1 deletion autorun/fstests_ntfs3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set -x

# create mkfs symlink for xfstests, which assumes mkfs.$FSTYPE
mkfsbin="$(type -P mkfs.ntfs)"
ln -s "${mkfsbin}" "${mkfsbin}3" || break
ln -s "${mkfsbin}" "${mkfsbin}3" || _fatal "failed to create mkfs.ntfs3 symlink"

modprobe virtio_blk
modprobe zram num_devices="0" || _fatal "failed to load zram module"
Expand Down
16 changes: 8 additions & 8 deletions autorun/lib/fstests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ _fstests_devs_provision() {
declare -A _CFG=(["SCRATCH_DEV"]="" ["SCRATCH_LOGDEV"]="" \
["SCRATCH_RTDEV"]="" ["TEST_DEV"]="")

for i in $(ls /sys/block); do
_ser="$(cat /sys/block/${i}/serial 2>/dev/null)" ||
_ser="$(cat /sys/block/${i}/device/serial 2>/dev/null)" ||
for i in /sys/block/*; do
Comment thread
thackara marked this conversation as resolved.
_ser="$(cat ${i}/serial 2>/dev/null)" ||
_ser="$(cat ${i}/device/serial 2>/dev/null)" ||
continue
ser="${_ser// }"
[[ -v "_CFG[$ser]" ]] && _CFG[$ser]="/dev/${i}"
[[ -v "_CFG[$ser]" ]] && _CFG[$ser]="/dev/${i##*/}"
done

[ -b "${_CFG[TEST_DEV]}" ] || _fstests_devs_zram_setup TEST_DEV
Expand Down Expand Up @@ -54,12 +54,12 @@ _fstests_devs_pool_provision() {
["TEST_DEV"]="")
declare -a _POOL=()

for i in $(ls /sys/block); do
_ser="$(cat /sys/block/${i}/serial 2>/dev/null)" ||
_ser="$(cat /sys/block/${i}/device/serial 2>/dev/null)" ||
for i in /sys/block/*; do
_ser="$(cat ${i}/serial 2>/dev/null)" ||
_ser="$(cat ${i}/device/serial 2>/dev/null)" ||
continue
ser="${_ser// }"
devp="/dev/${i}"
devp="/dev/${i##*/}"
[[ -v "_CFG[$ser]" ]] && _CFG[$ser]="$devp"
[[ $ser == "SCRATCH_DEV"* && -b "$devp" ]] && _POOL+=("$devp")
done
Expand Down
6 changes: 3 additions & 3 deletions autorun/ocfs2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ EOF

# expect a device with serial=OCFS2
declare -A _CFG=(["OCFS2"]="")
for i in $(ls /sys/block); do
ser="$(cat /sys/block/${i}/serial 2>/dev/null)" || continue
[[ -v "_CFG[$ser]" ]] && _CFG[$ser]="/dev/${i}"
for i in /sys/block/*; do
ser="$(cat ${i}/serial 2>/dev/null)" || continue
[[ -v "_CFG[$ser]" ]] && _CFG[$ser]="/dev/${i##*/}"
done

[ -b "${_CFG[OCFS2]}" ] || _fatal "block device with serial=OCFS2 required"
Expand Down
2 changes: 1 addition & 1 deletion autorun/openiscsi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ iscsid || _fatal
iscsiadm -m discovery -t sendtargets -p $INITIATOR_DISCOVERY_ADDR || _fatal

# auth for normal (non-discovery) sessions
for i in $(ls /etc/iscsi/nodes/*/*/default); do
for i in /etc/iscsi/nodes/*/*/default; do
if [[ -n "${ISCSI_USER}${ISCSI_PASS}" ]]; then
sed -i "s#node.session.auth.authmethod = .*#node.session.auth.authmethod = CHAP#" $i
echo "node.session.auth.username = $ISCSI_USER" >> $i
Expand Down
6 changes: 3 additions & 3 deletions cut/fstests_xfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ mem_rsc="$((2048 + (zram_bytes * 2 / 1048576)))M"

man_deps=(man /etc/manpath.config \
$(man --path xfs_io xfs_spaceman xfs_db xfs_quota))
[[ ${man_deps[@]} == ${man_deps[@]%.gz} ]] || man_deps+=(zcat gzip)
[[ ${man_deps[@]} == ${man_deps[@]%.bz2} ]] || man_deps+=(bzcat)
[[ ${man_deps[@]} == ${man_deps[@]%.xz} ]] || man_deps+=(xzcat)
[[ "${man_deps[*]}" == "${man_deps[*]%.gz}" ]] || man_deps+=(zcat gzip)
[[ "${man_deps[*]}" == "${man_deps[*]%.bz2}" ]] || man_deps+=(bzcat)
[[ "${man_deps[*]}" == "${man_deps[*]%.xz}" ]] || man_deps+=(xzcat)

# xfs/122: pull in compiler and xfs headers
_rt_require_gcc req_inst stdio.h xfs/xfs.h xfs/xfs_types.h xfs/xfs_fs.h \
Expand Down
2 changes: 1 addition & 1 deletion selftest/selftest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ _run_tests() {
local tnum=0
local t

for t in $(ls "selftest/test/"${filter}); do
for t in selftest/test/${filter}*; do
Comment thread
thackara marked this conversation as resolved.
if ! [ -x "${t}" ]; then
echo "$t skipped"
continue
Expand Down
Loading
Loading