Ver Fonte

versiond updates and simple test

clementinecomputing há 6 anos atrás
pai
commit
b686859720

+ 3 - 3
server/daemons/version_server/ridelogic_versiond

@@ -60,16 +60,16 @@ sub CheckinServerReply
 	my $response = '';
 	
 	my @client_values = split(/[\t]/, $client_query, -1);   #the -1 keeps split from trimming trailing blank fields
-		#0.	viper_num	(0 for Phase II)
+		#0.	busunit_num	(0 for Phase II)
 		#1.	equip_num	(usually bogus for Phase I)
-		#2.	eth0_mac	(Effectively a serial number of the SBC (be it Viper, Titan, or some Atom based system)
+		#2.	eth0_mac	(Effectively a serial number of the SBC
 		#3.	cell_imei	(Effectively a serial number of the Cell Modem)
 		#4.	cell_imsi	(Effectively a serial number of the SIM card inserted in the modem)	
 		#5.	version_strings (a concatenation of package versions)
 
 	$client_values[0] =~ s/^[^0-9]*//;	#Strip the leading '#' (and anything else non-numeric) from our string
 
-	$sth = $dbh->prepare('INSERT INTO bus_checkin_log (viper_num, equip_num, eth0_mac, cell_imei, cell_imsi, version_data) VALUES (?, ?, ?, ?, ?, ?)');
+	$sth = $dbh->prepare('INSERT INTO bus_checkin_log (busunit_num, equip_num, eth0_mac, cell_imei, cell_imsi, version_data) VALUES (?, ?, ?, ?, ?, ?)');
 
 	#    We explicitly chop this down to the 6 fields we want to insert, rather than passing @client_values as a parameter so
 	#that if some foolish version string goes and contains a tab (this should never happen!) it will be trunctated instead

+ 3 - 3
server/daemons/version_server/version_daemon.pl

@@ -136,16 +136,16 @@ sub CheckinServerReply
 	my $response = '';
 	
 	my @client_values = split(/[\t]/, $client_query, -1);   #the -1 keeps split from trimming trailing blank fields
-		#0.	viper_num	(0 for Phase II)
+		#0.	busunit_num	(0 for Phase II)
 		#1.	equip_num	(usually bogus for Phase I)
-		#2.	eth0_mac	(Effectively a serial number of the SBC (be it Viper, Titan, or some Atom based system)
+		#2.	eth0_mac	(Effectively a serial number of the SBC
 		#3.	cell_imei	(Effectively a serial number of the Cell Modem)
 		#4.	cell_imsi	(Effectively a serial number of the SIM card inserted in the modem)	
 		#5.	version_strings (a concatenation of package versions)
 
 	$client_values[0] =~ s/^[^0-9]*//;	#Strip the leading '#' (and anything else non-numeric) from our string
 
-	$sth = $dbh->prepare('INSERT INTO bus_checkin_log (viper_num, equip_num, eth0_mac, cell_imei, cell_imsi, version_data) VALUES (?, ?, ?, ?, ?, ?)');
+	$sth = $dbh->prepare('INSERT INTO bus_checkin_log (busunit_num, equip_num, eth0_mac, cell_imei, cell_imsi, version_data) VALUES (?, ?, ?, ?, ?, ?)');
 
 	#    We explicitly chop this down to the 6 fields we want to insert, rather than passing @client_values as a parameter so
 	#that if some foolish version string goes and contains a tab (this should never happen!) it will be trunctated instead

+ 20 - 0
server/testing/test-vectors/testvector-version

@@ -0,0 +1,20 @@
+#!/bin/bash
+#
+
+# insert into update_level
+#   (equip_num, client_file, checksum, file_size, file_path, fileversion)
+#   values
+#   (0, 'firmware.tgz', 'f4f2bf39211e613e09e7a022c8a4413c', 123, 'firmware-0.1.tgz', '0.1');
+# insert into update_level
+#   (equip_num, client_file, checksum, file_size, file_path, fileversion)
+#   values
+#   (0, 'config.tgz', 'ad606d6a24a2dec982bc2993aaaf9160', 125, 'config-0.2.tgz', '0.2');
+
+# busunit_num,equip_num,eth0,imei,imsi,version
+echo -e '#9090\t9999\tca:fe:ca:fe:ca:fe\t356136074279052\t310260877138191\tx' | \
+  nc localhost 8377
+
+# equip_num,filename=md5sum,...
+echo -e '9999\tfirmware.tgz=x\tconfig.tgz=y' | \
+  nc localhost 8377
+