about how to integrate it in our processes.
Thursday, February 3, 2022
Customer focus powered by SBT and Automation
about how to integrate it in our processes.
Thursday, July 8, 2021
Testing shared memory communications with Linux on Z
Mainframes allow for shared memory communications between LPARs on the same box through ISM - internal shared memory. More information about the Linux device driver can be found here.
IBM provides open-source tools including smc_run which easily converts an application's usage of TCP/IP sockets to SMC (shared memory connection) sockets.
Let's suppose you want to check two of your LPARs can communicate with each other.
First you'd want to check if ISM is available. As ISM are made available as virtual pci devices, you can simply run lspci on each LPAR.
# lspci 00:00.0 Non-VGA unclassified device: IBM Internal Shared Memory (ISM) virtual PCI deviceIf your admin tells you have been provided the ISM device but you don't see it you might have to power it on.
# echo 1 > /sys/bus/pci/slots/0000032/powerNow, smc_run will convert any TCP/IP socket usage to an SMC socket. So let's suppose you have an echo server using the AF_NET protocol that you can start via commandline; you'd simply run the same command.
[host1]# smc_run python3 echo_server.py --host my_host_name.example.org --port 12345You can then simply send data from a client in the same way.
[host2]# smc_run python3 send_data.py --host my_host_name.example.org --port 12345 some dataLooks like it's working right? But does it really?
SMC socket capabilities are negotiated at connection setup. If one peer is not SMC capable, further socket processing falls back to TCP usage automatically.
So, how can we make sure that our LPARs really communicate through the ISM?
The s390-tools luckily deliver another tool smcss. It shows details for AF_SMC socket connections. The Mode column shows how data is exchanged:
SMCD The SMC socket uses SMC-D for data exchange.
SMCR The SMC socket uses SMC-R for data exchange.
TCP The SMC socket uses the TCP protocol for data exchange, because an SMC connection could not be established.
And really, the difference can be confirmed while the connection is open depending on the availability of ISM on both LPARs.
[host1]# smcss State UID Inode Local Address Peer Address Intf Mode ACTIVE 00000 22045079 192.168.0.10:12223 192.168.0.12:37060 0000 SMCDvs.
[host1]# smcss State UID Inode Local Address Peer Address Intf Mode ACTIVE 00000 22049662 192.168.0.10:12223 192.168.0.12:37058 0000 TCP 0x05000000/0x03030000
Finally, the s390-tools since version 1.5 also offers another tool that helps to check the ISM live-connectivity without a TCP application, smc_chk. You can shortly run:
[host1]# smc_chk -S Server started on port 37374
[host2]# smc_chk -C 192.168.0.12 -p 37374
Test with target IP 192.168.0.12 and port 37374
Live test (SMC-D and SMC-R, EXPERIMENTAL)
Success, using SMC-DFriday, September 4, 2020
How to align on the right - partition alignment algorithm
In MSDOS 6.22 there are alignment restrictions for partitions. This means a partition of size capacity = /start - end/ = end - start, partition boundaries (start, end) must coincide with certain boundaries; in this case cylinder boundaries.
The following alignment algorithm is taken from the libvirt virtualization API.
In short, the algorithm will make sure allocated continuous space is aligned on the right, that is on the end. If the available free space for alignment already starts at a given boundary value, it will be fully aligned [1].
We'll have:
- Input: c := capacity, l := alignment interval, s := start
- Output: e := end
- s = m*l, for some m (the start is aligned at a boundary)
- s != m*l; s mod l <= r (the start offset fits into the extra space reserved for alignment)
- s != m*l; s mod l > r (the start offset doesn't fit)
Monday, July 27, 2020
Set up Crypto Card passthrough with KVM on IBM Z (vfio-ap)
- A System Z host with a crypto card, KVM guest
- lszcrypt command (from s390tools, often comes preinstalled with distro, package name can be s390utils, too)
- Identify the device
- Mark device queues as not usable by host
- Create mediated device
- Assign crypto device to mediated device
- Attach mediated device to guest
- Verify setup
- HWTYPE: passthrough is only supported if this number is >= 10
- CARD.DOMAIN: 0x01 (adapter id), 0x0011 (domain id)
- Mark adapter not usable by host:
- echo -0x01 > /sys/bus/ap/apmask
- Mark device queues not usable by host:
- echo -0x0011 > /sys/bus/ap/aqmask
<hostdev mode='subsystem' type='mdev' model='vfio-ap'>
<source>
<address uuid='$uuid'/>
</source>
</hostdev>
Tuesday, April 28, 2020
The testing effort growth
Define a program to be a function from a set of input variables to a set of output variables,
P = Input x P|Output = I x O
= { (j_1,...,j_n) x (o_1,...,o_m) }
= { (j_1,...,j_n,o_1,...,o_m) }.
Each component of Input is supposed to have at least 2 elements. (If not, the input variable will never change the image value, in other words, the program's behavior, and can therefore be eliminated. The case where an input value is determine to be defined or not,
Input ≃ { 0, {0} }.)
Also, I need to restrict to the case where the dim(I) > 1 because if not each extra value to test adds exactly one test case (linear growth).
T : Input x Ω -> Input x Output
T(i, ω) = (i, T_1(i, ω),..., T_m(i, ω)).
Each T_j is an expected output or simply expectation or post-condition.
A test passes if T_j(ω) = P(i)_j for all j, or fails otherwise, for a test execution ω.
A test case of a feature is then simply T|F = T|J x Ω where F = P|J.
- extending the domain of an input variable J_i by an additional value j' that defines a new behavior of the program, that is for some i, J_i' = J_i + { j' } and Input = J_1 x ... x J_i' x ... x J_n
- extending the set of input variables by an additional dimension J_n+1
#T|F' = #{ (J_1,...,J_n) x J_n+1 x O }
= #J * #J_n+1 * # O
= #T|F * #J_n+1
≥ #T|F * 2.
As for 1., given that dim(J) > 1 each new value j' creates another full set of combinations of input variables (j_1,...,j',...,j_n), that is, the number of added test cases is
#T|F' - #T|F = #J_1,...,^J_i,...,J_n
≥ 2^(n-1)
where ^J_i denotes not selecting this component.
Therefore,
#T|F' ≥ #T|F + 2^(n-1).
So, in general adding a new value to test, the lower bound for growth is 2^(n-1). ⃞
Considering that the effort E|F of testing a feature depends on the selected test suite S|F < T|F, we might dare say that selecting S|F and the methods to evaluate T(i, ω) is a very important activity in testing.
I hope this makes sense...
Thursday, March 26, 2020
ssh into libvirt guest
# virsh domifaddr vm
Name MAC address Protocol Address
-------------------------------------------------------------------------------
vnet0 52:54:00:6f:dc:90 ipv4 192.168.122.84/24
# virsh dumpxml --inactive vm
...
<interface type="network">
<mac address="52:54:00:6f:dc:90">
<source network="default"></source>
<model type="virtio">
<address bus="0x00" domain="0x0000" function="0x0" slot="0x03" type="pci">
</address>
...
What you can do instead is use the NSS module libvirt-nss.
If you want to easily ssh into the guest using its libvirt name, set
# /etc/nsswitch.conf: hosts: files libvirt_guest dnsand make sure to have the correct sshd configuration in your guest.
Tuesday, February 21, 2017
Sunk Cost Fallacy - Let's talk about bias 3
Sunk Cost Fallacy - Are you Lean enough?
- You see this huge beautiful implementation arriving testing. Verification passes without any flaw. You then notice: validation fails! This is not really what we wanted. Do you dare to create a bug and vote for throwing away / reworking all that hard and good work? Do you try to bend in and persuade any opposing mind to believe that that's what they wanted? Sometimes this is not the worst choice - sometimes clients just don't know what they want XD
- You've convinced everybody you need those automated tests / manual test scripts / test management system - whatever - to improve your testing process and all over quality of your product(s). It becomes a nuissance in time, things change, tempora mutantur. Are you willing to let go, to not hold it back anymore? Throw away what lacks purpose and be really lean.
