package Ġcom . bk ahl ert . k ustom ize Ċ Ċ import Ġcom . bk ahl ert . kom mon s . io . path . age Ċ import Ġcom . bk ahl ert . kom mon s . io . path . extension OrNull Ċ import Ġcom . bk ahl ert . kom mon s . io . path . list Directory Entries Re cursively Ċ import Ġcom . bk ahl ert . kom mon s . io . path . textContent Ċ import Ġcom . bk ahl ert . kom mon s . test . S moke Ċ import Ġcom . bk ahl ert . kom mon s . test . System Properties Ċ import Ġcom . bk ahl ert . kom mon s . test . System Property Ċ import Ġcom . bk ahl ert . kom mon s . text . matches Cur ly Pattern Ċ import Ġcom . bk ahl ert . k ustom ize . cli . Custom ize Command Ċ import Ġcom . bk ahl ert . k ustom ize . lib guest fs . mounted Ċ import Ġcom . bk ahl ert . k ustom ize . os . Linux Root Ċ import Ġcom . bk ahl ert . k ustom ize . os . Operating System Image Ċ import Ġcom . bk ahl ert . k ustom ize . os . Operating System Image . Companion . based Ċ import Ġcom . bk ahl ert . k ustom ize . os . Operating Systems . R aspberry Pi Lite Ċ import Ġcom . bk ahl ert . k ustom ize . test . E 2 E Ċ import Ġorg . junit . jupiter . api . Test Ċ import Ġorg . junit . jupiter . api . fail Ċ import Ġstri kt . api . expect That Ċ import Ġstri kt . assertions . isNotEmpty Ċ import Ġkotlin . io . path . div Ċ import Ġkotlin . io . path . isDirectory Ċ import Ġkotlin . io . path . list Directory Entries Ċ Ċ class ĠIntegration Test Ġ{ ĊĊĠĠĠ Ġ@ E 2 E Ġ@ S moke Ġ@ Test ĊĠĠĠ Ġfun Ġ` should Ġcustomize Ġwith Ġsample Ġconfiguration `() Ġ{ ĊĊĠĠĠĠĠĠĠ ĠCustom ize Command (). parse ( array Of ("-- config - file ", Ġ" sample . conf ", Ġ"-- cache - dir ", Ġ". cache ")) ĊĊĠĠĠĠĠĠĠ Ġval Ġos Image Ġ= Ġfind Image (" sample ") ĊĊĠĠĠĠĠĠĠ Ġexpect That ( os Image ). mounted Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġpath ( Linux Root . etc . hostname ) Ġ{ Ġtext Content . matches Cur ly Pattern (" sample -- {} ") Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ System Properties ( ĊĠĠĠĠĠĠĠ ĠSystem Property (" SAMPLE _ FULL _ USERNAME ", Ġ" john . doe "), ĊĠĠĠĠĠĠĠ ĠSystem Property (" SAMPLE _ FULL _ PASSWORD ", Ġ" Password 1 2 3 4 "), ĊĠĠĠĠĠĠĠ ĠSystem Property (" SAMPLE _ FULL _ W PA _ SUP PL IC ANT ", Ġ" entry 1 \ n entry 2 "), ĊĠĠĠ Ġ) ĊĠĠĠ Ġ@ E 2 E Ġ@ Test ĊĠĠĠ Ġfun Ġ` should Ġcustomize Ġwith Ġfull Ġsample Ġconfiguration `() Ġ{ ĊĠĠĠĠĠĠĠ ĠCustom ize Command (). parse ( array Of ("-- config - file ", Ġ" sample - full . conf ", Ġ"-- cache - dir ", Ġ". cache ")) ĊĠĠĠĠĠĠĠ Ġval Ġos Image Ġ= Ġfind Image (" sample - full ") ĊĠĠĠĠĠĠĠ Ġexpect That ( os Image ). mounted Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġpath ( Linux Root . etc . hostname ) Ġ{ Ġtext Content . matches Cur ly Pattern (" sample - full -- {} ") Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġpath ( Linux Root . home Ġ/ Ġ" john . doe ") Ġ{ Ġget Ġ{ Ġlist Directory Entries Re cursively () Ġ}. isNotEmpty () Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġfind Image ( projectName : ĠString ): ĠOperating System Image Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġproject Directory Ġ= ĠK ustom ize . work Ġ/ Ġ". cache " Ġ/ ĠprojectName ĊĠĠĠĠĠĠĠ Ġval Ġwork Directory Ġ= Ġproject Directory . list Directory Entries (). filter Ġ{ Ġit . isDirectory () Ġ}. min By OrNull Ġ{ Ġit . age Ġ} Ġ?: Ġfail (" Work Ġdirectory Ġnot Ġfound ") ĊĠĠĠĠĠĠĠ Ġval Ġimage Ġ= Ġwork Directory . list Directory Entries (). single OrNull Ġ{ Ġit . extension OrNull . equals (" img ", Ġignore Case Ġ= Ġtrue ) Ġ} Ġ?: Ġfail (" Image Ġnot Ġfound ") ĊĠĠĠĠĠĠĠ Ġval Ġos Image Ġ= ĠRaspberry Pi Lite Ġbased Ġimage ĊĠĠĠĠĠĠĠ Ġreturn Ġos Image ĊĠĠĠ Ġ} Ċ } Ċ