QBox Module2 Milestone 4

./check_QBox_server_OS.sh: line 39: test: 18.04: integer expression expected
Error: Ubuntu version is 18.04 which is insufficient for QBox

I am getting above error in terminal in line 39 which has the below condition:
if test $ubuntuVersion -ge $requiredUbuntuVersion

Here $ubuntuVersion is 18.04 and $requiredUbuntuVersion is already set to 18
Hence this comparison gives the error.
Need some help here.

Hey please check the TODO’s properly , an Integer Value is Expected.
Echo the Integer Value

1 Like

But that would echo the wrong version i.e
Ubuntu version is 18 which is sufficient for QBox
instead of
Ubuntu version is 18.04 which is sufficient for QBox
will changing to the integer value pass the assessment ?

Yes, the assessment is requesting for an integer value.

1 Like

I am getting below two lines as output for module 2 milestone 4

OS is Ubuntu which is required for QBox
Ubuntu version is 18 which is sufficient for QBox

But in assessment, the test case fails for this.

The script should take /etc/os-release as input and parse that input to fetch the linux type and version. Please see if you are fetching this information from /etc/os-release file.

Can using hostnamectl for finding version could trigger wrong answer?

Yes, the script specifies that you should used /etc/os-release for assessment. In a general sense, using hostnamectl is ok, but not in the current context.

1 Like