Test Smart Brain implementation
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

testrun.tex 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. \documentclass[a4paper]{article}
  2. %\documentclass[a4paper,landscape]{article}
  3. \renewcommand{\familydefault}{\sfdefault}
  4. \usepackage[table]{xcolor}
  5. \definecolor{orange}{rgb}{1, 0.7, 0}
  6. \definecolor{lightgrey}{rgb}{0.925, 0.925, 0.925}
  7. \setlength{\topmargin}{-3cm}
  8. \setlength{\oddsidemargin}{-0.5cm}
  9. \setlength{\evensidemargin}{0cm}
  10. \setlength{\textwidth}{17.5cm}
  11. \setlength{\textheight}{24.5cm}
  12. %\setlength{\textwidth}{25cm}
  13. %\setlength{\textheight}{15cm}
  14. \setlength{\headheight}{84pt}
  15. \usepackage{fancyvrb}
  16. \usepackage{fvextra}
  17. %\usepackage{framed,color}
  18. %\newenvironment{modulelog}{\snugshade\Verbatim}{\endVerbatim\endsnugshade}
  19. \usepackage{adjustbox}
  20. \newenvironment{modulelog}%
  21. {\par\noindent\adjustbox{margin=0ex,bgcolor=shadecolor,margin=0ex}\bgroup\varwidth\linewidth\Verbatim}%
  22. {\endVerbatim\endvarwidth\egroup}
  23. %\usepackage{xcolor}
  24. \renewcommand{\baselinestretch}{1,2}
  25. \setlength{\parindent}{0pt}
  26. \setlength{\parskip}{9pt plus3pt minus3pt}
  27. \usepackage{listings}
  28. \usepackage{color}
  29. \definecolor{bg-partially-covered}{rgb}{1,1,0.6} % light-yellow
  30. \definecolor{bg-uncovered}{rgb}{1,0.8,0.8} % light-red
  31. \definecolor{bg-covered}{rgb}{0.95,1,0.95} % very light-green
  32. \definecolor{bg-clean}{rgb}{1,1,1} % white
  33. \definecolor{mygreen}{rgb}{0,0.6,0}
  34. \definecolor{mygray}{rgb}{0.5,0.5,0.5}
  35. \definecolor{mymauve}{rgb}{0.58,0,0.82}
  36. \lstset{ %
  37. backgroundcolor=\color{white}, % choose the background color; you must add \usepackage{color} or \usepackage{xcolor}; should come as last argument
  38. basicstyle=\footnotesize, % the size of the fonts that are used for the code
  39. breakatwhitespace=false, % sets if automatic breaks should only happen at whitespace
  40. breaklines=true, % sets automatic line breaking
  41. captionpos=b, % sets the caption-position to bottom
  42. commentstyle=\color{mygreen}, % comment style
  43. deletekeywords={...}, % if you want to delete keywords from the given language
  44. escapeinside={\%*}{*)}, % if you want to add LaTeX within your code
  45. extendedchars=true, % lets you use non-ASCII characters; for 8-bits encodings only, does not work with UTF-8
  46. frame=none, % adds a frame around the code
  47. keepspaces=true, % keeps spaces in text, useful for keeping indentation of code (possibly needs columns=flexible)
  48. keywordstyle=\color{blue}, % keyword style
  49. language=Octave, % the language of the code
  50. morekeywords={*,...}, % if you want to add more keywords to the set
  51. numbers=left, % where to put the line-numbers; possible values are (none, left, right)
  52. numbersep=5pt, % how far the line-numbers are from the code
  53. numberstyle=\tiny\color{mygray}, % the style that is used for the line-numbers
  54. rulecolor=\color{black}, % if not set, the frame-color may be changed on line-breaks within not-black text (e.g. comments (green here))
  55. showlines=true,
  56. showspaces=false, % show spaces everywhere adding particular underscores; it overrides 'showstringspaces'
  57. showstringspaces=false, % underline spaces within strings only
  58. showtabs=false, % show tabs within strings adding particular underscores
  59. stepnumber=1, % the step between two line-numbers. If it's 1, each line will be numbered
  60. stringstyle=\color{mymauve}, % string literal style
  61. tabsize=2, % sets default tabsize to 2 spaces
  62. }
  63. \usepackage{hyperref}
  64. \usepackage{longtable}[=v4.13]
  65. \usepackage{tabu}
  66. \usepackage{multicol}
  67. \usepackage{booktabs}
  68. \usepackage{graphicx}
  69. \usepackage{lastpage} % for the number of the last page in the document
  70. \usepackage{fancyhdr}
  71. \fancyhf{}
  72. \renewcommand{\headrulewidth}{0pt}
  73. \renewcommand{\footrulewidth}{0pt}
  74. \lhead{\textcolor{gray}{}}
  75. \chead{\textcolor{gray}{ Unittest for {\tt smart\_brain }}}
  76. \rhead{\textcolor{gray}{}}
  77. \lfoot{\textcolor{gray}{}}
  78. \cfoot{\textcolor{gray}{}}
  79. \rfoot{\textcolor{gray}{\thepage\,/ \pageref{LastPage}}}
  80. \begin{document}
  81. \begin{titlepage}
  82. \date{\today}
  83. \title{
  84. Unittest for {\tt smart\_brain }
  85. }
  86. \date{\today}
  87. \maketitle
  88. \thispagestyle{empty}
  89. \newpage
  90. \end{titlepage}
  91. \setcounter{page}{1}
  92. \pagestyle{fancy}
  93. \tableofcontents
  94. \newpage
  95. \section{Test System Information}
  96. \begin{tabu} to \linewidth {lX}
  97. \toprule
  98. {\bf System Information} & \\
  99. \midrule
  100. Architecture & 64bit \\
  101. Machine & x86\_64 \\
  102. Hostname & ahorn \\
  103. Distribution & Linux Mint 21.1 (vera) \\
  104. System & Linux \\
  105. Kernel & 5.15.0-58-generic (\#64-Ubuntu SMP Thu Jan 5 11:43:13 UTC 2023) \\
  106. Username & dirk \\
  107. Path & /\allowbreak home/\allowbreak dirk/\allowbreak my\_repositories/\allowbreak smarthome/\allowbreak smart\_brain\_test/\allowbreak all.py \\
  108. \bottomrule
  109. \end{tabu}
  110. \section{Summary}
  111. \begin{tabu} to \linewidth {lX}
  112. \toprule
  113. Number of tests & {\bf 5}\\
  114. Number of successfull tests & {\bf 5}\\
  115. Number of possibly failed tests & \textcolor{black}{\bf 0}\\
  116. Number of failed tests & \textcolor{black}{\bf 0}\\
  117. \midrule
  118. Executionlevel & unknown\\
  119. Time consumption & 4.510s\\
  120. \bottomrule
  121. \end{tabu}
  122. \section{\textcolor{green}{Testcases (Success)}}
  123. \subsection{ Away mode test: zigbee/\allowbreak gfw/\allowbreak dirk/\allowbreak heating\_valve }
  124. \paragraph{Testsummary}\mbox{}\\
  125. This test was passed with the state: {\bf \textcolor{green}{Success}}.
  126. \begin{longtabu} to \linewidth {lX}
  127. \toprule
  128. Caller: & /\allowbreak home/\allowbreak dirk/\allowbreak my\_repositories/\allowbreak smarthome/\allowbreak smart\_brain\_test/\allowbreak tests/\allowbreak heating.py (84)\\
  129. Start-Time: & 2023-02-09 07:53:02,566\\
  130. Finished-Time: & 2023-02-09 07:53:03,468\\
  131. Time-Consumption & 0.902s\\
  132. \midrule
  133. \multicolumn{2}{l}{\bf{Testresults:}}\\
  134. \midrule
  135. \bf{\,Info } & Setting preconditions (Default setpoint)\\
  136. \bf{\,\textcolor{green}{Success} } & Away mode is correct (Content False and Type is $<$class 'bool'$>$).\\
  137. \bf{\,Info } & Activating away mode\\
  138. \bf{\,\textcolor{green}{Success} } & Away mode is correct (Content True and Type is $<$class 'bool'$>$).\\
  139. \bf{\,\textcolor{green}{Success} } & Temperature setpoint is correct (Content 20 and Type is $<$class 'int'$>$).\\
  140. \bf{\,Info } & Deactivating away mode\\
  141. \bf{\,\textcolor{green}{Success} } & Away mode is correct (Content False and Type is $<$class 'bool'$>$).\\
  142. \bf{\,\textcolor{green}{Success} } & Temperature setpoint is correct (Content 25 and Type is $<$class 'int'$>$).\\
  143. \bottomrule
  144. \end{longtabu}
  145. \subsection{ Boost mode test: zigbee/\allowbreak gfw/\allowbreak dirk/\allowbreak heating\_valve }
  146. \paragraph{Testsummary}\mbox{}\\
  147. This test was passed with the state: {\bf \textcolor{green}{Success}}.
  148. \begin{longtabu} to \linewidth {lX}
  149. \toprule
  150. Caller: & /\allowbreak home/\allowbreak dirk/\allowbreak my\_repositories/\allowbreak smarthome/\allowbreak smart\_brain\_test/\allowbreak tests/\allowbreak heating.py (107)\\
  151. Start-Time: & 2023-02-09 07:53:03,468\\
  152. Finished-Time: & 2023-02-09 07:53:04,370\\
  153. Time-Consumption & 0.902s\\
  154. \midrule
  155. \multicolumn{2}{l}{\bf{Testresults:}}\\
  156. \midrule
  157. \bf{\,Info } & Setting preconditions (Default setpoint)\\
  158. \bf{\,\textcolor{green}{Success} } & Boost timer is correct (Content 0 and Type is $<$class 'int'$>$).\\
  159. \bf{\,Info } & Activating boost mode\\
  160. \bf{\,\textcolor{green}{Success} } & Boost timer is greater expectation (Content 900 and Type is $<$class 'int'$>$).\\
  161. \bf{\,Info } & Setting postconditions (Default setpoint)\\
  162. \bf{\,\textcolor{green}{Success} } & Boost timer is correct (Content 0 and Type is $<$class 'int'$>$).\\
  163. \bottomrule
  164. \end{longtabu}
  165. \subsection{ Default temperature test for device and virtual device: zigbee/\allowbreak gfw/\allowbreak dirk/\allowbreak heating\_valve }
  166. \paragraph{Testsummary}\mbox{}\\
  167. This test was passed with the state: {\bf \textcolor{green}{Success}}.
  168. \begin{longtabu} to \linewidth {lX}
  169. \toprule
  170. Caller: & /\allowbreak home/\allowbreak dirk/\allowbreak my\_repositories/\allowbreak smarthome/\allowbreak smart\_brain\_test/\allowbreak tests/\allowbreak heating.py (41)\\
  171. Start-Time: & 2023-02-09 07:53:04,370\\
  172. Finished-Time: & 2023-02-09 07:53:04,972\\
  173. Time-Consumption & 0.601s\\
  174. \midrule
  175. \multicolumn{2}{l}{\bf{Testresults:}}\\
  176. \midrule
  177. \bf{\,Info } & Setting preconditions (Valve setpoint to 20.0)\\
  178. \bf{\,\textcolor{green}{Success} } & Valve temperature setpoint (is not default temperature) is correct (Content True and Type is $<$class 'bool'$>$).\\
  179. \bf{\,Info } & Triggering set to default temperature (25.0)\\
  180. \bf{\,\textcolor{green}{Success} } & Valve temperature setpoint is correct (Content 25 and Type is $<$class 'int'$>$).\\
  181. \bottomrule
  182. \end{longtabu}
  183. \subsection{ Summer mode test: zigbee/\allowbreak gfw/\allowbreak dirk/\allowbreak heating\_valve }
  184. \paragraph{Testsummary}\mbox{}\\
  185. This test was passed with the state: {\bf \textcolor{green}{Success}}.
  186. \begin{longtabu} to \linewidth {lX}
  187. \toprule
  188. Caller: & /\allowbreak home/\allowbreak dirk/\allowbreak my\_repositories/\allowbreak smarthome/\allowbreak smart\_brain\_test/\allowbreak tests/\allowbreak heating.py (61)\\
  189. Start-Time: & 2023-02-09 07:53:04,972\\
  190. Finished-Time: & 2023-02-09 07:53:05,874\\
  191. Time-Consumption & 0.902s\\
  192. \midrule
  193. \multicolumn{2}{l}{\bf{Testresults:}}\\
  194. \midrule
  195. \bf{\,Info } & Setting preconditions (Default setpoint)\\
  196. \bf{\,\textcolor{green}{Success} } & Summer mode is correct (Content False and Type is $<$class 'bool'$>$).\\
  197. \bf{\,Info } & Activating summer mode\\
  198. \bf{\,\textcolor{green}{Success} } & Summer mode is correct (Content True and Type is $<$class 'bool'$>$).\\
  199. \bf{\,\textcolor{green}{Success} } & Temperature setpoint is correct (Content 5 and Type is $<$class 'int'$>$).\\
  200. \bf{\,Info } & Deactivating summer mode\\
  201. \bf{\,\textcolor{green}{Success} } & Summer mode is correct (Content False and Type is $<$class 'bool'$>$).\\
  202. \bf{\,\textcolor{green}{Success} } & Temperature setpoint is correct (Content 25 and Type is $<$class 'int'$>$).\\
  203. \bottomrule
  204. \end{longtabu}
  205. \subsection{ User temperature setpoint test for device and virtual device: zigbee/\allowbreak gfw/\allowbreak dirk/\allowbreak heating\_valve }
  206. \paragraph{Testsummary}\mbox{}\\
  207. This test was passed with the state: {\bf \textcolor{green}{Success}}.
  208. \begin{longtabu} to \linewidth {lX}
  209. \toprule
  210. Caller: & /\allowbreak home/\allowbreak dirk/\allowbreak my\_repositories/\allowbreak smarthome/\allowbreak smart\_brain\_test/\allowbreak tests/\allowbreak heating.py (17)\\
  211. Start-Time: & 2023-02-09 07:53:05,874\\
  212. Finished-Time: & 2023-02-09 07:53:07,076\\
  213. Time-Consumption & 1.203s\\
  214. \midrule
  215. \multicolumn{2}{l}{\bf{Testresults:}}\\
  216. \midrule
  217. \bf{\,Info } & Changing valve temperature setpoint to '20.0'\\
  218. \bf{\,\textcolor{green}{Success} } & Virtual device valve temperature is correct (Content 20 and Type is $<$class 'int'$>$).\\
  219. \bf{\,\textcolor{green}{Success} } & Virtual device user temperature is correct (Content 20 and Type is $<$class 'int'$>$).\\
  220. \bf{\,Info } & Changing videv user temperature setpoint to '25.0'\\
  221. \bf{\,\textcolor{green}{Success} } & Valve device temperature setpoint is correct (Content 25 and Type is $<$class 'int'$>$).\\
  222. \bf{\,\textcolor{green}{Success} } & Virtual device valve temperature is correct (Content 25 and Type is $<$class 'int'$>$).\\
  223. \bf{\,Info } & Changing valve temperature setpoint to '20.0'\\
  224. \bf{\,\textcolor{green}{Success} } & Virtual device valve temperature is correct (Content 20 and Type is $<$class 'int'$>$).\\
  225. \bf{\,\textcolor{green}{Success} } & Virtual device user temperature is correct (Content 20 and Type is $<$class 'int'$>$).\\
  226. \bf{\,Info } & Changing videv user temperature setpoint to '25.0'\\
  227. \bf{\,\textcolor{green}{Success} } & Valve device temperature setpoint is correct (Content 25 and Type is $<$class 'int'$>$).\\
  228. \bf{\,\textcolor{green}{Success} } & Virtual device valve temperature is correct (Content 25 and Type is $<$class 'int'$>$).\\
  229. \bottomrule
  230. \end{longtabu}
  231. \end{document}