# For now, a missing checksum file will be supported.
# No files will be validated.
- validated_files = self._validator.validate(package)
+ self._validator.validate(package)
+ validated_files = self._validator.checksums
self.assertEquals(validated_files, {})
def test_package_with_checksum(self):
package = self.create_nsd_package_with_checksum()
- validated_files = self._validator.validate(package)
+ self._validator.validate(package)
+ validated_files = self._validator.checksums
self.assertEquals(list(validated_files.keys()), [nsd_filename])
"launchpad/packages/vnfd",
uid)
- package_path = os.path.join(path, "pong_vnfd")
+ asset_path = os.path.join(path, "icons")
- os.makedirs(package_path)
+ os.makedirs(asset_path)
open(os.path.join(path, "pong_vnfd.xml"), "wb").close()
- open(os.path.join(path, "logo.png"), "wb").close()
+ open(os.path.join(asset_path, "logo.png"), "wb").close()
return uid, path
"package_type": "VNFD",
"package_id": uid,
"external_url": "https://raw.githubusercontent.com/RIFTIO/RIFT.ware/master/rift-shell",
- "package_path": "icons/rift-shell"})
+ "vnfd_file_type": "ICONS",
+ "package_path": "rift-shell"})
rpc_out = yield from self.dts.query_rpc(
"I,/rw-pkg-mgmt:package-file-add",
ip)
yield from asyncio.sleep(5, loop=self.loop)
- filepath = os.path.join(path, ip.package_path)
+ filepath = os.path.join(path, ip.vnfd_file_type.lower(), ip.package_path)
assert os.path.isfile(filepath)
mode = oct(os.stat(filepath)[stat.ST_MODE])
assert str(mode) == "0o100664"
ip = RwPkgMgmtYang.YangInput_RwPkgMgmt_PackageFileDelete.from_dict({
"package_type": "VNFD",
"package_id": uid,
+ "vnfd_file_type": "ICONS",
"package_path": "logo.png"})
- assert os.path.isfile(os.path.join(path, ip.package_path))
+ assert os.path.isfile(os.path.join(path, ip.vnfd_file_type.lower(), ip.package_path))
rpc_out = yield from self.dts.query_rpc(
"I,/rw-pkg-mgmt:package-file-delete",
ip)
yield from asyncio.sleep(5, loop=self.loop)
- assert not os.path.isfile(os.path.join(path, ip.package_path))
+ assert not os.path.isfile(os.path.join(path, ip.vnfd_file_type.lower(), ip.package_path))
shutil.rmtree(path)