Hello,
I am having a bit of hard time to get my head around this one. I really hope someone is out there to help me out!
Background of my code:
I am doing some automation where I am verifying multiple files in multiple sub folders and if they are all identical, I would echo a line with my test case title and stating it passed. If anything is not same I echo fail to a file.
Folder structure would look like this:
Folder
Folder1
Test1.mp3
Folder2
Folder2.1
Test2.mp3
Test3.mp3
I am somewhat new to Apple, so please pardon me for my ignorance.
Goal:
I have a list of expected file that I am comparing with (which also has same folder structure and same files). Once the media are transferred to the external SD card, I want to verify if all my songs and playlist are transferred properly.
Below is my code as of now and its not really working out well.
Export SD=Test
Export path="~/Desktop/Result.txt�
export Actual="/Volumes/$SD/BlackBerry/music/Media Sync/"
export Expected="~/Desktop/Automation/Test_Cases/Supported_Unsupported/Expected/Media Sync"
# I do this such that no other unwanted files are there. Apple seems to create those .DS files and BlackBerry.
find "$Expected" . -name "*.DS*" -type f -exec rm -rf {} \;
find "$Actual" . -name "*.DS*" -type f -exec rm -rf {} \;
find "$Actual" . -name "*.dat" -type f -exec rm -rf {} \;
find "$Expected" . -name "*.dat" -type f -exec rm -rf {} \;
#echo "$Actual"
#echo "$Expected"
#diff "$Actual" "$Expected"
# I do not know if it will actually go to subfolders and compare or just the root folder.
diff "$Actual" "$Expected" &> /dev/null
if [ $? -eq 0 ]
then
echo Test Case for synchronizing supported & unsupported playlist - Passed >> "$path"
echo - passed
else
echo Test Case for synchronizing supported & unsupported playlist - Failed >> "$path"
echo - failed
fi
open "$path"