* Helper function that returns a Appc protobuf object for given * parameters. * * @param name Appc image name. * @param arch Machine architecture(e.g, x86, amd64). * @param os Operating system(e.g, linux). * @return Appc protobuf message object. */
| 89 | * @return Appc protobuf message object. |
| 90 | */ |
| 91 | static Image::Appc getAppcImage( |
| 92 | const string& name, |
| 93 | const string& arch = "amd64", |
| 94 | const string& os = "linux") |
| 95 | { |
| 96 | Image::Appc appc; |
| 97 | appc.set_name(name); |
| 98 | |
| 99 | Label archLabel; |
| 100 | archLabel.set_key("arch"); |
| 101 | archLabel.set_value(arch); |
| 102 | |
| 103 | Label osLabel; |
| 104 | osLabel.set_key("os"); |
| 105 | osLabel.set_value(os); |
| 106 | |
| 107 | Labels labels; |
| 108 | labels.add_labels()->CopyFrom(archLabel); |
| 109 | labels.add_labels()->CopyFrom(osLabel); |
| 110 | |
| 111 | appc.mutable_labels()->CopyFrom(labels); |
| 112 | |
| 113 | return appc; |
| 114 | } |
| 115 | |
| 116 | |
| 117 | class AppcStoreTest : public TemporaryDirectoryTest |