@@ -956,6 +956,7 @@ public class Testbed: GLib.Object {
956956 string cur_data = data;
957957 string ? devnode_path = null ;
958958 uint8 [] devnode_contents = {};
959+ string [] devnode_links = {};
959960
960961 cur_data = this . record_parse_line(cur_data, out type, out key, out devpath);
961962 if (cur_data == null || type != ' P' )
@@ -1018,7 +1019,10 @@ public class Testbed: GLib.Object {
10181019 break ;
10191020
10201021 case ' S' :
1021- /* TODO: ignored for now */
1022+ /* collect symlinks */
1023+ if (val == null )
1024+ throw new UMockdev .Error .PARSE (" invalid S: line in description of device %s " , devpath);
1025+ devnode_links + = Path . build_filename(this . root_dir, " dev" , val);
10221026 break ;
10231027
10241028 default:
@@ -1043,9 +1047,16 @@ public class Testbed: GLib.Object {
10431047 this . set_attribute_link (syspath, linkattrs[i], linkattrs[i+ 1 ]);
10441048
10451049 /* create fake device node */
1046- if (devnode_path != null )
1050+ if (devnode_path != null ) {
10471051 this . create_node_for_device(subsystem, devnode_path, devnode_contents, majmin);
10481052
1053+ /* create symlinks */
1054+ for (int i = 0 ; i < devnode_links. length; i++ ) {
1055+ assert (DirUtils . create_with_parents(Path . get_dirname(devnode_links[i]), 0755 ) == 0 );
1056+ assert (FileUtils . symlink(devnode_path, devnode_links[i]) == 0 );
1057+ }
1058+ }
1059+
10491060 /* skip over multiple blank lines */
10501061 while (cur_data[0 ] != ' \0 ' && cur_data[0 ] == ' \n ' )
10511062 cur_data = cur_data. next_char();
0 commit comments