Skip to content

Commit

Permalink
minipack: Add fscd phase2 unitest(fan dead testing) (facebook#99)
Browse files Browse the repository at this point in the history
Summary:
1. Use dummy node path to make a "fan dead" situation.
Pull Request resolved: facebookexternal/openbmc.accton#99

Test Plan:
1. Let input speed of fan1 as 0 to raise fan's pwm.

2. Let input speed of fan1 and fan2 as 0 to raise fan's pwm.

Test result: Test on minipack:

[FSCD Testing] Setup temp environment to set pwm as 25%
[FSCD Testing] Setting (inlet=20C, switch1=20C ,switch2=20C)
[FSCD Testing] PWM test,expected=25% [PASSED]
[FSCD Testing] One fan dead testing...
[FSCD Testing] One fan dead testing,expected=38% [PASSED]
[FSCD Testing] Two fans dead testing...
[FSCD Testing] Two fans dead testing,expected=63% [PASSED]
FSCD Testing [PASSED]

Reviewed By: vineelasmile

fbshipit-source-id: 44b8e5898
  • Loading branch information
mikechoifb authored and facebook-github-bot committed Oct 23, 2018
1 parent d49ec2a commit 31b8a48
Show file tree
Hide file tree
Showing 20 changed files with 676 additions and 28 deletions.
1 change: 1 addition & 0 deletions tests/minipack/unittests/fscd/test_data/fan10_input
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3300
1 change: 1 addition & 0 deletions tests/minipack/unittests/fscd/test_data/fan11_input
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3300
1 change: 1 addition & 0 deletions tests/minipack/unittests/fscd/test_data/fan12_input
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3300
1 change: 1 addition & 0 deletions tests/minipack/unittests/fscd/test_data/fan13_input
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3300
1 change: 1 addition & 0 deletions tests/minipack/unittests/fscd/test_data/fan14_input
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3300
1 change: 1 addition & 0 deletions tests/minipack/unittests/fscd/test_data/fan15_input
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3300
1 change: 1 addition & 0 deletions tests/minipack/unittests/fscd/test_data/fan16_input
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3300
1 change: 1 addition & 0 deletions tests/minipack/unittests/fscd/test_data/fan1_input
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3300
1 change: 1 addition & 0 deletions tests/minipack/unittests/fscd/test_data/fan2_input
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3300
1 change: 1 addition & 0 deletions tests/minipack/unittests/fscd/test_data/fan3_input
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3300
1 change: 1 addition & 0 deletions tests/minipack/unittests/fscd/test_data/fan4_input
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3300
1 change: 1 addition & 0 deletions tests/minipack/unittests/fscd/test_data/fan5_input
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3300
1 change: 1 addition & 0 deletions tests/minipack/unittests/fscd/test_data/fan6_input
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3300
1 change: 1 addition & 0 deletions tests/minipack/unittests/fscd/test_data/fan7_input
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3300
1 change: 1 addition & 0 deletions tests/minipack/unittests/fscd/test_data/fan8_input
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3300
1 change: 1 addition & 0 deletions tests/minipack/unittests/fscd/test_data/fan9_input
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3300
266 changes: 266 additions & 0 deletions tests/minipack/unittests/fscd/test_data/fsc-32-config-test2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,266 @@
{
"pwm_transition_value": 16,
"pwm_boost_value": 20,
"sample_interval_ms": 3000,
"boost": {
"fan_fail": true,
"sensor_fail": false,
"progressive": true
},
"fan_dead_boost": {
"data": [
[1,2],
[2,2]
]
},
"watchdog": true ,
"min_rpm": 800,
"profiles": {
"SCM_INLET_REMOTE_TEMP": {
"read_source" : {
"util" : "/usr/local/bin/sensor-util"
},
"read_limit": {
"valid": {
"limit": 60,
"threshold": 20,
"action": "host_shutdown"
},
"invalid": {
"limit": -60,
"threshold": 10,
"action": "host_shutdown"
}
},
"type": "linear",
"positive_hysteresis": 0,
"negative_hysteresis": 1,
"data": [
[5, 8],
[20, 8],
[23, 9],
[26, 10],
[29, 11],
[31, 12],
[33, 13],
[35, 14],
[37, 15],
[39, 16]
]
},
"TH3_DIE_TEMP1": {
"read_source" : {
"util" : "/usr/local/bin/sensor-util"
},
"read_limit": {
"valid": {
"limit": 110,
"threshold": 20,
"action": "host_shutdown"
},
"invalid":{
"limit": -60,
"threshold": 10,
"action": "host_shutdown"
}
},
"type": "linear",
"positive_hysteresis": 0,
"negative_hysteresis": 2,
"data": [
[5, 8],
[100, 13],
[105, 16]
]
},
"TH3_DIE_TEMP2": {
"read_source" : {
"util" : "/usr/local/bin/sensor-util"
},
"read_limit": {
"valid": {
"limit": 110,
"threshold": 20,
"action": "host_shutdown"
},
"invalid":{
"limit": -60,
"threshold": 10,
"action": "host_shutdown"
}
},
"type": "linear",
"positive_hysteresis": 0,
"negative_hysteresis": 2,
"data": [
[5, 8],
[100, 13],
[105, 16]
]
}
},
"fans": {
"1": {
"label" : "Fan 1 Front",
"read_source" : {
"sysfs": "/tmp/tests/minipack/unittests/fscd/test_data/fan1_input"
},
"write_source" : {
"sysfs": "/sys/class/i2c-adapter/i2c-64/64-0033/fantray1_pwm"
}
},
"2": {
"label" : "Fan 1 Rear",
"read_source" : {
"sysfs": "/tmp/tests/minipack/unittests/fscd/test_data/fan2_input"
}
},
"3": {
"label" : "Fan 2 Front",
"read_source" : {
"sysfs": "/tmp/tests/minipack/unittests/fscd/test_data/fan3_input"
},
"write_source" : {
"sysfs": "/sys/class/i2c-adapter/i2c-72/72-0033/fantray1_pwm"
}
},
"4": {
"label" : "Fan 2 Rear",
"read_source" : {
"sysfs": "/tmp/tests/minipack/unittests/fscd/test_data/fan4_input"
}
},
"5": {
"label" : "Fan 3 Front",
"read_source" : {
"sysfs": "/tmp/tests/minipack/unittests/fscd/test_data/fan5_input"
},
"write_source" : {
"sysfs": "/sys/class/i2c-adapter/i2c-64/64-0033/fantray2_pwm"
}
},
"6": {
"label" : "Fan 3 Rear",
"read_source" : {
"sysfs": "/tmp/tests/minipack/unittests/fscd/test_data/fan6_input"
}
},
"7": {
"label" : "Fan 4 Front",
"read_source" : {
"sysfs": "/tmp/tests/minipack/unittests/fscd/test_data/fan7_input"
},
"write_source" : {
"sysfs": "/sys/class/i2c-adapter/i2c-72/72-0033/fantray2_pwm"
}
},
"8": {
"label" : "Fan 4 Rear",
"read_source" : {
"sysfs": "/tmp/tests/minipack/unittests/fscd/test_data/fan8_input"
}
},
"9": {
"label" : "Fan 5 Front",
"read_source" : {
"sysfs": "/tmp/tests/minipack/unittests/fscd/test_data/fan9_input"
},
"write_source" : {
"sysfs": "/sys/class/i2c-adapter/i2c-64/64-0033/fantray3_pwm"
}
},
"10": {
"label" : "Fan 5 Rear",
"read_source" : {
"sysfs": "/tmp/tests/minipack/unittests/fscd/test_data/fan10_input"
}
},
"11": {
"label" : "Fan 6 Front",
"read_source" : {
"sysfs": "/tmp/tests/minipack/unittests/fscd/test_data/fan11_input"
},
"write_source" : {
"sysfs": "/sys/class/i2c-adapter/i2c-72/72-0033/fantray3_pwm"
}
},
"12": {
"label" : "Fan 6 Rear",
"read_source" : {
"sysfs": "/tmp/tests/minipack/unittests/fscd/test_data/fan12_input"
}
},
"13": {
"label" : "Fan 7 Front",
"read_source" : {
"sysfs": "/tmp/tests/minipack/unittests/fscd/test_data/fan13_input"
},
"write_source" : {
"sysfs": "/sys/class/i2c-adapter/i2c-64/64-0033/fantray4_pwm"
}
},
"14": {
"label" : "Fan 7 Rear",
"read_source" : {
"sysfs": "/tmp/tests/minipack/unittests/fscd/test_data/fan14_input"
}
},
"15": {
"label" : "Fan 8 Front",
"read_source" : {
"sysfs": "/tmp/tests/minipack/unittests/fscd/test_data/fan15_input"
},
"write_source" : {
"sysfs": "/sys/class/i2c-adapter/i2c-72/72-0033/fantray4_pwm"
}
},
"16": {
"label" : "Fan 8 Rear",
"read_source" : {
"sysfs": "/tmp/tests/minipack/unittests/fscd/test_data/fan16_input"
}
}
},
"zones": {
"zone_1": {
"pwm_output": [1, 3, 5, 7, 9, 11, 13, 15],
"expr_file": "zone1.fsc"
}
},
"notes": {
"FAN_PWM[4:0] table": {
"0_0000" : "0/32 or 0% duty cycle",
"0_0001" : "1/32 or 3.125% duty cycle",
"0_0010" : "2/32 or 6.25% duty cycle",
"0_0011" : "3/32 or 9.375% duty cycle",
"0_0100" : "4/32 or 12.5% duty cycle ",
"0_0101" : "5/32 or 16.625% duty cycle",
"0_0110" : "6/32 or 18.725% duty cycle",
"0_0111" : "7/32 or 21.875% duty cycle ",
"0_1000" : "8/32 or 25% duty cycle ",
"0_1001" : "9/32 or 28.125% duty cycle ",
"0_1010" : "10/32 or 31.25% duty cycle ",
"0_1011" : "11/32 or 34.375% duty cycle ",
"0_1100" : "12/32 or 37.5% duty cycle ",
"0_1101" : "13/32 or 41.625% duty cycle ",
"0_1110" : "14/32 or 43.725% duty cycle ",
"0_1111" : "15/32 or 46.875% duty cycle ",
"1_0000" : "16/32 or 50% duty cycle ",
"1_0001" : "17/32 or 53.125% duty cycle ",
"1_0010" : "18/32 or 56.25% duty cycle ",
"1_0011" : "19/32 or 59.375% duty cycle ",
"1_0100" : "20/32 or 62.5% duty cycle ",
"1_0101" : "21/32 or 66.625% duty cycle ",
"1_0110" : "22/32 or 68.725% duty cycle ",
"1_0111" : "23/32 or 71.875% duty cycle ",
"1_1000" : "24/32 or 75% duty cycle ",
"1_1001" : "25/32 or 78.125% duty cycle ",
"1_1010" : "26/32 or 81.25% duty cycle ",
"1_1011" : "27/32 or 84.375% duty cycle ",
"1_1100" : "28/32 or 87.5% duty cycle ",
"1_1101" : "29/32 or 91.625% duty cycle ",
"1_1110" : "30/32 or 93.725% duty cycle ",
"1_1111" : "32/32 or 100% duty cycle "
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"watchdog": true ,
"min_rpm": 800,
"profiles": {
"linear_inlet": {
"SCM_INLET_REMOTE_TEMP": {
"read_source" : {
"util" : "/usr/local/bin/sensor-util"
},
Expand Down Expand Up @@ -48,7 +48,7 @@
[39, 32]
]
},
"linear_switch1": {
"TH3_DIE_TEMP1": {
"read_source" : {
"util" : "/usr/local/bin/sensor-util"
},
Expand All @@ -73,7 +73,7 @@
[105, 32]
]
},
"linear_switch2": {
"TH3_DIE_TEMP2": {
"read_source" : {
"util" : "/usr/local/bin/sensor-util"
},
Expand Down
Loading

0 comments on commit 31b8a48

Please sign in to comment.