Skip to content

Conversation

@rickwu666666
Copy link
Contributor

@rickwu666666 rickwu666666 commented Jul 29, 2025

Description

We revise the iio_sensor_test.py to support sensor type in ADC. Also change the checkbox config var "IIO_SENSORS" to fit the use case of ADC since ADC didn't have fixed number of node instead depend on the sensor itself. We also handle a fallback logic for checkbox config var so it won't break the job that already exist.

Resolved issues

Documentation

Tests

Pass result for adc sensor

==============[ Running job 1 / 3. Estimated time left: 0:02:00 ]===============                     
--------------------[ To test industrial IO adc-adc128s052 ]--------------------                     
ID: com.canonical.contrib::ce-oem-iio-sensors/check-adc-adc128s052                                   
Category: com.canonical.contrib::iio-sensors                                                         
... 8< -------------------------------------------------------------------------                     
## Perform the industrial I/O adc-adc128s052 sensor test                                             
# Perform adc sensor test - name adc128s052                                                          
Found IIO device adc128s052.                                                                         
The value of /sys/bus/iio/devices/iio:device0/in_voltage0_raw node is 3756                           
The value of /sys/bus/iio/devices/iio:device0/in_voltage1_raw node is 188                            
The value of /sys/bus/iio/devices/iio:device0/in_voltage2_raw node is 0                              
The value of /sys/bus/iio/devices/iio:device0/in_voltage3_raw node is 0                              
The value of /sys/bus/iio/devices/iio:device0/in_voltage4_raw node is 0                              
The value of /sys/bus/iio/devices/iio:device0/in_voltage5_raw node is 3704                           
The value of /sys/bus/iio/devices/iio:device0/in_voltage6_raw node is 1704                           
The value of /sys/bus/iio/devices/iio:device0/in_voltage_scale node is 0.812255859                   
The adc sensor test passed                                                                           
------------------------------------------------------------------------- >8 ---                     
Outcome: job passed

Failed result if pre-defined node not found for specific type of sensor.

==============[ Running job 2 / 3. Estimated time left: 0:01:20 ]===============             [50/541]
-----------------[ To test industrial IO pressure-adc128s052 ]------------------                     
ID: com.canonical.contrib::ce-oem-iio-sensors/check-pressure-adc128s052                              
Category: com.canonical.contrib::iio-sensors                                                         
... 8< -------------------------------------------------------------------------                     
## Perform the industrial I/O pressure-adc128s052 sensor test                                        
# Perform pressure sensor test - name adc128s052                                                     
Found IIO device adc128s052.                                                                         
Traceback (most recent call last):                                                                   
  File "/tmp/nest-yh5bew04.358b0b251efabc369280cb099402618e72d758ef7cb7db381a3013946cad8db9/iio_senso
r_test.py", line 277, in <module>                                                                    
    args.test_func(args)                                                                             
  File "/tmp/nest-yh5bew04.358b0b251efabc369280cb099402618e72d758ef7cb7db381a3013946cad8db9/iio_senso
r_test.py", line 198, in validate_iio_sensor                                                         
    check_sensor(args.name, args.type, nodes)                                                        
  File "/tmp/nest-yh5bew04.358b0b251efabc369280cb099402618e72d758ef7cb7db381a3013946cad8db9/iio_senso
r_test.py", line 174, in check_sensor                                                                
    _check_node(tmp_node)                                                                            
  File "/tmp/nest-yh5bew04.358b0b251efabc369280cb099402618e72d758ef7cb7db381a3013946cad8db9/iio_senso
r_test.py", line 112, in _check_node                                                                 
    raise FileNotFoundError("{} node not exists".format(iio_node))                                   
FileNotFoundError: /sys/bus/iio/devices/iio:device0/in_pressure_input node not exists                
------------------------------------------------------------------------- >8 ---                     
Outcome: job failed

Failed result if target sensor name not found

==============[ Running job 3 / 3. Estimated time left: 0:00:40 ]===============                     
------------------[ To test industrial IO pressure-fail_name ]------------------                     
ID: com.canonical.contrib::ce-oem-iio-sensors/check-pressure-fail_name                               
Category: com.canonical.contrib::iio-sensors                                                         
... 8< -------------------------------------------------------------------------                     
## Perform the industrial I/O pressure-fail_name sensor test                                         
# Perform pressure sensor test - name fail_name                                                      
Traceback (most recent call last):                                                                   
  File "/tmp/nest-2ynkd4vh.59c736a905e55f5778c6a85be1cf0bb87728035b0f6f56f802dc2cf4f2310af9/iio_senso
r_test.py", line 277, in <module>                                                                    
    args.test_func(args)                                                                             
  File "/tmp/nest-2ynkd4vh.59c736a905e55f5778c6a85be1cf0bb87728035b0f6f56f802dc2cf4f2310af9/iio_senso
r_test.py", line 198, in validate_iio_sensor                                                         
    check_sensor(args.name, args.type, nodes)                                                        
  File "/tmp/nest-2ynkd4vh.59c736a905e55f5778c6a85be1cf0bb87728035b0f6f56f802dc2cf4f2310af9/iio_senso
r_test.py", line 170, in check_sensor                                                                
    iio_node = _check_device(name)                                                                   
  File "/tmp/nest-2ynkd4vh.59c736a905e55f5778c6a85be1cf0bb87728035b0f6f56f802dc2cf4f2310af9/iio_senso
r_test.py", line 94, in _check_device                                                                
    raise FileNotFoundError("IIO device {} not exists".format(name))                                 
FileNotFoundError: IIO device fail_name not exists                                                   
------------------------------------------------------------------------- >8 ---
Outcome: job failed
Finalizing session that hasn't been submitted anywhere: checkbox-run-2025-07-29T08.25.46
==================================[ Results ]===================================
 ☑ : Generates a IIO sensors mapping for IIO sensor test
 ☑ : To test industrial IO adc-adc128s052
 ☒ : To test industrial IO pressure-adc128s052
 ☒ : To test industrial IO pressure-fail_name

@rickwu666666 rickwu666666 added the ce-oem The PR only contains to the ce-oem provider under the contrib area label Jul 29, 2025
@rickwu666666 rickwu666666 marked this pull request as draft July 29, 2025 09:01
@rickwu666666 rickwu666666 marked this pull request as ready for review July 30, 2025 01:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ce-oem The PR only contains to the ce-oem provider under the contrib area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant