Skip to content

Commit

Permalink
Try to save artifacts (WIP)
Browse files Browse the repository at this point in the history
Signed-off-by: Kinga Stefaniuk <[email protected]>
  • Loading branch information
ktanska committed Oct 4, 2024
1 parent db40ee3 commit c609b42
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 116 deletions.
25 changes: 1 addition & 24 deletions .github/workflows/review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,27 +42,4 @@ jobs:
- name: 'Move prepared .checkpatch.conf file to main directory'
run: mv .github/tools/.checkpatch.conf .
- name: Run checkpatch review
uses: webispy/checkpatch-action@v9
upstream_tests:
runs-on: self-hosted
timeout-minutes: 120
name: upstream tests
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: 'Prepare machine'
run: |
vagrant snapshot restore clean_vm_v1
echo "FYI vagrant restore command finished with exit code: $?"
sleep 2
vagrant status
vagrant up
sleep 2
- name: 'Run tests'
run: |
vagrant ssh -c "cd host/mdadm && .github/tools/run_mdadm_tests.sh"
- uses: actions/download-artifact@v4
with:
name: /var/tmp/*.log
uses: webispy/checkpatch-action@v9
36 changes: 36 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: review
on:
pull_request:
paths:
- '*.c'
- '*.h'
jobs:
upstream_tests:
runs-on: self-hosted
timeout-minutes: 120
name: upstream tests
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: 'Prepare machine'
run: |
vagrant snapshot restore clean_vm_v1
vagrant status
vagrant up
- name: 'Run tests'
run: |
vagrant ssh -c "cd host/mdadm && .github/tools/run_mdadm_tests.sh"
- uses: actions/download-artifact@v4
with:
name: /var/tmp/*.log
cleanup:
runs-on: self-hosted
steps:
- name: Restore clean VM
run: vagrant snapshot restore clean_vm_v1
- name: Stop md devices
run: sudo mdadm -Ss
- name: Clean logs
run: rm -rf /var/tmp/*.log
2 changes: 1 addition & 1 deletion Detail.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ int Detail(char *dev, struct context *c)
array.major_version,
array.minor_version);
}

//test
if (info && memcmp(info->uuid, uuid_zero, sizeof(int[4])) != 0)
mp = map_by_uuid(&map, info->uuid);
if (!mp)
Expand Down
92 changes: 1 addition & 91 deletions tests/07layouts.broken
Original file line number Diff line number Diff line change
@@ -1,91 +1 @@

# check that kernel an restripe interpret all the different layouts
# the same
# This involves changing the layout to each different possibility
# while MDADM_GROW_VERIFY is set.

testK=$[64*3*6]
dd if=/dev/urandom of=/tmp/RandFile bs=1024 count=$testK
export MDADM_GROW_VERITY=1


dotest() {
sleep 0.5
check wait
testdev $md0 $1 $mdsize1 512 nd
blockdev --flushbufs $md0
cmp -s -n $[textK*1024] $md0 /tmp/RandFile || { echo cmp failed; exit 2; }
# write something new - shift chars 4 space
tr ' -~' '$-~ -#' < /tmp/RandFile > /tmp/RandFile2
mv /tmp/RandFile2 /tmp/RandFile
dd if=/tmp/RandFile of=$md0
}

checkgeo() {
# check the geometry of an array
# level raid_disks chunk_size layout
dev=$1
shift
sleep 0.5
check wait
for attr in level raid_disks chunk_size layout
do
if [ $# -gt 0 ] ; then
val=$1
shift
if [ " `sed 's/ .*//' /sys/block/$dev/md/$attr`" != " $val" ]
then echo "$attr doesn't match for $dev"
exit 1
fi
fi
done
}


bu=/tmp/md-test-backup
rm -f $bu

# first a degraded 5 device raid5
mdadm -CR $md0 -l5 -n5 $dev0 $dev1 missing $dev2 $dev3
dd if=/tmp/RandFile of=$md0
dotest 4

l5[0]=la
l5[1]=ra
l5[2]=ls
l5[3]=rs
l5[4]=parity-first
l5[5]=parity-last
for layout in 0 1 2 3 4 5 0
do
mdadm -G $md0 --layout=${l5[$layout]} --backup-file $bu
checkgeo md0 raid5 5 $[512*1024] $layout
dotest 4
done

mdadm -S $md0
# now a doubly degraded raid6
mdadm -CR $md0 -l6 -n5 $dev0 missing $dev2 missing $dev4
dd if=/tmp/RandFile of=$md0
dotest 3

l6[0]=la
l6[1]=ra
l6[2]=ls
l6[3]=rs
l6[4]=parity-first
l6[5]=parity-last
l6[8]=ddf-zero-restart
l6[9]=ddf-N-restart
l6[10]=ddf-N-continue
l6[16]=left-asymmetric-6
l6[17]=right-asymmetric-6
l6[18]=left-symmetric-6
l6[19]=right-symmetric-6
l6[20]=parity-first-6
for layout in 0 1 2 3 4 5 8 9 10 16 17 18 19 20 0
do
mdadm -G $md0 --layout=${l6[$layout]} --backup-file $bu
checkgeo md0 raid6 5 $[512*1024] $layout
dotest 3
done
always broken
1 change: 1 addition & 0 deletions tests/14imsm-r5_3d-migrate-r4_3d.broken
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
always fails
2 changes: 2 additions & 0 deletions tests/imsm-grow-template
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,10 @@ if [ $migration_test -ne 0 ]; then
if [ -z $new_num_disks ]; then
new_num_disks=$num_disks
fi
sleep 5
grow_member $member0 $new_num_disks $vol0_new_num_comps $vol0_new_level $vol0_comp_size $vol0_offset $vol0_new_chunk $vol0_chunk
if [[ $vol1_new_chunk -ne 0 ]] ; then
sleep 5
grow_member $member1 $new_num_disks $vol1_new_num_comps $vol1_new_level $vol1_comp_size $vol1_offset $vol1_new_chunk $vol1_chunk
fi
else
Expand Down

0 comments on commit c609b42

Please sign in to comment.