Skip to content
This repository was archived by the owner on Oct 26, 2021. It is now read-only.

Commit 914d75c

Browse files
author
Ludwig Richter
authored
Merge pull request #14 from server-state/hotfix-parser-activity-type
Bugfix for parser activity type
2 parents 0f7bd0c + 11f12e4 commit 914d75c

File tree

6 files changed

+138
-2
lines changed

6 files changed

+138
-2
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Personalities : [raid1] [raid0] [linear] [multipath] [raid6] [raid5] [raid4] [raid10]
2+
md127 : active raid1 sda1[1] sdb1[0]
3+
3906783040 blocks super 1.2 [2/2] [UU]
4+
[>....................] check = 0.9% (35327488/3906783040) finish=352.4min speed=183050K/sec
5+
bitmap: 0/30 pages [0KB], 65536KB chunk
6+
7+
unused devices: <none>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Personalities : [raid1] [raid0] [linear] [multipath] [raid6] [raid5] [raid4] [raid10]
2+
md127 : active raid1 sda1[1] sdb1[0]
3+
3906783040 blocks super 1.2 [2/2] [UU]
4+
[==============>......] check = 73.9% (2502342341/3906783040) finish=52.7min speed=186040K/sec
5+
bitmap: 0/30 pages [0KB], 65536KB chunk
6+
7+
unused devices: <none>

index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/grammar.pegjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ activity
125125
}
126126

127127
activityType
128-
= "recovery" / "resync"
128+
= "recovery" / "resync" / "check"
129129

130130
progress
131131
= progress:float "% " {

tests/010-parser.test.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,14 @@ const TEST_DEFINITION = [
114114
[
115115
'recovering with 1 failed device phase 1',
116116
'./examples/mdstat/raid1wsb.mdstat.faulty.0'
117+
],
118+
[
119+
'checking with issued check command 1',
120+
'./examples/mdstat/raid1wsb.mdstat.check.0'
121+
],
122+
[
123+
'checking with issued check command 2',
124+
'./examples/mdstat/raid1wsb.mdstat.check.1'
117125
]
118126
]
119127
]

tests/__snapshots__/010-parser.test.js.snap

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,120 @@ Object {
575575
}
576576
`;
577577

578+
exports[`Test parser at different RAID1 definitions Test especially RAID1 with 2 devices and a bitmap should parse correctly a RAID1 definition checking with issued check command 1 1`] = `
579+
Object {
580+
"personalities": Array [
581+
"raid1",
582+
"raid0",
583+
"linear",
584+
"multipath",
585+
"raid6",
586+
"raid5",
587+
"raid4",
588+
"raid10",
589+
],
590+
"raids": Array [
591+
Object {
592+
"access": "rw",
593+
"blocks": 3906783040,
594+
"current": 2,
595+
"devices": Array [
596+
Object {
597+
"index": 1,
598+
"name": "sda1",
599+
"status": "active",
600+
},
601+
Object {
602+
"index": 0,
603+
"name": "sdb1",
604+
"status": "active",
605+
},
606+
],
607+
"ideal": 2,
608+
"name": "md127",
609+
"options": Array [
610+
Object {
611+
"activityType": "check",
612+
"finish": 352.4,
613+
"processed": 35327488,
614+
"progress": 0.9,
615+
"speed": 183050,
616+
"total": 3906783040,
617+
"type": "activity",
618+
},
619+
Object {
620+
"chunkSize": 65536,
621+
"sizePages": 0,
622+
"totalPages": 30,
623+
"type": "bitmap",
624+
"usedPages": 0,
625+
},
626+
],
627+
"parameters": "super 1.2",
628+
"state": "active",
629+
"type": "raid1",
630+
},
631+
],
632+
}
633+
`;
634+
635+
exports[`Test parser at different RAID1 definitions Test especially RAID1 with 2 devices and a bitmap should parse correctly a RAID1 definition checking with issued check command 2 1`] = `
636+
Object {
637+
"personalities": Array [
638+
"raid1",
639+
"raid0",
640+
"linear",
641+
"multipath",
642+
"raid6",
643+
"raid5",
644+
"raid4",
645+
"raid10",
646+
],
647+
"raids": Array [
648+
Object {
649+
"access": "rw",
650+
"blocks": 3906783040,
651+
"current": 2,
652+
"devices": Array [
653+
Object {
654+
"index": 1,
655+
"name": "sda1",
656+
"status": "active",
657+
},
658+
Object {
659+
"index": 0,
660+
"name": "sdb1",
661+
"status": "active",
662+
},
663+
],
664+
"ideal": 2,
665+
"name": "md127",
666+
"options": Array [
667+
Object {
668+
"activityType": "check",
669+
"finish": 52.7,
670+
"processed": 2502342341,
671+
"progress": 73.9,
672+
"speed": 186040,
673+
"total": 3906783040,
674+
"type": "activity",
675+
},
676+
Object {
677+
"chunkSize": 65536,
678+
"sizePages": 0,
679+
"totalPages": 30,
680+
"type": "bitmap",
681+
"usedPages": 0,
682+
},
683+
],
684+
"parameters": "super 1.2",
685+
"state": "active",
686+
"type": "raid1",
687+
},
688+
],
689+
}
690+
`;
691+
578692
exports[`Test parser at different RAID1 definitions Test especially RAID1 with 2 devices and a bitmap should parse correctly a RAID1 definition recovering with 1 failed device phase 1 1`] = `
579693
Object {
580694
"personalities": Array [

0 commit comments

Comments
 (0)