(self, detailed=False)
| 120 | return False |
| 121 | |
| 122 | def checkDbmsOs(self, detailed=False): |
| 123 | if Backend.getOs(): |
| 124 | return |
| 125 | |
| 126 | infoMsg = "fingerprinting the back-end DBMS operating system " |
| 127 | infoMsg += "version and service pack" |
| 128 | logger.info(infoMsg) |
| 129 | |
| 130 | query = "(SELECT LENGTH(OS_NAME) FROM SYSIBMADM.ENV_SYS_INFO WHERE OS_NAME LIKE '%WIN%')>0" |
| 131 | result = inject.checkBooleanExpression(query) |
| 132 | |
| 133 | if not result: |
| 134 | Backend.setOs(OS.LINUX) |
| 135 | else: |
| 136 | Backend.setOs(OS.WINDOWS) |
| 137 | |
| 138 | infoMsg = "the back-end DBMS operating system is %s" % Backend.getOs() |
| 139 | |
| 140 | if result: |
| 141 | versions = { |
| 142 | "2003": ("5.2", (2, 1)), |
| 143 | "2008": ("7.0", (1,)), |
| 144 | "2000": ("5.0", (4, 3, 2, 1)), |
| 145 | "7": ("6.1", (1, 0)), |
| 146 | "XP": ("5.1", (2, 1)), |
| 147 | "NT": ("4.0", (6, 5, 4, 3, 2, 1)) |
| 148 | } |
| 149 | |
| 150 | # Get back-end DBMS underlying operating system version |
| 151 | for version, data in versions.items(): |
| 152 | query = "(SELECT LENGTH(OS_VERSION) FROM SYSIBMADM.ENV_SYS_INFO WHERE OS_VERSION = '%s')>0" % data[0] |
| 153 | result = inject.checkBooleanExpression(query) |
| 154 | |
| 155 | if result: |
| 156 | Backend.setOsVersion(version) |
| 157 | infoMsg += " %s" % Backend.getOsVersion() |
| 158 | break |
| 159 | |
| 160 | if not Backend.getOsVersion(): |
| 161 | return |
| 162 | |
| 163 | # Get back-end DBMS underlying operating system service pack |
| 164 | for sp in versions[Backend.getOsVersion()][1]: |
| 165 | query = "(SELECT LENGTH(OS_RELEASE) FROM SYSIBMADM.ENV_SYS_INFO WHERE OS_RELEASE LIKE '%Service Pack " + str(sp) + "%')>0" |
| 166 | result = inject.checkBooleanExpression(query) |
| 167 | |
| 168 | if result: |
| 169 | Backend.setOsServicePack(sp) |
| 170 | break |
| 171 | |
| 172 | if not Backend.getOsServicePack(): |
| 173 | Backend.setOsServicePack(0) |
| 174 | debugMsg = "assuming the operating system has no service pack" |
| 175 | logger.debug(debugMsg) |
| 176 | |
| 177 | if Backend.getOsVersion(): |
| 178 | infoMsg += " Service Pack %d" % Backend.getOsServicePack() |
| 179 |
nothing calls this directly
no test coverage detected