testsuite: adapt 'uname release' test for Ubuntu

This commit is contained in:
Xavier Delaruelle
2017-05-10 07:45:15 +02:00
parent fc5f7a15f4
commit 085fdb43cc

View File

@@ -87,9 +87,18 @@ if { ![file executable $domainname] } {
if { [info exists uname] } {
set u_sysname [exec $uname -s]
set u_nodename [exec $uname -n]
set u_release [exec $uname -r]
set u_version [exec $uname -v]
set u_machine [exec $uname -m]
# on ubuntu get the CODENAME of the Distribution
if {[file isfile /etc/lsb-release]} {
set fd [open "/etc/lsb-release" "r"]
set a [read $fd]
regexp -nocase {DISTRIB_CODENAME=(\S+)(.*)}\
$a matched u_release end
} else {
set u_release [exec $uname -r]
}
}
@@ -129,3 +138,9 @@ if { [info exist uname] } {
if { [info exist domainname] } {
unset domainname
}
if { [info exist fd] } {
unset fd
}
if { [info exist a] } {
unset a
}