Module 2 - /etc/os-release returncode>0!

I got correct output when I executed the script , but in the assessment result 2 of the 4 failed.
I found this in the log files
…check_QBox_server_OS.sh /etc/os-release returncode > 0! Check your code
What is the possible error?

The error means that the code has not been successfully executed during the unit testing. If the code had compiled successfully, you will get a comparison between your output and the actual output.

Make sure your command is working irrespective of the folder

I am also getting same error.How did you resolved it?

Try to execute different command to get os information. The command you may be executing may not be installed on the testing server. So try using different command.

BIG NOTE

To pass your assessment, your command should work irrespective of the current working directory.

Think of relative and absolute directory!

Yes , this is the thing.It might work in your workspace but then the same thing will not pass the assessment.Try using alternatives to the commands that you have used.

1 Like

Firstly I used lsb_release -a , then I used hostnamectl , BUT PROBLEM STILL THE SAME !
@prajjwalmishra07