Skip to content

Commit 7511a6f

Browse files
committed
testing: Install a package via apt-get to get a second SWIMA software event
This installs tmux and its two dependencies libevent-2.0-5 and libutempter0. For the tnc/tnccs-20-ev-pt-tls test scenario older, apparently replaced versions of these packages are entered to the collector.db database, so that dummy SWID tags for these packages can be requested via SWIMA.
1 parent b217bdf commit 7511a6f

File tree

4 files changed

+47
-1
lines changed

4 files changed

+47
-1
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#! /bin/sh
22

33
cat /usr/local/share/strongswan/templates/database/sw-collector/sw_collector_tables.sql | sqlite3 /etc/db.d/collector.db
4+
sed -i "s:DEBIAN_VERSION:`cat /etc/debian_version`:" /etc/pts/collector.sql
5+
cat /etc/pts/collector.sql | sqlite3 /etc/db.d/collector.db
46
LEAK_DETECTIVE_DISABLE=1 /usr/local/sbin/sw-collector

testing/scripts/build-baseimage

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ INC=automake,autoconf,libtool,bison,flex,gperf,pkg-config,gettext,less,locales
1616
INC=$INC,build-essential,libgmp-dev,libldap2-dev,libcurl4-openssl-dev,ethtool
1717
INC=$INC,libxml2-dev,libtspi-dev,libsqlite3-dev,openssh-server,tcpdump,psmisc
1818
INC=$INC,openssl,vim,sqlite3,conntrack,gdb,cmake,libltdl-dev,liblog4cxx10-dev
19-
INC=$INC,libboost-thread-dev,libboost-system-dev,git-core,iperf,htop,screen
19+
INC=$INC,libboost-thread-dev,libboost-system-dev,git-core,iperf,htop
2020
INC=$INC,gnat,gprbuild,acpid,acpi-support-base,libldns-dev,libunbound-dev
2121
INC=$INC,dnsutils,libsoup2.4-dev,ca-certificates,unzip,libsystemd-dev
2222
INC=$INC,python,python-setuptools,python-dev,python-pip,apt-transport-https
@@ -36,6 +36,8 @@ stretch)
3636
esac
3737
SERVICES="apache2 dbus isc-dhcp-server slapd bind9 freeradius"
3838
INC=$INC,${SERVICES// /,}
39+
# packages to install via APT, for SWIMA tests
40+
APT="tmux"
3941
# additional services to disable
4042
SERVICES="$SERVICES systemd-timesyncd.service"
4143

@@ -117,6 +119,8 @@ log_status $?
117119

118120
log_action "Update package sources"
119121
execute_chroot "apt-get update"
122+
log_action "Install packages via APT"
123+
execute_chroot "apt-get -y install $APT"
120124
log_action "Install packages from custom repo"
121125
execute_chroot "apt-get -y upgrade"
122126

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/* SW Identifiers */
2+
3+
INSERT INTO sw_identifiers (
4+
name, package, version, source, installed
5+
) VALUES (
6+
'strongswan.org__Debian_DEBIAN_VERSION-x86_64-libutempter0-1.1.5', 'libutempter0', '1.1.5', 1, 0
7+
);
8+
9+
INSERT INTO sw_identifiers (
10+
name, package, version, source, installed
11+
) VALUES (
12+
'strongswan.org__Debian_DEBIAN_VERSION-x86_64-libevent-2.0-5-2.0.20', 'libevent-2.0-5', '2.0.20', 1, 0
13+
);
14+
15+
INSERT INTO sw_identifiers (
16+
name, package, version, source, installed
17+
) VALUES (
18+
'strongswan.org__Debian_DEBIAN_VERSION-x86_64-tmux-2.2', 'tmux', '2.2', 1, 0
19+
);
20+
21+
/* SW Events */
22+
23+
INSERT INTO sw_events (
24+
eid, sw_id, action
25+
) VALUES (
26+
2, 1, 2
27+
);
28+
29+
INSERT INTO sw_events (
30+
eid, sw_id, action
31+
) VALUES (
32+
2, 2, 2
33+
);
34+
35+
INSERT INTO sw_events (
36+
eid, sw_id, action
37+
) VALUES (
38+
2, 3, 2
39+
);

testing/tests/tnc/tnccs-20-ev-pt-tls/posttest.dat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
carol::ip route del 10.1.0.0/16 via 192.168.0.1
22
dave::ip route del 10.1.0.0/16 via 192.168.0.1
33
winnetou::ip route del 10.1.0.0/16 via 192.168.0.1
4+
carol::rm /etc/pts/collector.sql
45
alice::systemctl stop strongswan-swanctl
56
alice::systemctl stop apache2
67
alice::rm /etc/swanctl/rsa/aaaKey.pem

0 commit comments

Comments
 (0)